Changeset 33643 in osm for applications/editors/josm/plugins/cadastre-fr
- Timestamp:
- 2017-09-20T23:44:57+02:00 (7 years ago)
- Location:
- applications/editors/josm/plugins/cadastre-fr/src/org/openstreetmap/josm/plugins/fr/cadastre/edigeo
- Files:
-
- 7 added
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
applications/editors/josm/plugins/cadastre-fr/src/org/openstreetmap/josm/plugins/fr/cadastre/edigeo/EdigeoFile.java
r33642 r33643 56 56 57 57 EdigeoFile(Path path) throws IOException { 58 init(); 58 59 try (BufferedReader reader = Files.newBufferedReader(path, StandardCharsets.ISO_8859_1)) { 59 60 String line; … … 95 96 } 96 97 } 98 } 99 100 protected void init() { 101 // To be overidden if needed 97 102 } 98 103 -
applications/editors/josm/plugins/cadastre-fr/src/org/openstreetmap/josm/plugins/fr/cadastre/edigeo/EdigeoFileTHF.java
r33642 r33643 60 60 Support(String type) { 61 61 super(type); 62 }63 64 /**65 * Returns author.66 * @return author67 */68 public final String getAuthor() {69 return author;70 }71 72 /**73 * Returns recipient.74 * @return recipient75 */76 public final String getRecipient() {77 return recipient;78 }79 80 /**81 * Returns number of geographic lots.82 * @return number of geographic lots83 */84 public final int getnLots() {85 return nLots;86 }87 88 /**89 * Returns number of volumes.90 * @return number of volumes91 */92 public final int getnVolumes() {93 return nVolumes;94 }95 96 /**97 * Returns security classification.98 * @return security classification99 */100 public final SecurityClassification getSecurity() {101 return security;102 }103 104 /**105 * Returns diffusion restriction.106 * @return diffusion restriction107 */108 public final String getDiffusionRestriction() {109 return diffusionRestriction;110 }111 112 /**113 * Returns Edigeo version.114 * @return Edigeo version115 */116 public final String getEdigeoVersion() {117 return edigeoVersion;118 }119 120 /**121 * Returns Edigeo date.122 * @return Edigeo date123 */124 public final LocalDate getEdigeoDate() {125 return edigeoDate;126 }127 128 /**129 * Returns name of transmission.130 * @return name of transmission131 */132 public final String getTransmissionName() {133 return transmissionName;134 }135 136 /**137 * Returns edition number of transmission.138 * @return edition number of transmission139 */140 public final int getTransmissionEdition() {141 return transmissionEdition;142 }143 144 /**145 * Returns date of transmission.146 * @return date of transmission147 */148 public final LocalDate getTransmissionDate() {149 return transmissionDate;150 }151 152 /**153 * Returns general information about transmission.154 * @return general information about transmission155 */156 public final String getTransmissionInformation() {157 return transmissionInformation;158 62 } 159 63 … … 176 80 super.processRecord(r); 177 81 } 82 } 83 84 /** 85 * Returns author. 86 * @return author 87 */ 88 public final String getAuthor() { 89 return author; 90 } 91 92 /** 93 * Returns recipient. 94 * @return recipient 95 */ 96 public final String getRecipient() { 97 return recipient; 98 } 99 100 /** 101 * Returns number of geographic lots. 102 * @return number of geographic lots 103 */ 104 public final int getnLots() { 105 return nLots; 106 } 107 108 /** 109 * Returns number of volumes. 110 * @return number of volumes 111 */ 112 public final int getnVolumes() { 113 return nVolumes; 114 } 115 116 /** 117 * Returns security classification. 118 * @return security classification 119 */ 120 public final SecurityClassification getSecurity() { 121 return security; 122 } 123 124 /** 125 * Returns diffusion restriction. 126 * @return diffusion restriction 127 */ 128 public final String getDiffusionRestriction() { 129 return diffusionRestriction; 130 } 131 132 /** 133 * Returns Edigeo version. 134 * @return Edigeo version 135 */ 136 public final String getEdigeoVersion() { 137 return edigeoVersion; 138 } 139 140 /** 141 * Returns Edigeo date. 142 * @return Edigeo date 143 */ 144 public final LocalDate getEdigeoDate() { 145 return edigeoDate; 146 } 147 148 /** 149 * Returns name of transmission. 150 * @return name of transmission 151 */ 152 public final String getTransmissionName() { 153 return transmissionName; 154 } 155 156 /** 157 * Returns edition number of transmission. 158 * @return edition number of transmission 159 */ 160 public final int getTransmissionEdition() { 161 return transmissionEdition; 162 } 163 164 /** 165 * Returns date of transmission. 166 * @return date of transmission 167 */ 168 public final LocalDate getTransmissionDate() { 169 return transmissionDate; 170 } 171 172 /** 173 * Returns general information about transmission. 174 * @return general information about transmission 175 */ 176 public final String getTransmissionInformation() { 177 return transmissionInformation; 178 178 } 179 179 } … … 226 226 } 227 227 } 228 229 /** 230 * Returns name. 231 * @return name 232 */ 233 public final String getName() { 234 return name; 235 } 236 237 /** 238 * Returns general information. 239 * @return general information 240 */ 241 public final String getInformation() { 242 return information; 243 } 244 245 /** 246 * Returns general data subset name. 247 * @return general data subset name 248 */ 249 public final String getGenDataName() { 250 return genDataName; 251 } 252 253 /** 254 * Returns general data subset identifier. 255 * @return general data subset identifier 256 */ 257 public final String getGenDataId() { 258 return genDataId; 259 } 260 261 /** 262 * Returns coordinates reference subset name. 263 * @return coordinates reference subset name 264 */ 265 public final String getCoorRefName() { 266 return coorRefName; 267 } 268 269 /** 270 * Returns coordinates reference subset identifier. 271 * @return coordinates reference subset identifier 272 */ 273 public final String getCoorRefId() { 274 return coorRefId; 275 } 276 277 /** 278 * Returns quality subset name. 279 * @return quality subset name 280 */ 281 public final String getQualityName() { 282 return qualityName; 283 } 284 285 /** 286 * Returns quality subset identifier. 287 * @return quality subset identifier 288 */ 289 public final String getQualityId() { 290 return qualityId; 291 } 292 293 /** 294 * Returns dictionary subset name. 295 * @return dictionary subset name 296 */ 297 public final String getDictName() { 298 return dictName; 299 } 300 301 /** 302 * Returns dictionary subset identifier. 303 * @return dictionary subset identifier 304 */ 305 public final String getDictId() { 306 return dictId; 307 } 308 309 /** 310 * Returns SCD subset name. 311 * @return SCD subset name 312 */ 313 public final String getScdName() { 314 return scdName; 315 } 316 317 /** 318 * Returns SCD subset identifier. 319 * @return SCD subset identifier 320 */ 321 public final String getScdId() { 322 return scdId; 323 } 324 325 /** 326 * Returns number of geographic data subsets. 327 * @return number of geographic data subsets 328 */ 329 public final int getNumberOfGeoData() { 330 return nGeoData; 331 } 332 333 /** 334 * Returns geographic data subset name at index i. 335 * @param i index 336 * @return geographic data subset name at index i 337 */ 338 public final String getGeoDataName(int i) { 339 return geoDataName.get(i); 340 } 341 342 /** 343 * Returns list of geographic data subset names. 344 * @return list of geographic data subset names 345 */ 346 public final List<String> getGeoDataNames() { 347 return Collections.unmodifiableList(geoDataName); 348 } 349 350 /** 351 * Returns list of geographic data subset identifiers. 352 * @return list of geographic data subset identifiers 353 */ 354 public final List<String> getGeoDataIds() { 355 return Collections.unmodifiableList(geoDataId); 356 } 357 358 /** 359 * Returns geographic data subset identifier at index i. 360 * @param i index 361 * @return geographic data subset identifier at index i 362 */ 363 public final String getGeoDataId(int i) { 364 return geoDataId.get(i); 365 } 228 366 } 229 367 … … 240 378 } 241 379 380 @Override 381 protected void init() { 382 lots = new ArrayList<>(); 383 } 384 242 385 /** 243 386 * Returns the support descriptor. … … 263 406 return support; 264 407 case "GTL": 265 if (lots == null) {266 lots = new ArrayList<>();267 }268 408 Lot lot = new Lot(type); 269 409 lots.add(lot); -
applications/editors/josm/plugins/cadastre-fr/src/org/openstreetmap/josm/plugins/fr/cadastre/edigeo/pci/EdigeoPciReader.java
r33642 r33643 12 12 import org.openstreetmap.josm.io.AbstractReader; 13 13 import org.openstreetmap.josm.io.IllegalDataException; 14 import org.openstreetmap.josm.plugins.fr.cadastre.edigeo.EdigeoFileDIC; 15 import org.openstreetmap.josm.plugins.fr.cadastre.edigeo.EdigeoFileGEN; 16 import org.openstreetmap.josm.plugins.fr.cadastre.edigeo.EdigeoFileGEO; 17 import org.openstreetmap.josm.plugins.fr.cadastre.edigeo.EdigeoFileQAL; 18 import org.openstreetmap.josm.plugins.fr.cadastre.edigeo.EdigeoFileSCD; 14 19 import org.openstreetmap.josm.plugins.fr.cadastre.edigeo.EdigeoFileTHF; 20 import org.openstreetmap.josm.plugins.fr.cadastre.edigeo.EdigeoFileTHF.Lot; 21 import org.openstreetmap.josm.plugins.fr.cadastre.edigeo.EdigeoFileVEC; 15 22 16 23 /** … … 39 46 40 47 DataSet parse(Path path, ProgressMonitor instance) throws IOException { 41 // Read THF file48 Path dir = path.getParent(); 42 49 EdigeoFileTHF thf = new EdigeoFileTHF(path); 50 for (Lot lot : thf.getLots()) { 51 EdigeoFileGEN gen = new EdigeoFileGEN(dir.resolve(lot.getName()+lot.getGenDataName()+".GEN")); 52 EdigeoFileGEO geo = new EdigeoFileGEO(dir.resolve(lot.getName()+lot.getCoorRefName()+".GEO")); 53 EdigeoFileDIC dic = new EdigeoFileDIC(dir.resolve(lot.getName()+lot.getDictName()+".DIC")); 54 EdigeoFileSCD scd = new EdigeoFileSCD(dir.resolve(lot.getName()+lot.getScdName()+".SCD")); 55 EdigeoFileQAL qal = new EdigeoFileQAL(dir.resolve(lot.getName()+lot.getQualityName()+".QAL")); 56 for (int i = 0; i < lot.getNumberOfGeoData(); i++) { 57 EdigeoFileVEC vec = new EdigeoFileVEC(dir.resolve(lot.getName()+lot.getGeoDataName(i)+".VEC")); 58 } 59 } 43 60 DataSet ds = new DataSet(); 44 61 ds.setName(thf.getSupport().getIdentifier());
Note:
See TracChangeset
for help on using the changeset viewer.