Merging external .shp data with .osm/.osm.pbf data to use in Valhalla

Hi,

I’m working on a routing tool with Valhalla for forestry truck routing in forests.
I got some external data in .shp-format with specific attributes related to forestry trucks and useable routes (f.e carrying capacity of a way and suitabilty for trucks) that just contains ways in forests.

Since I want to use Valhalla I figured that I have to integrate my data to the OSM data I’m using as base data in Valhalla.
My problem at the moment isn’t about converting .shp to .osm or .osm to .shp, rather its about how to correctly integrate external data into the hierachy of OSM data? Its just line features I want to add to existing road networks in the OSM data I use.

I was thinking to just connect the vertices of my external data with the OSM datas vertices but I dont think thats feasible in the end because its missing all the OSM-related attributes and structures, which are relevant both for general OSM data and the Valhalla routing engine.


As an example:
I got the orange polylines which show forestry ways via external data (some of them which are not mapped yet by OSM contributors) and the pink-ish polylines, which are just OSM track data. I think I can just use OSM data where its overlapping with the external data and add some custom attributes.

However, as you can see there are some areas with external data that are not part of OSM yet. Thats what I want to connect with the existing OSM data. I’m just not sure how to add extra data to the hierachy of OSM data so f.e. it keeps on using an existing way from my external data that was connected to the OSM data if theres no OSM data existing anymore.

Let me know if this question is better suited in the Valhalla GitLab Issues. I was just thinking that its more of a problem on how to join the datasets correctly rather than Valhalla-related. :slight_smile:
Thanks in advance!

It’s a complex issue that’s not easy to solve.
But when using OpenStreetMap (OSM) data, don’t forget about the legal aspects.

If you use OpenStreetMap data along with non-OpenStreetMap data for a given Feature Type, then the share-alike condition would apply regardless of whether some data for that Feature Type is in a different layer than the other data for that Feature Type.

Because of these issues, I would add the basic forest tracks missing from OSM (after checking with satellite) into OSM (using JOSM?) and make sure the routes connect properly.
You can check the road completeness in JOSM with “JOSM Validation Tools”

Thinking differently, some questions:

  • Can you make the forest route SHP file you received open data? ( OSM License Compatible )
  • Can you ask the client to have a local OSM volunteer add the missing parts?"