Opened 5 years ago
Closed 5 years ago
#19162 closed defect (invalid)
OSM XML, saved from shapefile, does not create "bounds" element, and not node/way version/timestamp which is needed by osmosis mapsforge writer
Reported by: | joot84 | Owned by: | team |
---|---|---|---|
Priority: | normal | Milestone: | |
Component: | Core | Version: | |
Keywords: | Cc: |
Description (last modified by )
I tried to use JOSM for creating an OSM XML file from a shapefile as input (with the JOSM plugin opendata) but the XML created by JOSM was not correct.
At least not correct according to the mapsforge writer plugin for osmosis when trying to create a mapsforge .map file from the osm xml that was saved with JOSM.
The following were the problems with osm xml that was created with JOSM:
- The bounding box was missing i.e. the element "bounds" (with its attributes minlat,minlon,maxlat,maxlon) directly after the "osm" root element.
- The attributes "version" and "timestamp" were missing for elements "node" and "way"
(I suppose those attributes are required for the element "relation" too but I did not have any of those in my osm file created by the shapefile)
Altogether, I got the above five exceptions (node/version , node/timestamp , way/version , way/timestamp , and the bounds) which I fixed one at a time by doing search/replace within the JOSM created osm xml file in a text editor, until I actually could create a mapsforge .map file.
I do not know if there is a good reason to intentionally not save the above things into the osm xml file, but I think it should at least be an option for the end user to do so.
BTW, I found the JOSM application because I was looking for a way to convert a shapefile to a mapsforge file, but it seems not possible to do that directly, so first you need to convert a shapefile to OSM (xml or pbf) and then you can use that for converting to mapsforge file.
Therefore I am also wondering if you are exposing those features through some command prompt tool i.e. a tool that uses your java classes but without using the GUI?
If such a conversion (shapefile to osm xml, and preferably also to osm pbf) feature would be available to use as a java library, then maybe someone might reuse it for creating an osmosis plugin that can create mapsforge files directly from a shapefile.
Edit/Update:
I forgot to mention the version I am using: 16239
Attachments (0)
Change History (4)
comment:1 by , 5 years ago
Description: | modified (diff) |
---|
comment:2 by , 5 years ago
Description: | modified (diff) |
---|
comment:3 by , 5 years ago
comment:4 by , 5 years ago
Resolution: | → invalid |
---|---|
Status: | new → closed |
An OSM object with a negative id doesn't have a version or a timestamp, as they don't exist in the OSM database.
The bounds statement is used to identify the area that was downloaded from the OSM server. Your workflow doesn't download any data and thus no bounds are stored.
This is corrrect and it would be wrong to change that in JOSM.