| Forum | GitHub | Maps | Blog

Priority of certain types of nodes


How to correctly outline the zones around some nodes so that the weight of the edges in these zones is higher? For example, I need to be able to set a series of tags (‘park’ and ‘tourism’) and than the path will be constructed through these zones, if they lie not far from the shortest path? Should I create a separate map file for this purpose and enrich all edges of the nodes that interesting me with a special tag, or is it possible to separate these edges and nodes inside the graphhopper?


The way I would implement this is via edge properties. So you store the node IDs that needs the post-processing while import and then apply the necessary change to the edges via something like this

for(int node : nodes) {
   EdgeIterator iter = edgeExplorer.setBaseNode(node);
   while( {
        // now use EncodedValue and the flags via iter.setFlags/getFlags();

Instead of setFlags/getFlags (see low level API) I would use the latest development. For that see this feature branch that makes adding additional edge properties much easier and avoids this complexity and is already pretty stable.