Changeset 33245 in osm for applications/editors/josm
- Timestamp:
- 2017-04-15T17:08:27+02:00 (8 years ago)
- Location:
- applications/editors/josm/plugins/opendata
- Files:
-
- 14 edited
Legend:
- Unmodified
- Added
- Removed
-
applications/editors/josm/plugins/opendata/build.xml
r33197 r33245 1 1 <?xml version="1.0" encoding="utf-8"?> 2 2 <project name="opendata" default="dist" basedir="."> 3 <property name="plugin.main.version" value="11 772"/>3 <property name="plugin.main.version" value="11919"/> 4 4 <property name="plugin.author" value="Don-vip"/> 5 5 <property name="plugin.class" value="org.openstreetmap.josm.plugins.opendata.OdPlugin"/> -
applications/editors/josm/plugins/opendata/src/org/openstreetmap/josm/plugins/opendata/core/OdConstants.java
r32898 r33245 29 29 * Preferences 30 30 */ 31 /* public static final String PREF_COORDINATES = "opendata.coordinates"; 31 /* public static final String PREF_COORDINATES = "opendata.coordinates"; 32 32 public static final String VALUE_CC9ZONES = "cc9zones"; 33 33 public static final String VALUE_WGS84 = "wgs84";*/ -
applications/editors/josm/plugins/opendata/src/org/openstreetmap/josm/plugins/opendata/core/io/NeptuneReader.java
r32545 r33245 32 32 import org.openstreetmap.josm.gui.progress.ProgressMonitor; 33 33 import org.openstreetmap.josm.io.AbstractReader; 34 import org.openstreetmap.josm.io.IllegalDataException; 34 35 import org.openstreetmap.josm.plugins.opendata.core.datasets.AbstractDataSetHandler; 35 36 import org.openstreetmap.josm.plugins.opendata.core.datasets.fr.FrenchConstants; … … 112 113 } 113 114 } catch (IOException e) { 114 Main.error(e .getMessage());115 Main.error(e); 115 116 } 116 117 … … 118 119 } 119 120 120 public static DataSet parseDataSet(InputStream in, AbstractDataSetHandler handler, ProgressMonitor instance) throws JAXBException {121 return new NeptuneReader(). parse(in, instance);121 public static DataSet parseDataSet(InputStream in, AbstractDataSetHandler handler, ProgressMonitor instance) throws IllegalDataException { 122 return new NeptuneReader().doParseDataSet(in, instance); 122 123 } 123 124 … … 243 244 } 244 245 245 private DataSet parse(InputStream in, ProgressMonitor instance) throws JAXBException { 246 root = unmarshal(ChouettePTNetworkType.class, in); 246 @Override 247 protected DataSet doParseDataSet(InputStream in, ProgressMonitor instance) throws IllegalDataException { 248 try { 249 root = unmarshal(ChouettePTNetworkType.class, in); 250 } catch (JAXBException e) { 251 throw new IllegalDataException(e); 252 } 247 253 248 254 Relation network = createNetwork(root.getPTNetwork()); -
applications/editors/josm/plugins/opendata/src/org/openstreetmap/josm/plugins/opendata/core/io/OverpassApi.java
r32545 r33245 43 43 } 44 44 45 public static final String union(String 45 public static final String union(String... queries) { 46 46 String result = "<union>\n"; 47 47 for (String query : queries) { … … 54 54 } 55 55 56 public static final String query(String bbox, OaQueryType type, String 56 public static final String query(String bbox, OaQueryType type, String... conditions) { 57 57 String result = "<query type=\""+type+"\" >\n"; 58 58 if (bbox != null) { … … 72 72 } 73 73 74 public static final String recurse(OaRecurseType 74 public static final String recurse(OaRecurseType... types) { 75 75 String result = ""; 76 76 for (OaRecurseType type : types) { -
applications/editors/josm/plugins/opendata/src/org/openstreetmap/josm/plugins/opendata/core/io/XmlImporter.java
r30723 r33245 7 7 import java.io.InputStream; 8 8 import java.net.URL; 9 10 import javax.xml.bind.JAXBException;11 9 12 10 import org.openstreetmap.josm.actions.ExtensionFileFilter; … … 24 22 super(XML_FILE_FILTER); 25 23 } 26 24 27 25 @Override 28 26 public boolean acceptFile(File pathname) { … … 40 38 protected DataSet parseDataSet(InputStream in, ProgressMonitor instance) 41 39 throws IllegalDataException { 42 try { 43 return NeptuneReader.parseDataSet(in, handler, instance); 44 } catch (JAXBException e) { 45 throw new IllegalDataException(e); 46 } 40 return NeptuneReader.parseDataSet(in, handler, instance); 47 41 } 48 42 } -
applications/editors/josm/plugins/opendata/src/org/openstreetmap/josm/plugins/opendata/core/io/archive/ArchiveReader.java
r32545 r33245 6 6 import java.io.FileNotFoundException; 7 7 import java.io.IOException; 8 import java.io.InputStream; 8 9 import java.util.ArrayList; 9 10 import java.util.Collection; … … 13 14 import java.util.Map; 14 15 15 import javax.xml.bind.JAXBException;16 16 import javax.xml.stream.FactoryConfigurationError; 17 17 import javax.xml.stream.XMLStreamException; … … 21 21 import org.openstreetmap.josm.gui.progress.ProgressMonitor; 22 22 import org.openstreetmap.josm.io.AbstractReader; 23 import org.openstreetmap.josm.io.IllegalDataException; 23 24 import org.openstreetmap.josm.plugins.opendata.OdPlugin; 24 25 import org.openstreetmap.josm.plugins.opendata.core.OdConstants; … … 57 58 } 58 59 59 protected abstract void extractArchive( finalFile temp,finalList<File> candidates) throws IOException, FileNotFoundException;60 protected abstract void extractArchive(File temp, List<File> candidates) throws IOException, FileNotFoundException; 60 61 61 62 protected abstract String getTaskMessage(); … … 86 87 87 88 public Map<File, DataSet> parseDocs(final ProgressMonitor progressMonitor) 88 throws IOException, XMLStreamException, FactoryConfigurationError, JAXBException {89 throws IOException, XMLStreamException, FactoryConfigurationError, IllegalDataException { 89 90 Map<File, DataSet> result = new HashMap<>(); 90 91 File temp = OdUtils.createTempDir(); … … 107 108 108 109 public DataSet parseDoc(final ProgressMonitor progressMonitor) 109 throws IOException, XMLStreamException, FactoryConfigurationError, JAXBException {110 throws IOException, XMLStreamException, FactoryConfigurationError, IllegalDataException { 110 111 File temp = OdUtils.createTempDir(); 111 112 … … 133 134 } 134 135 136 @Override 137 protected DataSet doParseDataSet(InputStream source, ProgressMonitor progressMonitor) throws IllegalDataException { 138 return null; 139 } 140 135 141 protected DataSet getDataForFile(File f, final ProgressMonitor progressMonitor) 136 throws FileNotFoundException, IOException, XMLStreamException, FactoryConfigurationError, JAXBException {142 throws FileNotFoundException, IOException, XMLStreamException, FactoryConfigurationError, IllegalDataException { 137 143 if (f == null) { 138 144 return null; -
applications/editors/josm/plugins/opendata/src/org/openstreetmap/josm/plugins/opendata/core/io/archive/SevenZipReader.java
r32545 r33245 14 14 import java.util.Map; 15 15 16 import javax.xml.bind.JAXBException;17 16 import javax.xml.stream.FactoryConfigurationError; 18 17 import javax.xml.stream.XMLStreamException; … … 27 26 import org.openstreetmap.josm.data.osm.DataSet; 28 27 import org.openstreetmap.josm.gui.progress.ProgressMonitor; 28 import org.openstreetmap.josm.io.IllegalDataException; 29 29 import org.openstreetmap.josm.plugins.opendata.core.datasets.AbstractDataSetHandler; 30 30 import org.openstreetmap.josm.plugins.opendata.core.util.OdUtils; … … 54 54 55 55 public static DataSet parseDataSet(InputStream in, AbstractDataSetHandler handler, ProgressMonitor instance, boolean promptUser) 56 throws IOException, XMLStreamException, FactoryConfigurationError, JAXBException {56 throws IOException, XMLStreamException, FactoryConfigurationError, IllegalDataException { 57 57 return new SevenZipReader(in, handler, promptUser).parseDoc(instance); 58 58 } 59 59 60 60 public static Map<File, DataSet> parseDataSets(InputStream in, AbstractDataSetHandler handler, ProgressMonitor instance, boolean promptUser) 61 throws IOException, XMLStreamException, FactoryConfigurationError, JAXBException {61 throws IOException, XMLStreamException, FactoryConfigurationError, IllegalDataException { 62 62 return new SevenZipReader(in, handler, promptUser).parseDocs(instance); 63 63 } -
applications/editors/josm/plugins/opendata/src/org/openstreetmap/josm/plugins/opendata/core/io/archive/ZipImporter.java
r30723 r33245 5 5 6 6 import java.io.File; 7 import java.io.IOException; 7 8 import java.io.InputStream; 9 10 import javax.xml.stream.FactoryConfigurationError; 11 import javax.xml.stream.XMLStreamException; 8 12 9 13 import org.openstreetmap.josm.actions.ExtensionFileFilter; … … 28 32 try { 29 33 return ZipReader.parseDataSet(in, handler, instance, true); 30 } catch (Exception e) { 34 } catch (IOException | XMLStreamException | FactoryConfigurationError e) { 31 35 throw new IllegalDataException(e); 32 36 } -
applications/editors/josm/plugins/opendata/src/org/openstreetmap/josm/plugins/opendata/core/io/archive/ZipReader.java
r30738 r33245 14 14 import java.util.zip.ZipInputStream; 15 15 16 import javax.xml.bind.JAXBException;17 16 import javax.xml.stream.FactoryConfigurationError; 18 17 import javax.xml.stream.XMLStreamException; … … 21 20 import org.openstreetmap.josm.data.osm.DataSet; 22 21 import org.openstreetmap.josm.gui.progress.ProgressMonitor; 22 import org.openstreetmap.josm.io.IllegalDataException; 23 23 import org.openstreetmap.josm.plugins.opendata.core.datasets.AbstractDataSetHandler; 24 24 … … 35 35 36 36 public static DataSet parseDataSet(InputStream in, AbstractDataSetHandler handler, ProgressMonitor instance, boolean promptUser) 37 throws IOException, XMLStreamException, FactoryConfigurationError, JAXBException {37 throws IOException, XMLStreamException, FactoryConfigurationError, IllegalDataException { 38 38 return new ZipReader(in, handler, promptUser).parseDoc(instance); 39 39 } 40 40 41 41 public static Map<File, DataSet> parseDataSets(InputStream in, AbstractDataSetHandler handler, ProgressMonitor instance, boolean promptUser) 42 throws IOException, XMLStreamException, FactoryConfigurationError, JAXBException {42 throws IOException, XMLStreamException, FactoryConfigurationError, IllegalDataException { 43 43 return new ZipReader(in, handler, promptUser).parseDocs(instance); 44 44 } -
applications/editors/josm/plugins/opendata/src/org/openstreetmap/josm/plugins/opendata/core/io/geographic/AbstractMapInfoReader.java
r32545 r33245 5 5 import java.io.File; 6 6 import java.io.IOException; 7 import java.io.InputStream; 7 8 import java.nio.charset.Charset; 8 9 import java.nio.charset.IllegalCharsetNameException; … … 13 14 14 15 import org.openstreetmap.josm.Main; 16 import org.openstreetmap.josm.data.osm.DataSet; 17 import org.openstreetmap.josm.gui.progress.ProgressMonitor; 15 18 import org.openstreetmap.josm.io.AbstractReader; 19 import org.openstreetmap.josm.io.IllegalDataException; 16 20 import org.openstreetmap.josm.plugins.opendata.core.OdConstants; 17 21 … … 38 42 protected int numcolumns = -1; 39 43 protected List<String> columns; 44 45 @Override 46 protected DataSet doParseDataSet(InputStream source, 47 ProgressMonitor progressMonitor) throws IllegalDataException { 48 return null; 49 } 40 50 41 51 protected final File getDataFile(File headerFile, String extension) { -
applications/editors/josm/plugins/opendata/src/org/openstreetmap/josm/plugins/opendata/core/io/geographic/GeographicReader.java
r32545 r33245 6 6 import java.awt.Component; 7 7 import java.awt.GraphicsEnvironment; 8 import java.io.InputStream; 8 9 import java.util.ArrayList; 9 10 import java.util.Arrays; … … 36 37 import org.openstreetmap.josm.Main; 37 38 import org.openstreetmap.josm.data.coor.LatLon; 39 import org.openstreetmap.josm.data.osm.DataSet; 38 40 import org.openstreetmap.josm.data.osm.Node; 39 41 import org.openstreetmap.josm.data.osm.OsmPrimitive; … … 43 45 import org.openstreetmap.josm.data.validation.tests.DuplicateWay; 44 46 import org.openstreetmap.josm.gui.ExtendedDialog; 47 import org.openstreetmap.josm.gui.progress.ProgressMonitor; 45 48 import org.openstreetmap.josm.io.AbstractReader; 49 import org.openstreetmap.josm.io.IllegalDataException; 46 50 import org.openstreetmap.josm.plugins.opendata.core.OdConstants; 47 51 import org.openstreetmap.josm.plugins.opendata.core.gui.DialogPrompter; … … 79 83 this.handler = handler; 80 84 this.defaultHandlers = defaultHandlers; 85 } 86 87 @Override 88 protected DataSet doParseDataSet(InputStream source, ProgressMonitor progressMonitor) throws IllegalDataException { 89 return null; 81 90 } 82 91 -
applications/editors/josm/plugins/opendata/src/org/openstreetmap/josm/plugins/opendata/core/io/geographic/KmlReader.java
r32545 r33245 26 26 import org.openstreetmap.josm.gui.progress.ProgressMonitor; 27 27 import org.openstreetmap.josm.io.AbstractReader; 28 import org.openstreetmap.josm.io.IllegalDataException; 28 29 import org.openstreetmap.josm.io.UTFInputStreamReader; 29 30 import org.openstreetmap.josm.plugins.opendata.core.OdConstants; … … 60 61 XMLStreamReader parser = XMLInputFactory.newInstance().createXMLStreamReader(ir); 61 62 return new KmlReader(parser).parseDoc(); 63 } 64 65 @Override 66 protected DataSet doParseDataSet(InputStream source, 67 ProgressMonitor progressMonitor) throws IllegalDataException { 68 return null; 62 69 } 63 70 -
applications/editors/josm/plugins/opendata/src/org/openstreetmap/josm/plugins/opendata/core/io/geographic/KmzReader.java
r32545 r33245 16 16 import org.openstreetmap.josm.gui.progress.ProgressMonitor; 17 17 import org.openstreetmap.josm.io.AbstractReader; 18 import org.openstreetmap.josm.io.IllegalDataException; 18 19 19 20 public class KmzReader extends AbstractReader { … … 28 29 throws IOException, XMLStreamException, FactoryConfigurationError { 29 30 return new KmzReader(new ZipInputStream(in)).parseDoc(instance); 31 } 32 33 @Override 34 protected DataSet doParseDataSet(InputStream source, 35 ProgressMonitor progressMonitor) throws IllegalDataException { 36 return null; 30 37 } 31 38 -
applications/editors/josm/plugins/opendata/src/org/openstreetmap/josm/plugins/opendata/core/io/tabular/SpreadSheetReader.java
r33049 r33245 25 25 import org.openstreetmap.josm.gui.progress.ProgressMonitor; 26 26 import org.openstreetmap.josm.io.AbstractReader; 27 import org.openstreetmap.josm.io.IllegalDataException; 27 28 import org.openstreetmap.josm.plugins.opendata.core.OdConstants; 28 29 import org.openstreetmap.josm.plugins.opendata.core.gui.ChooserLauncher; … … 84 85 } 85 86 return col; 87 } 88 89 @Override 90 protected DataSet doParseDataSet(InputStream source, 91 ProgressMonitor progressMonitor) throws IllegalDataException { 92 return null; 86 93 } 87 94
Note:
See TracChangeset
for help on using the changeset viewer.