Ignore:
Timestamp:
2017-09-20T23:44:57+02:00 (7 years ago)
Author:
donvip
Message:

Edigeo: skeletons for other file types

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  
    5656
    5757    EdigeoFile(Path path) throws IOException {
     58        init();
    5859        try (BufferedReader reader = Files.newBufferedReader(path, StandardCharsets.ISO_8859_1)) {
    5960            String line;
     
    9596            }
    9697        }
     98    }
     99
     100    protected void init() {
     101        // To be overidden if needed
    97102    }
    98103
  • applications/editors/josm/plugins/cadastre-fr/src/org/openstreetmap/josm/plugins/fr/cadastre/edigeo/EdigeoFileTHF.java

    r33642 r33643  
    6060        Support(String type) {
    6161            super(type);
    62         }
    63 
    64         /**
    65          * Returns author.
    66          * @return author
    67          */
    68         public final String getAuthor() {
    69             return author;
    70         }
    71 
    72         /**
    73          * Returns recipient.
    74          * @return recipient
    75          */
    76         public final String getRecipient() {
    77             return recipient;
    78         }
    79 
    80         /**
    81          * Returns number of geographic lots.
    82          * @return number of geographic lots
    83          */
    84         public final int getnLots() {
    85             return nLots;
    86         }
    87 
    88         /**
    89          * Returns number of volumes.
    90          * @return number of volumes
    91          */
    92         public final int getnVolumes() {
    93             return nVolumes;
    94         }
    95 
    96         /**
    97          * Returns security classification.
    98          * @return security classification
    99          */
    100         public final SecurityClassification getSecurity() {
    101             return security;
    102         }
    103 
    104         /**
    105          * Returns diffusion restriction.
    106          * @return diffusion restriction
    107          */
    108         public final String getDiffusionRestriction() {
    109             return diffusionRestriction;
    110         }
    111 
    112         /**
    113          * Returns Edigeo version.
    114          * @return Edigeo version
    115          */
    116         public final String getEdigeoVersion() {
    117             return edigeoVersion;
    118         }
    119 
    120         /**
    121          * Returns Edigeo date.
    122          * @return Edigeo date
    123          */
    124         public final LocalDate getEdigeoDate() {
    125             return edigeoDate;
    126         }
    127 
    128         /**
    129          * Returns name of transmission.
    130          * @return name of transmission
    131          */
    132         public final String getTransmissionName() {
    133             return transmissionName;
    134         }
    135 
    136         /**
    137          * Returns edition number of transmission.
    138          * @return edition number of transmission
    139          */
    140         public final int getTransmissionEdition() {
    141             return transmissionEdition;
    142         }
    143 
    144         /**
    145          * Returns date of transmission.
    146          * @return date of transmission
    147          */
    148         public final LocalDate getTransmissionDate() {
    149             return transmissionDate;
    150         }
    151 
    152         /**
    153          * Returns general information about transmission.
    154          * @return general information about transmission
    155          */
    156         public final String getTransmissionInformation() {
    157             return transmissionInformation;
    15862        }
    15963
     
    17680                super.processRecord(r);
    17781            }
     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;
    178178        }
    179179    }
     
    226226            }
    227227        }
     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        }
    228366    }
    229367
     
    240378    }
    241379
     380    @Override
     381    protected void init() {
     382        lots = new ArrayList<>();
     383    }
     384
    242385    /**
    243386     * Returns the support descriptor.
     
    263406                return support;
    264407            case "GTL":
    265                 if (lots == null) {
    266                     lots = new ArrayList<>();
    267                 }
    268408                Lot lot = new Lot(type);
    269409                lots.add(lot);
  • applications/editors/josm/plugins/cadastre-fr/src/org/openstreetmap/josm/plugins/fr/cadastre/edigeo/pci/EdigeoPciReader.java

    r33642 r33643  
    1212import org.openstreetmap.josm.io.AbstractReader;
    1313import org.openstreetmap.josm.io.IllegalDataException;
     14import org.openstreetmap.josm.plugins.fr.cadastre.edigeo.EdigeoFileDIC;
     15import org.openstreetmap.josm.plugins.fr.cadastre.edigeo.EdigeoFileGEN;
     16import org.openstreetmap.josm.plugins.fr.cadastre.edigeo.EdigeoFileGEO;
     17import org.openstreetmap.josm.plugins.fr.cadastre.edigeo.EdigeoFileQAL;
     18import org.openstreetmap.josm.plugins.fr.cadastre.edigeo.EdigeoFileSCD;
    1419import org.openstreetmap.josm.plugins.fr.cadastre.edigeo.EdigeoFileTHF;
     20import org.openstreetmap.josm.plugins.fr.cadastre.edigeo.EdigeoFileTHF.Lot;
     21import org.openstreetmap.josm.plugins.fr.cadastre.edigeo.EdigeoFileVEC;
    1522
    1623/**
     
    3946
    4047    DataSet parse(Path path, ProgressMonitor instance) throws IOException {
    41         // Read THF file
     48        Path dir = path.getParent();
    4249        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        }
    4360        DataSet ds = new DataSet();
    4461        ds.setName(thf.getSupport().getIdentifier());
Note: See TracChangeset for help on using the changeset viewer.