This is a static archive of our old OpenStreetMap Help Site. Please post any new questions and answers at community.osm.org.

how do you crop / extract map data from .osm.pbf in the Julia programming language

0

My goal is to obtain the driving road network of a certain area using open street map data. Reference link: What's the general algorithm to draw a road network of a certain area? I'm using Julia package OpenStreetMapX. In the function call get_map_data, I realized that there is the other function OpenStreetMapX.crop!(osmdata, crop_relations = false). I understand that the purpose of this function is to crop the nodes, ways, relations based on a given bounds. I'm confused about these two different methods.

asked 24 Oct '19, 10:39

good0's gravatar image

good0
11112
accept rate: 0%

edited 27 Oct '19, 14:24

SimonPoole's gravatar image

SimonPoole ♦
44.7k13326701


One Answer:

0

I had a quick look at the repo and there didn't seem to be a crop function to start with, see https://pszufe.github.io/OpenStreetMapX.jl/latest/reference/ Further I didn't see any PBF format support, just OSM xml format.

I would suggest asking the author for support as it is rather unlikely anybody here will be able to help you.

answered 27 Oct '19, 14:33

SimonPoole's gravatar image

SimonPoole ♦
44.7k13326701
accept rate: 18%

The crop function is here: https://github.com/pszufe/OpenStreetMapX.jl/blob/master/src/crop.jl The .osm file is supported as the following: using OpenStreetMapX map_data = get_map_data("/home/ubuntu/mymap.osm"); println("The map contains $(length(map_data.nodes)) nodes")

(28 Oct '19, 12:33) good0

If just doesn't turn up in the documentation.

(28 Oct '19, 14:43) SimonPoole ♦

Source code available on GitHub .