0

I am using OSM (Open Street Map) turbo overpass api to get all the elements in a small bounding box and export it to a shapefile.

Now, I would like to split the elements into layers where each layer is a category such as building, highway etc. My problem is that OSM categories are not mutually exclusive and something can be both building and amenity for example. I need to find the best solution where every element only gets exactly one category.

I understand there might not be an optimal solution since in OSM (and also in reality) things do not fall into distinct categories but I'm looking for the best next thing.

My current solution is to subjectively rate tags based on importance and use the most important one on the element.

Are there any common solutions out there? or a commonly used tag importance order?

1
  • Seems you want to categorize data, which from definition can't be categorized by 0/1. I would suggest to reverse the process and first define the categories you are interested in, then split the features by category. Don't know your specific case, but you can create a polygon layer for building, and point layer for shops, where you will union shops from nodes and shops from building's centroids. If you wish to have 1:1 relation, you have to assign weight/importance to your categories and split the features by weight. Commented Dec 1 at 20:09

0

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Browse other questions tagged or ask your own question.