Changeset 24907 in osm for applications/editors/josm/plugins/cadastre-fr/src/cadastre_fr/WMSLayer.java
- Timestamp:
- 2010-12-29T23:18:37+01:00 (15 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
applications/editors/josm/plugins/cadastre-fr/src/cadastre_fr/WMSLayer.java
r23190 r24907 59 59 public static int currentFormat; 60 60 61 private static final int cBBoxForBuildings = 50; // hard coded size of grabbed boxes for building layers62 63 61 private ArrayList<EastNorthBound> dividedBbox = new ArrayList<EastNorthBound>(); 64 62 … … 77 75 private boolean isRaster = false; 78 76 private boolean isAlreadyGeoreferenced = false; 79 private boolean buildingsOnly = false;80 77 public double X0, Y0, angle, fX, fY; 81 78 … … 95 92 96 93 public WMSLayer(String location, String codeCommune, int lambertZone) { 97 super(buildName(location, codeCommune , false));94 super(buildName(location, codeCommune)); 98 95 this.location = location; 99 96 this.codeCommune = codeCommune; … … 118 115 } 119 116 120 private static String buildName(String location, String codeCommune , boolean buildingOnly) {117 private static String buildName(String location, String codeCommune) { 121 118 String ret = location.toUpperCase(); 122 119 if (codeCommune != null && !codeCommune.equals("")) 123 120 ret += "(" + codeCommune + ")"; 124 if (buildingOnly)125 ret += ".b";126 121 return ret; 127 122 } 128 123 129 124 private String rebuildName() { 130 return buildName(this.location.toUpperCase(), this.codeCommune , this.buildingsOnly);125 return buildName(this.location.toUpperCase(), this.codeCommune); 131 126 } 132 127 … … 142 137 divideBbox(b, Integer.parseInt(Main.pref.get("cadastrewms.rasterDivider", 143 138 CadastrePreferenceSetting.DEFAULT_RASTER_DIVIDER)), 0); 144 } else if (buildingsOnly) 145 divideBbox(b, 5, cBBoxForBuildings); 146 else 139 } else 147 140 divideBbox(b, Integer.parseInt(Main.pref.get("cadastrewms.scale", Scale.X1.toString())), 0); 148 141 } else … … 155 148 GeorefImage newImage; 156 149 try { 157 if (buildingsOnly == false) 158 newImage = grabber.grab(this, n.min, n.max); 159 else { // TODO 160 GeorefImage buildings = grabber.grabBuildings(this, n.min, n.max); 161 GeorefImage parcels = grabber.grabParcels(this, n.min, n.max); 162 new BuildingsImageModifier(buildings, parcels); 163 newImage = buildings; 164 } 150 newImage = grabber.grab(this, n.min, n.max); 165 151 } catch (IOException e) { 166 152 System.out.println("Download action cancelled by user or server did not respond"); … … 189 175 } 190 176 if (!cancelled) { 191 if (buildingsOnly)192 joinBufferedImages();193 177 for (int i=lastSavedImage; i < images.size(); i++) 194 178 saveToCache(images.get(i)); … … 197 181 198 182 /** 199 * 183 * Divides the bounding box in smaller polygons. 184 * 200 185 * @param b the original bbox, usually the current bbox on screen 201 186 * @param factor 1 = source bbox 1:1 … … 398 383 } 399 384 400 public boolean isBuildingsOnly() {401 return buildingsOnly;402 }403 404 public void setBuildingsOnly(boolean buildingsOnly) {405 this.buildingsOnly = buildingsOnly;406 setName(rebuildName());407 }408 409 385 public boolean isRaster() { 410 386 return isRaster; … … 458 434 oos.writeInt(this.lambertZone); 459 435 oos.writeBoolean(this.isRaster); 460 oos.writeBoolean( this.buildingsOnly);436 oos.writeBoolean(false); // previously buildingsOnly 461 437 if (this.isRaster) { 462 438 oos.writeDouble(this.rasterMin.getX()); … … 491 467 this.setRaster(ois.readBoolean()); 492 468 if (currentFormat >= 4) 493 this.setBuildingsOnly(ois.readBoolean());469 ois.readBoolean(); 494 470 if (this.isRaster) { 495 471 double X = ois.readDouble();
Note:
See TracChangeset
for help on using the changeset viewer.
