Ignore:
Timestamp:
2012-03-12T20:18:35+01:00 (12 years ago)
Author:
donvip
Message:

opendata: download public forests from data.gouv.fr

Location:
applications/editors/josm/plugins/opendata
Files:
1 added
3 edited
1 moved

Legend:

Unmodified
Added
Removed
  • applications/editors/josm/plugins/opendata/modules/fr.datagouvfr/src/org/openstreetmap/josm/plugins/opendata/modules/fr/datagouvfr/DataGouvFrModule.java

    r28000 r28053  
    2323import org.openstreetmap.josm.plugins.opendata.modules.fr.datagouvfr.datasets.diplomatie.EtabAEFEHandler;
    2424import org.openstreetmap.josm.plugins.opendata.modules.fr.datagouvfr.datasets.ecologie.AssainissementHandler;
     25import org.openstreetmap.josm.plugins.opendata.modules.fr.datagouvfr.datasets.ecologie.ForetsPubliquesHandler;
    2526import org.openstreetmap.josm.plugins.opendata.modules.fr.datagouvfr.datasets.education.Etab1er2ndDegreHandler;
    2627import org.openstreetmap.josm.plugins.opendata.modules.fr.datagouvfr.datasets.education.EtabSupHandler;
     
    4142        handlers.add(new PassageNiveauHandler());
    4243        handlers.add(new ROEHandler());
     44        handlers.add(new ForetsPubliquesHandler());
    4345    }
    4446}
  • applications/editors/josm/plugins/opendata/modules/fr.datagouvfr/src/org/openstreetmap/josm/plugins/opendata/modules/fr/datagouvfr/datasets/agriculture/RegistreParcellaireHandler.java

    r28050 r28053  
    2424import org.openstreetmap.josm.data.osm.OsmPrimitive;
    2525import org.openstreetmap.josm.gui.preferences.SourceEditor.ExtendedSourceEntry;
    26 import org.openstreetmap.josm.plugins.opendata.core.datasets.fr.FrenchDepartment;
     26import org.openstreetmap.josm.plugins.opendata.core.datasets.fr.FrenchAdministrativeUnit;
    2727import org.openstreetmap.josm.plugins.opendata.modules.fr.datagouvfr.datasets.DataGouvDataSetHandler;
    2828import org.openstreetmap.josm.tools.Pair;
     
    144144                List<Pair<String, URL>> result = new ArrayList<Pair<String,URL>>();
    145145                try {
    146                         for (FrenchDepartment dpt : FrenchDepartment.allDepartments) {
     146                        for (FrenchAdministrativeUnit dpt : FrenchAdministrativeUnit.allDepartments) {
    147147                                result.add(getRpgURL(dpt.getCode(), dpt.getName()));
    148148                        }
  • applications/editors/josm/plugins/opendata/src/org/openstreetmap/josm/plugins/opendata/core/datasets/DataSetUpdater.java

    r28044 r28053  
    3030                        if (associatedFile != null) {
    3131                                handler.setAssociatedFile(associatedFile);
    32                                 handler.setSourceDate(new SimpleDateFormat("yyyy-MM-dd").format(new Date(associatedFile.lastModified())));
     32                                long lastmodified = associatedFile.lastModified();
     33                                if (lastmodified > 0) {
     34                                        handler.setSourceDate(new SimpleDateFormat("yyyy-MM-dd").format(new Date(lastmodified)));
     35                                }
    3336                        }
    3437                        if (!Main.pref.getBoolean(PREF_RAWDATA)) {
  • applications/editors/josm/plugins/opendata/src/org/openstreetmap/josm/plugins/opendata/core/datasets/fr/FrenchAdministrativeUnit.java

    r28050 r28053  
    1616package org.openstreetmap.josm.plugins.opendata.core.datasets.fr;
    1717
    18 public final class FrenchDepartment {
     18public abstract class FrenchAdministrativeUnit {
    1919        private final String code;
    2020        private final String name;
    2121       
    22         private FrenchDepartment(String code, String name) {
     22        private FrenchAdministrativeUnit(String code, String name) {
    2323                this.code = code;
    2424                this.name = name;
     
    3131        public final String getName() {
    3232                return name;
     33        }
     34       
     35        public static final class FrenchDepartment extends FrenchAdministrativeUnit {
     36                private FrenchDepartment(String code, String name) {
     37                        super(code, name);
     38                }
     39        }
     40       
     41        public static final class FrenchRegion extends FrenchAdministrativeUnit {
     42                private FrenchRegion(String code, String name) {
     43                        super(code, name);
     44                }
    3345        }
    3446
     
    136148                new FrenchDepartment("976", "Mayotte"),
    137149        };
     150
     151        public static final FrenchRegion[] allRegions = new FrenchRegion[] {
     152                new FrenchRegion("42", "Alsace"),
     153                new FrenchRegion("72", "Aquitaine"),
     154                new FrenchRegion("83", "Auvergne"),
     155                new FrenchRegion("25", "Basse-Normandie"),
     156                new FrenchRegion("26", "Bourgogne"),
     157                new FrenchRegion("53", "Bretagne"),
     158                new FrenchRegion("24", "Centre"),
     159                new FrenchRegion("21", "Champagne-Ardenne"),
     160                new FrenchRegion("94", "Corse"),
     161                new FrenchRegion("43", "Franche-Comté"),
     162                new FrenchRegion("23", "Haute-Normandie"),
     163                new FrenchRegion("11", "Île-de-France"),
     164                new FrenchRegion("91", "Languedoc-Roussillon"),
     165                new FrenchRegion("74", "Limousin"),
     166                new FrenchRegion("41", "Lorraine"),
     167                new FrenchRegion("73", "Midi-Pyrénées"),
     168                new FrenchRegion("31", "Nord-Pas-de-Calais"),
     169                new FrenchRegion("52", "Pays de la Loire"),
     170                new FrenchRegion("22", "Picardie"),
     171                new FrenchRegion("54", "Poitou-Charentes"),
     172                new FrenchRegion("93", "Provence-Alpes-Côte d'Azur"),
     173                new FrenchRegion("82", "Rhône-Alpes"),
     174                new FrenchRegion("01", "Guadeloupe"),
     175                new FrenchRegion("02", "Martinique"),
     176                new FrenchRegion("03", "Guyane"),
     177                new FrenchRegion("04", "La Réunion"),
     178                new FrenchRegion("05", "Mayotte")
     179        };
    138180}
Note: See TracChangeset for help on using the changeset viewer.