Changeset 28142 in osm for applications/editors/josm


Ignore:
Timestamp:
2012-03-23T21:22:46+01:00 (13 years ago)
Author:
donvip
Message:

opendata: fix filename parsing in network reading, add initial French National Forest inventory support (datagouvfr module)

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

Legend:

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

    r28054 r28142  
    2424import org.openstreetmap.josm.plugins.opendata.modules.fr.datagouvfr.datasets.ecologie.AssainissementHandler;
    2525import org.openstreetmap.josm.plugins.opendata.modules.fr.datagouvfr.datasets.ecologie.ForetsPubliquesHandler;
     26import org.openstreetmap.josm.plugins.opendata.modules.fr.datagouvfr.datasets.ecologie.InventaireForestierNationalHandler;
    2627import org.openstreetmap.josm.plugins.opendata.modules.fr.datagouvfr.datasets.ecologie.ReservesBiologiquesHandler;
    2728import org.openstreetmap.josm.plugins.opendata.modules.fr.datagouvfr.datasets.education.Etab1er2ndDegreHandler;
     
    4748        handlers.add(new ReservesBiologiquesHandler());
    4849        handlers.add(new EauxDeSurfaceHandler());
     50        handlers.add(new InventaireForestierNationalHandler());
    4951    }
    5052}
  • applications/editors/josm/plugins/opendata/src/org/openstreetmap/josm/plugins/opendata/core/io/NetworkReader.java

    r28113 r28142  
    8585        } else if (contentType.startsWith("application/octet-stream")) {
    8686                //return OdsReader.class;//FIXME, can be anything
     87        } else if (contentType.startsWith("text/csv")) {
     88                return CsvReader.class;
    8789        } else if (contentType.startsWith("text/plain")) {//TODO: extract charset
    8890                return CsvReader.class;
     
    138140            if (readerClass == null) {
    139141                readerClass = findReaderByExtension(url.toLowerCase());
    140                 if (readerClass != null) {
    141                         filename = url.substring(url.lastIndexOf('/'));
    142                 }
    143142            }
    144143            if (readerClass == null) {
    145144                        throw new OsmTransferException("Cannot find appropriate reader !");//TODO handler job ?
     145            } else if (findReaderByExtension(url.toLowerCase()) != null) {
     146                filename = url.substring(url.lastIndexOf('/')+1);
    146147            }
    147148            if (readerClass.equals(ZipReader.class)) {
Note: See TracChangeset for help on using the changeset viewer.