#14545 closed defect (fixed)
Open edited pbf file fails
Reported by: | Owned by: | Don-vip | |
---|---|---|---|
Priority: | normal | Milestone: | |
Component: | Plugin pbf | Version: | tested |
Keywords: | template_report, pbf | Cc: |
Description
What steps will reproduce the problem?
- Download pbf. file (e.g.: http://download.geofabrik.de/europe/germany/bremen-latest.osm.pbf)
- Extract area using osmconvert 0.8.5
osmconvert bremen-latest.osm.pbf -b=8.793526,53.050553,8.851290,53.083560 --complete-ways -o=bremen_extract.osm.pbf
- Open pbf file in JSOM (File --> Open) (works fine)
- Edit (e.g. add a node) and save (File --> Save)
- Delete layer (File --> Delete layer)
- Open pbf file again (File --> Open) (fails)
What is the expected result?
pbf file will be loaded like in step 3.
What happens instead?
Loading fails. Gives me the following error log:
2017-03-20 15:36:27.074 INFO: Open file: /home/peter/Downloads/osm_extract_1489670759.osm.pbf (208568 bytes) 2017-03-20 15:36:27.084 SEVERE: org.openstreetmap.josm.io.IllegalDataException: java.lang.IllegalArgumentException: Expected ID >= 0. Got -30,554.. Cause: java.lang.IllegalArgumentException: Expected ID >= 0. Got -30,554. org.openstreetmap.josm.io.IllegalDataException: java.lang.IllegalArgumentException: Expected ID >= 0. Got -30,554. at org.openstreetmap.josm.plugins.pbf.io.PbfReader.parseDataSet(PbfReader.java:333) at org.openstreetmap.josm.plugins.pbf.io.PbfImporter.parseDataSet(PbfImporter.java:30) at org.openstreetmap.josm.io.OsmImporter.loadLayer(OsmImporter.java:113) at org.openstreetmap.josm.io.OsmImporter.importData(OsmImporter.java:90) at org.openstreetmap.josm.io.OsmImporter.importData(OsmImporter.java:75) at org.openstreetmap.josm.io.FileImporter.importDataHandleExceptions(FileImporter.java:90) at org.openstreetmap.josm.actions.OpenFileAction$OpenFileTask.importData(OpenFileAction.java:349) at org.openstreetmap.josm.actions.OpenFileAction$OpenFileTask.realRun(OpenFileAction.java:302) at org.openstreetmap.josm.gui.PleaseWaitRunnable.doRealRun(PleaseWaitRunnable.java:93) at org.openstreetmap.josm.gui.PleaseWaitRunnable.run(PleaseWaitRunnable.java:141) at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:511) at java.util.concurrent.FutureTask.run(FutureTask.java:266) at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142) at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617) at java.lang.Thread.run(Thread.java:745) Caused by: java.lang.IllegalArgumentException: Expected ID >= 0. Got -30,554. at org.openstreetmap.josm.data.osm.OsmPrimitive.<init>(OsmPrimitive.java:159) at org.openstreetmap.josm.data.osm.OsmPrimitive.<init>(OsmPrimitive.java:186) at org.openstreetmap.josm.data.osm.Node.<init>(Node.java:179) at org.openstreetmap.josm.plugins.pbf.io.PbfReader$PbfParser.parseDense(PbfReader.java:147) at crosby.binary.BinaryParser.parse(BinaryParser.java:124) at crosby.binary.BinaryParser.handleBlock(BinaryParser.java:68) at crosby.binary.file.FileBlock.process(FileBlock.java:135) at crosby.binary.file.BlockInputStream.process(BlockInputStream.java:34) at org.openstreetmap.josm.plugins.pbf.io.PbfReader.parse(PbfReader.java:340) at org.openstreetmap.josm.plugins.pbf.io.PbfReader.parseDataSet(PbfReader.java:323) ... 14 more 2017-03-20 15:36:27.105 SEVERE: Error - <html>Could not read file 'osm_extract_1489670759.osm.pbf'.<br>Error is:<br>java.lang.IllegalArgumentException: Expected ID >= 0. Got -30,554.</html>
Please provide any additional information below. Attach a screenshot if possible.
URL:http://josm.openstreetmap.de/svn/trunk Repository:UUID: 0c6e7542-c601-0410-84e7-c038aed88b3b Last:Changed Date: 2017-02-26 23:10:22 +0100 (Sun, 26 Feb 2017) Build-Date:2017-02-26 22:34:39 Revision:11639 Relative:URL: ^/trunk Identification: JOSM/1.5 (11639 en) Linux Ubuntu 14.04.5 LTS Memory Usage: 1492 MB / 3522 MB (396 MB allocated, but free) Java version: 1.8.0_111-8u111-b14-3~14.04.1-b14, Oracle Corporation, OpenJDK 64-Bit Server VM Screen: :0.0 2560x1440 Maximum Screen Size: 2560x1440 Java package: openjdk-8-jre:amd64-8u111-b14-3~14.04.1 Java ATK Wrapper package: libatk-wrapper-java:all-0.30.4-4 Dataset consistency test: No problems found Plugins: + buildings_tools (33004) + o5m (33164) + pbf (33165) + scripting (30764) Last errors/warnings: - E: org.openstreetmap.josm.plugins.PluginListParseException: Failed to create plugin information from manifest for plugin 'mbtiles.jar'. Cause: org.openstreetmap.josm.plugins.PluginException: An error occurred in plugin mbtiles. Cause: java.io.IOException: invalid manifest format - E: org.openstreetmap.josm.io.IllegalDataException: java.lang.IllegalArgumentException: Expected ID >= 0. Got -30,482.. Cause: java.lang.IllegalArgumentException: Expected ID >= 0. Got -30,482. - E: Error - <html>Could not read file 'osm_extract_1489670759.osm.pbf'.<br>Error is:<br>java.lang.IllegalArgumentException: Expected ID >= 0. Got -30,482.</html> - E: org.openstreetmap.josm.io.IllegalDataException: java.lang.IllegalArgumentException: Expected ID >= 0. Got -30,490.. Cause: java.lang.IllegalArgumentException: Expected ID >= 0. Got -30,490. - E: Error - <html>Could not read file 'osm_extract_1489670759.osm.pbf'.<br>Error is:<br>java.lang.IllegalArgumentException: Expected ID >= 0. Got -30,490.</html>
Attachments (5)
Change History (11)
by , 8 years ago
Attachment: | josm_pbf_import_fails.png added |
---|
comment:1 by , 8 years ago
Owner: | changed from | to
---|---|
Status: | new → needinfo |
Can you please attach bremen_extract.osm.pbf
?
comment:2 by , 7 years ago
Owner: | changed from | to
---|---|
Status: | needinfo → new |
comment:3 by , 6 years ago
@Don-vip: I think I know how to fix this, I just created a patch for o5m plugin which shows the same problem.
The patch requires a change in core, see attached patch. Any problems with that?
I'd be happy to creaete a patch for pbf plugin as well.
I've also noticed that both pbf and o5m importers do not call org.openstreetmap.josm.io.AbstractReader.callPostProcessors(ProgressMonitor progressMonitor)
. When a *.osm file is opened this method is called. If I got that right this is currently not needed but might be a problem in the future?
by , 6 years ago
Attachment: | 145545.patch added |
---|
by , 6 years ago
Attachment: | reg14545.osm.pbf added |
---|
comment:4 by , 6 years ago
Attached is the patch. Works well with the test file bremen_extract.osm.pbf but I'd prefer to use a smaller file for a new unit test, see attached reg14545.osm.pbf
comment:5 by , 6 years ago
Resolution: | → fixed |
---|---|
Status: | new → closed |
fixed with [o34826:34828] (regression from r14535)
Screenshot of error alert