1

I have an amended road network shape file (.shp) that I need to convert to json/xml/osm format (any of the following is fine). I am unable to use files with .geojson extension as the function, I am trying to use for my task doesn't accept this format (function OpenStreetMapSpace() from the agents.jlpackage, url : https://juliadynamics.github.io/Agents.jl/stable/api/#Agents.OpenStreetMapSpace)

I followed the following post (Convert a shapefile (.shp) to xml/json) and converted my .shp file to a .json file. However the file that is produced is a GeoJSON file as mentioned by "GeoJSON" (even though it has a .json extension).

ogr2ogr -f "GeoJSON" output.json input.shp

The produced output.json file doesn't work with function i mentioned above and throws an error saying elements not found. And so it seems the function requires .json file.

Any idea on how to convert .shp file to a .json, .osm or .xml file? (As any of these file formats are mentioned to work with this function)

imantha
  • 2,676
  • 4
  • 23
  • 46

0 Answers0