Changeset 33241 in osm
- Timestamp:
- 2017-04-15T16:47:18+02:00 (8 years ago)
- Location:
- applications/editors/josm/plugins/pbf
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
applications/editors/josm/plugins/pbf/build.xml
r33165 r33241 3 3 4 4 <!-- enter the *lowest* JOSM version this plugin is currently compatible with --> 5 <property name="plugin.main.version" value="11 626"/>5 <property name="plugin.main.version" value="11919"/> 6 6 7 7 <property name="plugin.author" value="Don-vip"/> -
applications/editors/josm/plugins/pbf/src/org/openstreetmap/josm/plugins/pbf/PbfPlugin.java
r32290 r33241 4 4 import org.openstreetmap.josm.Main; 5 5 import org.openstreetmap.josm.actions.ExtensionFileFilter; 6 import org.openstreetmap.josm.io.OverpassDownloadReader; 7 import org.openstreetmap.josm.io.OverpassDownloadReader.OverpassOutpoutFormat; 6 8 import org.openstreetmap.josm.plugins.Plugin; 7 9 import org.openstreetmap.josm.plugins.PluginInformation; … … 9 11 import org.openstreetmap.josm.plugins.pbf.io.PbfExporter; 10 12 import org.openstreetmap.josm.plugins.pbf.io.PbfImporter; 13 import org.openstreetmap.josm.plugins.pbf.io.PbfReader; 11 14 12 15 /** … … 28 31 // Allow JOSM to download remote *.osm.pbf files 29 32 Main.main.menu.openLocation.addDownloadTaskClass(DownloadPbfTask.class); 33 // Alow JOSM to download PBF data from Overpass API 34 OverpassDownloadReader.registerOverpassOutpoutFormatReader(OverpassOutpoutFormat.PBF, PbfReader.class); 30 35 } 31 36 } -
applications/editors/josm/plugins/pbf/src/org/openstreetmap/josm/plugins/pbf/io/PbfReader.java
r33165 r33241 18 18 import org.openstreetmap.josm.data.coor.LatLon; 19 19 import org.openstreetmap.josm.data.osm.DataSet; 20 import org.openstreetmap.josm.data.osm.DataSet.UploadPolicy; 20 21 import org.openstreetmap.josm.data.osm.Node; 21 22 import org.openstreetmap.josm.data.osm.OsmPrimitive; … … 276 277 } 277 278 if (discourageUpload) 278 ds.setUpload Discouraged(true);279 ds.setUploadPolicy(UploadPolicy.DISCOURAGED); 279 280 } 280 281 … … 295 296 public void complete() { 296 297 if (discourageUpload) 297 ds.setUpload Discouraged(true);298 ds.setUploadPolicy(UploadPolicy.DISCOURAGED); 298 299 } 299 300 } … … 314 315 ProgressMonitor monitor = progressMonitor == null ? NullProgressMonitor.INSTANCE : progressMonitor; 315 316 CheckParameterUtil.ensureParameterNotNull(source, "source"); 316 317 PbfReader reader = new PbfReader(); 318 317 return new PbfReader().doParseDataSet(source, monitor); 318 } 319 320 @Override 321 protected DataSet doParseDataSet(InputStream source, ProgressMonitor monitor) 322 throws IllegalDataException { 319 323 try { 320 324 monitor.beginTask(tr("Prepare OSM data...", 2)); 321 325 monitor.indeterminateSubTask(tr("Reading OSM data...")); 322 326 323 reader.parse(source);327 parse(source); 324 328 monitor.worked(1); 325 329 326 330 monitor.indeterminateSubTask(tr("Preparing data set...")); 327 reader.prepareDataSet();331 prepareDataSet(); 328 332 monitor.worked(1); 329 return reader.getDataSet();333 return getDataSet(); 330 334 } catch (IllegalDataException e) { 331 335 throw e;
Note:
See TracChangeset
for help on using the changeset viewer.