Revision 8597
org.gvsig.raster/branches/org.gvsig.raster.2.4/org.gvsig.osm/org.gvsig.osm.provider.legend/src/main/java/org/gvsig/osm/provider/legend/OSMRasterLegendLibrary.java | ||
---|---|---|
52 | 52 |
|
53 | 53 |
@Override |
54 | 54 |
protected void doPostInitialize() throws LibraryException { |
55 |
DynClass metadataDefinition = (DynClass) MetadataLocator.getMetadataManager(); |
|
55 |
DynClass metadataDefinition = (DynClass) MetadataLocator.getMetadataManager() |
|
56 |
.getDefinition(OSMRasterProvider.METADATA_DEFINITION_NAME); |
|
57 |
OSMRasterGetLegend.register(metadataDefinition); |
|
58 |
OSMRasterGetColorTable.register(metadataDefinition); |
|
56 | 59 |
OSMRasterGetColorInterpretation.register(metadataDefinition); |
57 | 60 |
} |
58 | 61 |
} |
org.gvsig.raster/branches/org.gvsig.raster.2.4/org.gvsig.osm/pom.xml | ||
---|---|---|
3 | 3 |
<parent> |
4 | 4 |
<groupId>org.gvsig</groupId> |
5 | 5 |
<artifactId>org.gvsig.desktop</artifactId> |
6 |
<version>2.0.167-SNAPSHOT</version>
|
|
6 |
<version>2.0.215</version>
|
|
7 | 7 |
</parent> |
8 | 8 |
<artifactId>org.gvsig.osm</artifactId> |
9 | 9 |
<version>1.0.0-SNAPSHOT</version> |
... | ... | |
11 | 11 |
<name>org.gvsig.osm</name> |
12 | 12 |
<description>OSM Raster provider</description> |
13 | 13 |
|
14 |
<repositories> |
|
15 |
<repository> |
|
16 |
<id>gvsig-public-http-repository</id> |
|
17 |
<name>gvSIG maven public HTTP repository</name> |
|
18 |
<url>http://devel.gvsig.org/m2repo/j2se</url> |
|
19 |
<releases> |
|
20 |
<enabled>true</enabled> |
|
21 |
<updatePolicy>daily</updatePolicy> |
|
22 |
<checksumPolicy>warn</checksumPolicy> |
|
23 |
</releases> |
|
24 |
<snapshots> |
|
25 |
<enabled>true</enabled> |
|
26 |
<updatePolicy>daily</updatePolicy> |
|
27 |
<checksumPolicy>warn</checksumPolicy> |
|
28 |
</snapshots> |
|
29 |
</repository> |
|
30 |
</repositories> |
|
31 |
|
|
14 | 32 |
<modules> |
15 | 33 |
<module>org.gvsig.osm.app</module> |
16 | 34 |
<module>org.gvsig.osm.provider</module> |
org.gvsig.raster/branches/org.gvsig.raster.2.4/org.gvsig.osm/org.gvsig.osm.provider/src/main/java/org/gvsig/osm/provider/OSMRasterProvider.java | ||
---|---|---|
69 | 69 |
|
70 | 70 |
private Envelope worldExtent; |
71 | 71 |
|
72 |
private Integer maxZoomLevel; |
|
73 |
|
|
72 | 74 |
protected static void registerMetadataDefinition() throws MetadataException { |
73 | 75 |
MetadataManager manager = MetadataLocator.getMetadataManager(); |
74 | 76 |
if (manager.getDefinition(METADATA_DEFINITION_NAME) == null) { |
... | ... | |
230 | 232 |
|
231 | 233 |
Map<Integer, Double> zoomLevels = new HashMap<Integer, Double>(); |
232 | 234 |
|
233 |
Integer maxZoomLevel = (Integer)getParameters().getDynValue(OSMRasterProviderParameters.OSM_MAX_LEVEL_PARAMETER_NAME); |
|
234 |
if(maxZoomLevel==null){ |
|
235 |
maxZoomLevel = OSMRasterLibrary.MAX_ZOOM_LEVEL; |
|
236 |
} |
|
235 |
maxZoomLevel = getMaxZoomLevel(); |
|
237 | 236 |
|
238 | 237 |
double pixelSize = worldExtent.getLength(DIMENSIONS.X)/OSMRasterLibrary.OSM_TILE_SIZE; |
239 | 238 |
for (int zoomLevel = 0; zoomLevel <= maxZoomLevel; zoomLevel++) { |
... | ... | |
249 | 248 |
return this.tileStruct; |
250 | 249 |
} |
251 | 250 |
|
251 |
|
|
252 |
/** |
|
253 |
* @return |
|
254 |
*/ |
|
255 |
private Integer getMaxZoomLevel() { |
|
256 |
if (maxZoomLevel == null) { |
|
257 |
maxZoomLevel = |
|
258 |
(Integer) getParameters().getDynValue(OSMRasterProviderParameters.OSM_MAX_LEVEL_PARAMETER_NAME); |
|
259 |
if (maxZoomLevel == null) { |
|
260 |
maxZoomLevel = OSMRasterLibrary.MAX_ZOOM_LEVEL; |
|
261 |
} |
|
262 |
} |
|
263 |
return maxZoomLevel; |
|
264 |
} |
|
265 |
|
|
252 | 266 |
private OSMImage getOSMImage() { |
253 | 267 |
if(this.image == null){ |
254 | 268 |
this.image = new OSMImage(getTileStruct(), this); |
... | ... | |
314 | 328 |
@Override |
315 | 329 |
public BufferDimensions getDimensions() throws InitializeException { |
316 | 330 |
if(this.dimensions==null){; |
317 |
Double pixelSize = getTileStruct().getPixelSizePerZoomLevel().get(OSMRasterLibrary.MAX_ZOOM_LEVEL);
|
|
331 |
Double pixelSize = getTileStruct().getPixelSizePerZoomLevel().get(getMaxZoomLevel());
|
|
318 | 332 |
Envelope envelope = getTileStruct().getEnvelope(); |
319 | 333 |
int rows = (int)Math.round(envelope.getLength(DIMENSIONS.Y)/pixelSize); |
320 | 334 |
int columns = rows; |
Also available in: Unified diff