Changeset 29686 in osm


Ignore:
Timestamp:
2013-06-21T02:08:30+02:00 (11 years ago)
Author:
donvip
Message:

[josm_opendata] initial Route500 support

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

Legend:

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

    r28364 r29686  
    3232import org.openstreetmap.josm.plugins.opendata.modules.fr.datagouvfr.datasets.transport.AeroportsHandler;
    3333import org.openstreetmap.josm.plugins.opendata.modules.fr.datagouvfr.datasets.transport.PassageNiveauHandler;
     34import org.openstreetmap.josm.plugins.opendata.modules.fr.datagouvfr.datasets.transport.Route500Handler;
    3435
    3536public class DataGouvFrModule extends AbstractModule {
     
    5152        handlers.add(InventaireForestierNationalHandler.class);
    5253        handlers.add(AeroportsHandler.class);
     54        handlers.add(Route500Handler.class);
    5355    }
    5456}
  • applications/editors/josm/plugins/opendata/src/org/openstreetmap/josm/plugins/opendata/core/datasets/AbstractDataSetHandler.java

    r29680 r29686  
    159159        }
    160160
     161    protected final boolean accepts7ZipFilename(String filename, String ... expected) {
     162        return acceptsFilename(filename, expected, SEVENZIP_EXT);
     163    }
     164
    161165        protected final boolean acceptsCsvKmzFilename(String filename, String ... expected) {
    162166                return acceptsFilename(filename, expected, CSV_EXT, KMZ_EXT);
  • applications/editors/josm/plugins/opendata/src/org/openstreetmap/josm/plugins/opendata/core/io/NetworkReader.java

    r29019 r29686  
    3030import org.openstreetmap.josm.plugins.opendata.core.OdConstants;
    3131import org.openstreetmap.josm.plugins.opendata.core.datasets.AbstractDataSetHandler;
     32import org.openstreetmap.josm.plugins.opendata.core.io.archive.ArchiveReader;
     33import org.openstreetmap.josm.plugins.opendata.core.io.archive.SevenZipReader;
    3234import org.openstreetmap.josm.plugins.opendata.core.io.archive.ZipReader;
    3335import org.openstreetmap.josm.plugins.opendata.core.io.geographic.GmlReader;
     
    8486        if (contentType.startsWith("application/zip")) {
    8587                return ZipReader.class;
     88        } else if (contentType.startsWith("application/x-7z-compressed")) {
     89            return SevenZipReader.class;
    8690        } else if (contentType.startsWith("application/vnd.ms-excel")) {
    8791                return XlsReader.class;
     
    122126        } else if (filename.endsWith("."+ZIP_EXT)) {
    123127                return ZipReader.class;
     128        } else if (filename.endsWith("."+SEVENZIP_EXT)) {
     129            return SevenZipReader.class;
    124130        } else {
    125131                return null;
     
    151157            }
    152158            instance = progressMonitor.createSubTaskMonitor(ProgressMonitor.ALL_TICKS, false);
    153             if (readerClass.equals(ZipReader.class)) {
    154                 ZipReader zipReader = new ZipReader(in, handler, promptUser);
     159            if (readerClass.equals(ZipReader.class) || readerClass.equals(SevenZipReader.class)) {
     160                ArchiveReader zipReader = readerClass.equals(ZipReader.class)
     161                        ? new ZipReader(in, handler, promptUser) : new SevenZipReader(in, handler, promptUser);
    155162                DataSet ds = zipReader.parseDoc(instance);
    156163                file = zipReader.getReadFile();
Note: See TracChangeset for help on using the changeset viewer.