0

I need to customize mapconfig.xml file.

I have to do bike routing so I start with mapconfig_for_bicycles.xml https://github.com/pgRouting/osm2pgrouting/blob/master/mapconfig_for_bicycles.xml

This configuration ignore, for examples, ways like https://www.openstreetmap.org/way/409033340 with tag name "bicycle" and tag value "designated" (but also tag name "highway" and tag value "path").

So I edit the xml file adding this rows:

....
<tag_name name="bicycle" id="5">
<tag_value name="designated" priority="1.6" id="501" />
</tag_name>

<tag_name name="highway" id="6">
<tag_value name="cycleway" priority="1.0" id="601" />
<tag_value name="path" priority="1.1" id="602" />
<tag_value name="pedestrian" priority="1.1" id="603" />
...

With this configuration after import, tag_id is still 602, not 501 as expected.

To have expected result (tag_id = 501) I need to delete the row:

<tag_value name="path" priority="1.1" id="602" />

But in this way I'm not sure I will import all ways with tag name "bicycle" and tag value "designated" and I cannot have a tag_id for all ways with tag name "highway" and tag value "path".

What is the best way to configure xml file to include the 2 info together?

2 Answers 2

0

I undesrtand I have to set the priority parameter.

0
0

el valor por defecto de la prioridad es 1 y mientras mas se acerque al 0, tendra mas prioridad.

OSM2PGROUTING va comparando sus etiquetas de la configuracion xml segun la prioridad y despues segun el orden de OSM, es decir, de arriba hacia abajo.

enter image description here

entonces tienes 2 opciones: cambiar el orden en OSM o lo mas recomendado modificar tu xml.

SOLUCION

<tag_name name="bicycle" id="5">
<tag_value name="designated" priority="0.9" id="501" />
</tag_name>

<tag_name name="highway" id="6">
<tag_value name="cycleway" priority="1.0" id="601" />
<tag_value name="path" priority="0.9" id="602" />
<tag_value name="pedestrian" priority="1.1" id="603" />
1
  • 1
    The answer seems correct, but we only accept answers in English. Please, translate it.
    – HMSP
    Commented Sep 17 at 5:49

Your Answer

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

Not the answer you're looking for? Browse other questions tagged or ask your own question.