osm4j icon indicating copy to clipboard operation
osm4j copied to clipboard

Add support for reading JOSM files

Open sebkur opened this issue 3 years ago • 1 comments

JOSM produces files with a dialect (info here: https://wiki.openstreetmap.org/wiki/JOSM_file_format)

It would be good if the XML parser was able to read those files.

sebkur avatar Feb 18 '23 18:02 sebkur

Feel free to use this test file I've created for OSM2World to test reading JOSM files. I believe it contains most or all the ways in which JOSM XML is different from standard OSM XML:

  • Deleted, modified and newly created elements (and therefore action attributes and missing metadata)
  • Multiple bounds
  • Bounds with origin
  • Negative ids
  • Root element with upload attribute

Ideally, the result would be that deleted elements would not be part of the result, while other elements would be.

I'm not sure if there's a canonical way of handling multiple bounds – I'm currently calculating the union of the bounds, but that will still incorrect results with some use cases (such as coastline calculations).

tordanik avatar Feb 24 '23 14:02 tordanik