Changeset 24913 in osm
- Timestamp:
- 2010-12-30T15:21:07+01:00 (14 years ago)
- Location:
- applications/editors/josm/plugins/cadastre-fr/src/cadastre_fr
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
applications/editors/josm/plugins/cadastre-fr/src/cadastre_fr/DownloadWMSVectorImage.java
r24907 r24913 33 33 try { 34 34 if (grabber.getWmsInterface().retrieveInterface(wmsLayer)) { 35 boolean useFactor = true;36 35 if (wmsLayer.images.isEmpty()) { 37 36 // first time we grab an image for this layer … … 52 51 // set vectorized commune bounding box by opening the standard web window 53 52 grabber.getWmsInterface().retrieveCommuneBBox(wmsLayer); 54 // if it is the first layer, use the communeBBox as grab bbox (and not divided)55 if (Main.map.mapView.getAllLayers().size() == 1 ) {56 bounds = wmsLayer.getCommuneBBox().toBounds();57 Main.map.mapView.zoomTo(bounds);58 useFactor = false;59 }60 53 } 61 54 } 62 55 // grab new images from wms server into active layer 63 wmsLayer.grab(grabber, bounds , useFactor);56 wmsLayer.grab(grabber, bounds); 64 57 } 65 58 } catch (DuplicateLayerException e) { -
applications/editors/josm/plugins/cadastre-fr/src/cadastre_fr/WMSLayer.java
r24907 r24913 127 127 128 128 public void grab(CadastreGrabber grabber, Bounds b) throws IOException { 129 grab(grabber, b, true);130 }131 132 public void grab(CadastreGrabber grabber, Bounds b, boolean useFactor) throws IOException {133 129 cancelled = false; 134 if (useFactor) { 130 // if it is the first layer, use the communeBBox as grab bbox (and not divided) 131 if (Main.map.mapView.getAllLayers().size() == 1 ) { 132 b = this.getCommuneBBox().toBounds(); 133 Main.map.mapView.zoomTo(b); 134 divideBbox(b, 1); 135 } else { 135 136 if (isRaster) { 136 137 b = new Bounds(Main.proj.eastNorth2latlon(rasterMin), Main.proj.eastNorth2latlon(rasterMax)); 137 138 divideBbox(b, Integer.parseInt(Main.pref.get("cadastrewms.rasterDivider", 138 CadastrePreferenceSetting.DEFAULT_RASTER_DIVIDER)) , 0);139 CadastrePreferenceSetting.DEFAULT_RASTER_DIVIDER))); 139 140 } else 140 divideBbox(b, Integer.parseInt(Main.pref.get("cadastrewms.scale", Scale.X1.toString())), 0); 141 } else 142 divideBbox(b, 1, 0); 141 divideBbox(b, Integer.parseInt(Main.pref.get("cadastrewms.scale", Scale.X1.toString()))); 142 } 143 143 144 144 int lastSavedImage = images.size(); … … 189 189 * 4 = configurable size from preferences (100 meters per default) rounded 190 190 * allowing grabbing of next contiguous zone 191 * 5 = use the size provided in next argument optionalSize 192 * @param optionalSize box size used when factor is 5. 193 */ 194 private void divideBbox(Bounds b, int factor, int optionalSize) { 191 */ 192 private void divideBbox(Bounds b, int factor) { 195 193 EastNorth lambertMin = Main.proj.latlon2eastNorth(b.getMin()); 196 194 EastNorth lambertMax = Main.proj.latlon2eastNorth(b.getMax()); … … 208 206 } else { 209 207 // divide to fixed size squares 210 int cSquare = factor == 4 ? Integer.parseInt(Main.pref.get("cadastrewms.squareSize", "100")) : optionalSize;208 int cSquare = Integer.parseInt(Main.pref.get("cadastrewms.squareSize", "100")); 211 209 minEast = minEast - minEast % cSquare; 212 210 minNorth = minNorth - minNorth % cSquare;
Note:
See TracChangeset
for help on using the changeset viewer.