Changeset 33653 in osm for applications/editors/josm/plugins/cadastre-fr/src/org/openstreetmap
- Timestamp:
- 2017-09-22T20:37:05+02:00 (7 years ago)
- Location:
- applications/editors/josm/plugins/cadastre-fr/src/org/openstreetmap/josm/plugins/fr/cadastre/edigeo
- Files:
-
- 9 edited
Legend:
- Unmodified
- Added
- Removed
-
applications/editors/josm/plugins/cadastre-fr/src/org/openstreetmap/josm/plugins/fr/cadastre/edigeo/EdigeoFile.java
r33649 r33653 9 9 import java.time.LocalDate; 10 10 import java.time.format.DateTimeFormatter; 11 import java.util.Arrays; 12 import java.util.Collection; 11 13 import java.util.List; 12 14 import java.util.Objects; … … 56 58 } 57 59 60 static boolean areNotNull(Object... objects) { 61 return Arrays.stream(objects).noneMatch(o -> o == null); 62 } 63 64 static boolean areNotEmpty(String... strings) { 65 return areNotNull((Object[]) strings) && Arrays.stream(strings).noneMatch(String::isEmpty); 66 } 67 68 static boolean areSameSize(int size, Collection<?>... collections) { 69 return areNotNull((Object[]) collections) && Arrays.stream(collections).allMatch(c -> c.size() == size); 70 } 71 72 boolean isValid() { 73 return type.length() == 3 && areNotEmpty(identifier); 74 } 75 58 76 protected final void safeGet(EdigeoRecord r, List<String> list) { 59 77 list.add(""); … … 66 84 protected final void safeGet(EdigeoRecord r, Consumer<String> callback) { 67 85 (lastReadString = callback).accept(r.length > 0 ? r.values.get(0) : null); 86 } 87 88 protected final char safeGetChar(EdigeoRecord r) { 89 return r.length > 0 ? r.values.get(0).charAt(0) : 0; 68 90 } 69 91 … … 175 197 currentBlock.processRecord(r); 176 198 } 199 200 abstract boolean isValid(); 177 201 } -
applications/editors/josm/plugins/cadastre-fr/src/org/openstreetmap/josm/plugins/fr/cadastre/edigeo/EdigeoFileDIC.java
r33649 r33653 12 12 import org.openstreetmap.josm.plugins.fr.cadastre.edigeo.EdigeoFileTHF.ChildBlock; 13 13 import org.openstreetmap.josm.plugins.fr.cadastre.edigeo.EdigeoFileTHF.Lot; 14 import org.openstreetmap.josm.plugins.fr.cadastre.edigeo.EdigeoRecord.Format; 14 15 15 16 /** … … 27 28 /** DEF */ String definition = ""; 28 29 /** ORI */ String origin = ""; 29 /** CAT */ String category = "";30 30 31 31 DicBlock(Lot lot, String type) { … … 40 40 case "DEF": safeGet(r, s -> definition += s); break; 41 41 case "ORI": safeGet(r, s -> origin += s); break; 42 case "CAT": safeGet(r, s -> category += s); break;43 42 default: 44 43 super.processRecord(r); … … 46 45 } 47 46 47 @Override 48 boolean isValid() { 49 return super.isValid() && areNotEmpty(code); 50 } 51 48 52 /** 49 53 * Returns code. … … 69 73 return origin; 70 74 } 75 } 76 77 /** 78 * Categorized definition. 79 */ 80 abstract static class CategorizedBlock extends DicBlock { 81 82 enum Category { 83 GENERAL('G'), 84 SPECIFIC('P'); 85 86 final char code; 87 Category(char code) { 88 this.code = code; 89 } 90 91 public static Category of(char code) { 92 for (Category s : values()) { 93 if (s.code == code) { 94 return s; 95 } 96 } 97 throw new IllegalArgumentException(Character.toString(code)); 98 } 99 } 100 101 /** CAT */ Category category; 102 103 CategorizedBlock(Lot lot, String type) { 104 super(lot, type); 105 } 106 107 @Override 108 void processRecord(EdigeoRecord r) { 109 switch (r.name) { 110 case "CAT": category = Category.of(safeGetChar(r)); break; 111 default: 112 super.processRecord(r); 113 } 114 } 115 116 @Override 117 boolean isValid() { 118 return super.isValid() && areNotNull(category); 119 } 71 120 72 121 /** … … 74 123 * @return category 75 124 */ 76 public final StringgetCategory() {125 public final Category getCategory() { 77 126 return category; 78 127 } … … 91 140 * Attribute definition. 92 141 */ 93 public static class AttributeDef extends DicBlock {94 95 /** TYP */ String type = "";142 public static class AttributeDef extends CategorizedBlock { 143 144 /** TYP */ Format type; 96 145 /** UNI */ String unit = ""; 97 146 /** AVC */ int nValues; … … 106 155 void processRecord(EdigeoRecord r) { 107 156 switch (r.name) { 108 case "TYP": safeGet(r, s -> type += s); break;157 case "TYP": type = Format.of(safeGetChar(r)); break; 109 158 case "UNI": safeGet(r, s -> unit += s); break; 110 159 case "AVC": nValues = safeGetInt(r); break; … … 120 169 * @return attribute type 121 170 */ 122 public final StringgetType() {171 public final Format getType() { 123 172 return type; 124 173 } … … 160 209 * Relation definition. 161 210 */ 162 public static class RelationDef extends DicBlock {211 public static class RelationDef extends CategorizedBlock { 163 212 RelationDef(Lot lot, String type) { 164 213 super(lot, type); -
applications/editors/josm/plugins/cadastre-fr/src/org/openstreetmap/josm/plugins/fr/cadastre/edigeo/EdigeoFileGEN.java
r33651 r33653 45 45 super.processRecord(r); 46 46 } 47 } 48 49 @Override 50 boolean isValid() { 51 return super.isValid() && areNotNull(min, max); 47 52 } 48 53 … … 133 138 } 134 139 140 @Override 141 boolean isValid() { 142 return super.isValid() && areNotNull(structure); 143 } 144 135 145 /** 136 146 * Returns general information. -
applications/editors/josm/plugins/cadastre-fr/src/org/openstreetmap/josm/plugins/fr/cadastre/edigeo/EdigeoFileGEO.java
r33650 r33653 6 6 import java.io.IOException; 7 7 import java.nio.file.Path; 8 8 import java.util.ArrayList; 9 import java.util.List; 10 11 import org.openstreetmap.josm.data.coor.EastNorth; 9 12 import org.openstreetmap.josm.data.osm.DataSet; 10 13 import org.openstreetmap.josm.data.projection.Projection; … … 61 64 public static AltitudeSystem of(int code) { 62 65 for (AltitudeSystem s : values()) { 66 if (s.code == code) { 67 return s; 68 } 69 } 70 throw new IllegalArgumentException(Integer.toString(code)); 71 } 72 } 73 74 enum AltitudeSystemType { 75 TERRESTRIAL(1), 76 BATHYMETRIC(2); 77 78 int code; 79 AltitudeSystemType(int code) { 80 this.code = code; 81 } 82 83 public static AltitudeSystemType of(int code) { 84 for (AltitudeSystemType s : values()) { 63 85 if (s.code == code) { 64 86 return s; … … 164 186 /** DIM */ int nDim; 165 187 /** ALS */ AltitudeSystem altitudeSystem; 166 /** UNH */ String unit = ""; 188 /** */ AltitudeSystemType altitudeSystemType; // TODO 189 /** */ String altitudeSystemName = ""; // TODO 190 /** */ String altitudeSystemCode = ""; // TODO 191 /** UNH */ String unitHorizontal = ""; 192 /** */ String unitVertical = ""; // TODO 167 193 168 194 CoorReference(Lot lot, String type) { … … 178 204 case "DIM": nDim = safeGetInt(r); break; 179 205 case "ALS": altitudeSystem = AltitudeSystem.of(safeGetInt(r)); break; 180 case "UNH": safeGet(r, s -> unit += s); break;206 case "UNH": safeGet(r, s -> unitHorizontal += s); break; 181 207 default: 182 208 super.processRecord(r); … … 184 210 } 185 211 212 @Override 213 boolean isValid() { 214 return super.isValid() && areNotNull(type, altitudeSystem) && areNotEmpty(code, unitHorizontal) 215 && (nDim == 2 || (nDim == 3 && areNotEmpty(unitVertical))) 216 && (AltitudeSystem.THREE_DIM_OR_NO_ALTITUDE == altitudeSystem 217 || areNotNull(altitudeSystemType, altitudeSystemName, altitudeSystemCode)); 218 } 219 186 220 /** 187 221 * Returns reference type. … … 225 259 226 260 /** 227 * Returns unit. 228 * @return unit 229 */ 230 public final String getUnit() { 231 return unit; 261 * Returns horizontal unit. 262 * @return horizontal unit 263 */ 264 public final String getUnitHorizontal() { 265 return unitHorizontal; 266 } 267 268 /** 269 * Returns vertical unit. 270 * @return vertical unit 271 */ 272 public final String getUnitVertical() { 273 return unitVertical; 232 274 } 233 275 … … 245 287 } 246 288 return Projections.getProjectionByCode(ref.getEpsgCode()); 289 } 290 } 291 292 /** 293 * Offset. 294 */ 295 public static class Offset extends GeoBlock { 296 297 /** */ int nOffsetPoints; // TODO 298 /** */ int nControlPoints; // TODO 299 /** */ final List<String> offsetPointIds = new ArrayList<>(); // TODO 300 /** */ final List<EastNorth> offsetInputCoor = new ArrayList<>(); // TODO 301 /** */ final List<EastNorth> offsetReferCoor = new ArrayList<>(); // TODO 302 /** */ final List<String> controlPointIds = new ArrayList<>(); // TODO 303 /** */ final List<EastNorth> controlInputCoor = new ArrayList<>(); // TODO 304 /** */ final List<EastNorth> controlReferCoor = new ArrayList<>(); // TODO 305 306 Offset(Lot lot, String type) { 307 super(lot, type); 308 } 309 310 @Override 311 boolean isValid() { 312 return super.isValid() 313 && areSameSize(nOffsetPoints, offsetPointIds, offsetInputCoor, offsetReferCoor) 314 && areSameSize(nControlPoints, controlPointIds, controlInputCoor, controlReferCoor); 247 315 } 248 316 } … … 258 326 super(lot, seId, path); 259 327 register("GEO", CoorReference.class); 328 register("RPR", Offset.class); 260 329 lot.geo = this; 261 330 } -
applications/editors/josm/plugins/cadastre-fr/src/org/openstreetmap/josm/plugins/fr/cadastre/edigeo/EdigeoFileQAL.java
r33649 r33653 25 25 26 26 /** 27 * Update descriptor. 27 * Genealogy descriptor (6.4.5.1). TODO 28 */ 29 public static class Genealogy extends QalBlock { 30 Genealogy(Lot lot, String type) { 31 super(lot, type); 32 } 33 } 34 35 /** 36 * Update descriptor (6.4.5.2). 28 37 */ 29 38 public static class Update extends QalBlock { … … 100 109 101 110 /** 111 * Horizontal precision descriptor (6.4.5.3). TODO 112 */ 113 public static class HorizontalPrecision extends QalBlock { 114 HorizontalPrecision(Lot lot, String type) { 115 super(lot, type); 116 } 117 } 118 119 /** 120 * Vertical precision descriptor (6.4.5.4). TODO 121 */ 122 public static class VerticalPrecision extends QalBlock { 123 VerticalPrecision(Lot lot, String type) { 124 super(lot, type); 125 } 126 } 127 128 /** 129 * Metric precision descriptor (6.4.5.5). TODO 130 */ 131 public static class MetricPrecision extends QalBlock { 132 MetricPrecision(Lot lot, String type) { 133 super(lot, type); 134 } 135 } 136 137 /** 138 * Exhaustivity descriptor (6.4.5.6). TODO 139 */ 140 public static class Exhaustivity extends QalBlock { 141 Exhaustivity(Lot lot, String type) { 142 super(lot, type); 143 } 144 } 145 146 /** 147 * Semantic precision descriptor (6.4.5.7). TODO 148 */ 149 public static class SemanticPrecision extends QalBlock { 150 SemanticPrecision(Lot lot, String type) { 151 super(lot, type); 152 } 153 } 154 155 /** 156 * Logical coherence descriptor (6.4.5.8). TODO 157 */ 158 public static class LogicalCoherence extends QalBlock { 159 LogicalCoherence(Lot lot, String type) { 160 super(lot, type); 161 } 162 } 163 164 /** 165 * Specific quality descriptor (6.4.5.9). TODO 166 */ 167 public static class SpecificQuality extends QalBlock { 168 SpecificQuality(Lot lot, String type) { 169 super(lot, type); 170 } 171 } 172 173 /** 102 174 * Constructs a new {@code EdigeoFileQAL}. 103 175 * @param lot parent lot -
applications/editors/josm/plugins/cadastre-fr/src/org/openstreetmap/josm/plugins/fr/cadastre/edigeo/EdigeoFileTHF.java
r33651 r33653 13 13 14 14 import org.openstreetmap.josm.data.osm.DataSet; 15 import org.openstreetmap.josm.tools.Logging; 15 16 16 17 /** … … 52 53 /** LOC */ int nLots; 53 54 /** VOC */ int nVolumes; 55 /** */ final List<String> volumeLabels = new ArrayList<>(); // TODO 54 56 /** SEC */ SecurityClassification security; 55 57 /** RDI */ String diffusionRestriction = ""; … … 83 85 super.processRecord(r); 84 86 } 87 } 88 89 @Override 90 boolean isValid() { 91 return super.isValid() && areNotEmpty(author, recipient, edigeoVersion, transmissionName) 92 && areSameSize(nVolumes, volumeLabels) && transmissionEdition >= 1; 85 93 } 86 94 … … 239 247 void readFiles(Path path, DataSet ds) throws IOException, ReflectiveOperationException { 240 248 Path dir = path.getParent(); 241 new EdigeoFileGEN(this, genId, dir.resolve(name + genName + ".GEN")).read(ds); 242 new EdigeoFileGEO(this, geoId, dir.resolve(name + geoName + ".GEO")).read(ds); 243 new EdigeoFileDIC(this, dicId, dir.resolve(name + dicName + ".DIC")).read(ds); 244 new EdigeoFileSCD(this, scdId, dir.resolve(name + scdName + ".SCD")).read(ds); 245 new EdigeoFileQAL(this, qalId, dir.resolve(name + qalName + ".QAL")).read(ds); 249 List<EdigeoFile> allFiles = new ArrayList<>(); 250 allFiles.add(new EdigeoFileGEN(this, genId, dir.resolve(name + genName + ".GEN")).read(ds)); 251 allFiles.add(new EdigeoFileGEO(this, geoId, dir.resolve(name + geoName + ".GEO")).read(ds)); 252 allFiles.add(new EdigeoFileDIC(this, dicId, dir.resolve(name + dicName + ".DIC")).read(ds)); 253 allFiles.add(new EdigeoFileSCD(this, scdId, dir.resolve(name + scdName + ".SCD")).read(ds)); 254 allFiles.add(new EdigeoFileQAL(this, qalId, dir.resolve(name + qalName + ".QAL")).read(ds)); 246 255 for (int i = 0; i < getNumberOfGeoData(); i++) { 247 new EdigeoFileVEC(this, vecId.get(i), dir.resolve(name + vecName.get(i) + ".VEC")).read(ds); 248 } 256 allFiles.add(new EdigeoFileVEC(this, vecId.get(i), dir.resolve(name + vecName.get(i) + ".VEC")).read(ds)); 257 } 258 for (EdigeoFile f : allFiles) { 259 boolean valid = f.isValid(); 260 if (valid) { 261 Logging.debug(f.path + ": valid"); 262 } else { 263 Logging.warn(f.path + ": invalid!"); 264 } 265 } 266 } 267 268 @Override 269 boolean isValid() { 270 return super.isValid() && areNotEmpty(name, genName, genId, geoName, geoId); 249 271 } 250 272 … … 448 470 return this; 449 471 } 472 473 @Override 474 boolean isValid() { 475 return support.isValid() && lots.stream().allMatch(Block::isValid); 476 } 450 477 } -
applications/editors/josm/plugins/cadastre-fr/src/org/openstreetmap/josm/plugins/fr/cadastre/edigeo/EdigeoFileVEC.java
r33652 r33653 34 34 35 35 /** SCP */ T scdRef; 36 /** ATC */ int nAttributes; 37 /** ATP */ final List<String> attributeDefs = new ArrayList<>(); 38 /** TEX */ EdigeoCharset charset; 39 /** ATV */ final List<String> attributeValues = new ArrayList<>(); 40 /** QAC */ int nQualities; 41 /** QAP */ final List<String> qualityIndics = new ArrayList<>(); 36 42 37 43 VecBlock(Lot lot, String type, Class<T> klass) { … … 44 50 switch (r.name) { 45 51 case "SCP": scdRef = lot.scd.find(r.values, klass); break; 52 case "ATC": nAttributes = safeGetInt(r); break; 53 case "ATP": safeGet(r, attributeDefs); break; 54 case "TEX": safeGet(r, s -> charset = EdigeoCharset.of(s)); break; 55 case "ATV": safeGet(r, attributeValues); break; 56 case "QAC": nQualities = safeGetInt(r); break; 57 case "QAP": safeGet(r, qualityIndics); break; 58 default: 59 super.processRecord(r); 60 } 61 } 62 } 63 64 abstract static class BoundedBlock<T extends ScdBlock> extends VecBlock<T> { 65 /** CM1 */ EastNorth minCoordinate; 66 /** CM2 */ EastNorth maxCoordinate; 67 68 BoundedBlock(Lot lot, String type, Class<T> klass) { 69 super(lot, type, klass); 70 } 71 72 @Override 73 void processRecord(EdigeoRecord r) { 74 switch (r.name) { 75 case "CM1": minCoordinate = safeGetEastNorth(r); break; 76 case "CM2": maxCoordinate = safeGetEastNorth(r); break; 46 77 default: 47 78 super.processRecord(r); … … 76 107 /** TYP */ NodeType nodeType; 77 108 /** COR */ EastNorth coordinate; 78 /** ATC */ int nAttributes;79 /** QAC */ int nQualities;80 109 81 110 NodeBlock(Lot lot, String type) { … … 88 117 case "TYP": nodeType = NodeType.of(safeGetInt(r)); break; 89 118 case "COR": coordinate = safeGetEastNorth(r); break; 90 case "ATC": nAttributes = safeGetInt(r); break;91 case "QAC": nQualities = safeGetInt(r); break;92 119 default: 93 120 super.processRecord(r); … … 139 166 * Arc descriptor block. 140 167 */ 141 public static class ArcBlock extends VecBlock<McdPrimitiveDef> {168 public static class ArcBlock extends BoundedBlock<McdPrimitiveDef> { 142 169 enum ArcType { 143 170 LINE(1), … … 160 187 } 161 188 162 /** CM1 */ EastNorth minCoordinate;163 /** CM2 */ EastNorth maxCoordinate;164 189 /** TYP */ ArcType arcType; 165 190 /** PTC */ int nPoints; 166 191 /** COR */ final List<EastNorth> points = new ArrayList<>(); 167 /** ATC */ int nAttributes;168 /** QAC */ int nQualities;169 192 170 193 ArcBlock(Lot lot, String type) { … … 175 198 void processRecord(EdigeoRecord r) { 176 199 switch (r.name) { 177 case "CM1": minCoordinate = safeGetEastNorth(r); break;178 case "CM2": maxCoordinate = safeGetEastNorth(r); break;179 200 case "TYP": arcType = ArcType.of(safeGetInt(r)); break; 180 case "PTC": nPoints = safeGetInt(r); break;201 case "PTC": nPoints = safeGetInt(r); assert checkNumberOfPoints(); break; 181 202 case "COR": points.add(safeGetEastNorth(r)); break; 182 case "ATC": nAttributes = safeGetInt(r); break; 183 case "QAC": nQualities = safeGetInt(r); break; 184 default: 185 super.processRecord(r); 203 default: 204 super.processRecord(r); 205 } 206 } 207 208 private boolean checkNumberOfPoints() { 209 switch (arcType) { 210 case LINE: return nPoints >= 2; 211 case CIRCLE_ARC: return nPoints == 3; 212 case CURVE: return nPoints >= 3; 213 default: throw new IllegalStateException(arcType.toString()); 186 214 } 187 215 } … … 191 219 * Face descriptor block. 192 220 */ 193 public static class FaceBlock extends VecBlock<McdPrimitiveDef> { 194 /** CM1 */ EastNorth minCoordinate; 195 /** CM2 */ EastNorth maxCoordinate; 196 /** ATC */ int nAttributes; 197 /** QAC */ int nQualities; 221 public static class FaceBlock extends BoundedBlock<McdPrimitiveDef> { 198 222 199 223 FaceBlock(Lot lot, String type) { 200 224 super(lot, type, McdPrimitiveDef.class); 201 225 } 202 203 @Override204 void processRecord(EdigeoRecord r) {205 switch (r.name) {206 case "CM1": minCoordinate = safeGetEastNorth(r); break;207 case "CM2": maxCoordinate = safeGetEastNorth(r); break;208 case "ATC": nAttributes = safeGetInt(r); break;209 case "QAC": nQualities = safeGetInt(r); break;210 default:211 super.processRecord(r);212 }213 }214 226 } 215 227 … … 217 229 * Object descriptor block. 218 230 */ 219 public static class ObjectBlock extends VecBlock<McdObjectDef> { 220 /** CM1 */ EastNorth minCoordinate; 221 /** CM2 */ EastNorth maxCoordinate; 231 public static class ObjectBlock extends BoundedBlock<McdObjectDef> { 222 232 /** REF */ String pointRef = ""; 223 /** ATC */ int nAttributes;224 /** ATP */ final List<String> attributeDefs = new ArrayList<>();225 /** TEX */ EdigeoCharset charset;226 /** ATV */ final List<String> attributeValues = new ArrayList<>();227 /** QAC */ int nQualities;228 /** QAP */ final List<String> qualityIndics = new ArrayList<>();229 233 230 234 ObjectBlock(Lot lot, String type) { … … 235 239 void processRecord(EdigeoRecord r) { 236 240 switch (r.name) { 237 case "CM1": minCoordinate = safeGetEastNorth(r); break;238 case "CM2": maxCoordinate = safeGetEastNorth(r); break;239 241 case "REF": safeGet(r, s -> pointRef += s); break; 240 case "ATC": nAttributes = safeGetInt(r); break;241 case "ATP": safeGet(r, attributeDefs); break;242 case "TEX": safeGet(r, s -> charset = EdigeoCharset.of(s)); break;243 case "ATV": safeGet(r, attributeValues); break;244 case "QAC": nQualities = safeGetInt(r); break;245 case "QAP": safeGet(r, qualityIndics); break;246 242 default: 247 243 super.processRecord(r); … … 256 252 257 253 enum Composition { 258 PLUS( "P"),259 MINUS( "M");260 261 Stringcode;262 Composition( Stringcode) {254 PLUS('P'), 255 MINUS('M'); 256 257 final char code; 258 Composition(char code) { 263 259 this.code = code; 264 260 } 265 261 266 public static Composition of( Stringcode) {262 public static Composition of(char code) { 267 263 for (Composition s : values()) { 268 if (s.code .equals(code)) {264 if (s.code == code) { 269 265 return s; 270 266 } 271 267 } 272 throw new IllegalArgumentException( code);268 throw new IllegalArgumentException(Character.toString(code)); 273 269 } 274 270 } … … 277 273 /** FTP */ final List<String> elements = new ArrayList<>(); 278 274 /** SNS */ final Map<String, Composition> compositions = new HashMap<>(); 279 /** ATC */ int nAttributes;280 /** QAC */ int nQualities;281 275 282 276 RelationBlock(Lot lot, String type) { … … 289 283 case "FTC": nElements = safeGetInt(r); break; 290 284 case "FTP": safeGet(r, elements); break; 291 case "SNS": safeGet(r, s -> compositions.put(elements.get(elements.size()-1), Composition.of(s))); break; 292 case "ATC": nAttributes = safeGetInt(r); break; 293 case "QAC": nQualities = safeGetInt(r); break; 285 case "SNS": compositions.put(elements.get(elements.size()-1), Composition.of(safeGetChar(r))); break; 294 286 default: 295 287 super.processRecord(r); -
applications/editors/josm/plugins/cadastre-fr/src/org/openstreetmap/josm/plugins/fr/cadastre/edigeo/EdigeoLotFile.java
r33649 r33653 10 10 import java.util.Objects; 11 11 12 import org.openstreetmap.josm.data.osm.DataSet; 12 13 import org.openstreetmap.josm.plugins.fr.cadastre.edigeo.EdigeoFileTHF.ChildBlock; 13 14 import org.openstreetmap.josm.plugins.fr.cadastre.edigeo.EdigeoFileTHF.Lot; … … 42 43 Class<? extends B> klass = classes.get(type); 43 44 return addBlock(blocks.get(klass), klass.getDeclaredConstructor(Lot.class, String.class).newInstance(lot, type)); 45 } 46 47 @Override 48 public EdigeoLotFile<B> read(DataSet ds) throws IOException, ReflectiveOperationException { 49 super.read(ds); 50 return this; 51 } 52 53 @Override 54 boolean isValid() { 55 return blocks.values().stream().allMatch(l -> l.stream().allMatch(Block::isValid)); 44 56 } 45 57 -
applications/editors/josm/plugins/cadastre-fr/src/org/openstreetmap/josm/plugins/fr/cadastre/edigeo/EdigeoRecord.java
r33645 r33653 28 28 } 29 29 } 30 throw new IllegalArgumentException( "Unknown code: " + c);30 throw new IllegalArgumentException(Character.toString(c)); 31 31 } 32 32 } … … 34 34 enum Format { 35 35 STRING('A'), 36 BINARY('B'), 36 37 COORDINATES('C'), 37 38 DATE('D'), … … 55 56 } 56 57 } 57 throw new IllegalArgumentException( "Unknown code: " + c);58 throw new IllegalArgumentException(Character.toString(c)); 58 59 } 59 60 }
Note:
See TracChangeset
for help on using the changeset viewer.