Changeset 33651 in osm for applications/editors/josm/plugins/cadastre-fr
- Timestamp:
- 2017-09-22T02:58:54+02:00 (7 years ago)
- Location:
- applications/editors/josm/plugins/cadastre-fr/src/org/openstreetmap/josm/plugins/fr/cadastre/edigeo
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
applications/editors/josm/plugins/cadastre-fr/src/org/openstreetmap/josm/plugins/fr/cadastre/edigeo/EdigeoFileGEN.java
r33649 r33651 7 7 import java.nio.file.Path; 8 8 9 import org.openstreetmap.josm.data.Bounds; 10 import org.openstreetmap.josm.data.coor.EastNorth; 9 11 import org.openstreetmap.josm.data.osm.DataSet; 12 import org.openstreetmap.josm.data.projection.Projection; 10 13 import org.openstreetmap.josm.plugins.fr.cadastre.edigeo.EdigeoFileGEN.GenBlock; 11 14 import org.openstreetmap.josm.plugins.fr.cadastre.edigeo.EdigeoFileTHF.ChildBlock; … … 27 30 */ 28 31 public static class GeoBounds extends GenBlock { 29 /** CM1 */ String min = "";30 /** CM2 */ String max = "";32 /** CM1 */ EastNorth min; 33 /** CM2 */ EastNorth max; 31 34 32 35 GeoBounds(Lot lot, String type) { … … 37 40 void processRecord(EdigeoRecord r) { 38 41 switch (r.name) { 39 case "CM1": safeGet(r, s -> min += s); break;40 case "CM2": safeGet(r, s -> max += s); break;42 case "CM1": min = safeGetEastNorth(r); break; 43 case "CM2": max = safeGetEastNorth(r); break; 41 44 default: 42 45 super.processRecord(r); … … 48 51 * @return the minimal coordinates 49 52 */ 50 public final StringgetMinCm1() {53 public final EastNorth getMinCm1() { 51 54 return min; 52 55 } … … 56 59 * @return the maximal coordinates 57 60 */ 58 public final StringgetMaxCm2() {61 public final EastNorth getMaxCm2() { 59 62 return max; 63 } 64 65 /** 66 * Returns the bounds. 67 * @return the bounds 68 */ 69 public Bounds getBounds() { 70 /* 71 for (String s : Projections.getAllProjectionCodes()) { 72 Projection p = Projections.getProjectionByCode(s); 73 LatLon en = p.eastNorth2latlon(min); 74 double lat = en.lat(); 75 double lon = en.lon(); 76 if (43 <= lat && lat <= 44 && 1.38 <= lon && lon <= 1.45) { 77 System.out.println(s + ": " + p); 78 } 79 } 80 */ 81 Projection proj = lot.geo.getCoorReference().getProjection(); 82 return new Bounds(proj.eastNorth2latlon(min), proj.eastNorth2latlon(max)); 60 83 } 61 84 } … … 154 177 return this; 155 178 } 179 180 /** 181 * Returns the geographic bounds. 182 * @return the geographic bounds 183 */ 184 public final GeoBounds getGeoBounds() { 185 return blocks.getInstances(GeoBounds.class).get(0); 186 } 156 187 } -
applications/editors/josm/plugins/cadastre-fr/src/org/openstreetmap/josm/plugins/fr/cadastre/edigeo/EdigeoFileTHF.java
r33649 r33651 444 444 for (Lot lot : getLots()) { 445 445 lot.readFiles(path, ds); 446 //ds.addDataSource(new DataSource(lot.gen.getGeoBounds().getBounds(), support.author)); 446 447 } 447 448 return this;
Note:
See TracChangeset
for help on using the changeset viewer.