@@ -127,6 +127,10 @@ public class OSMReader implements DataReader {
127
127
// Modification by Maxim Rylov
128
128
private boolean calcDistance3D = true ;
129
129
130
+ public static final String [] HGV_VALUES = new String [] { "maxheight" , "maxweight" , "maxweight:hgv" , "maxwidth" , "maxlength" , "maxlength:hgv" , "maxaxleload" };
131
+ public static final Set <String > hgv_tags = new HashSet <>(Arrays .asList (HGV_VALUES ));
132
+
133
+
130
134
public OSMReader (GraphHopperStorage ghStorage ) {
131
135
this .ghStorage = ghStorage ;
132
136
this .graph = ghStorage ;
@@ -609,7 +613,17 @@ boolean addNode(ReaderNode node) {
609
613
addTowerNode (node .getId (), lat , lon , ele );
610
614
} else if (nodeType == PILLAR_NODE ) {
611
615
pillarInfo .setNode (nextPillarId , lat , lon , ele );
612
- osmNodeIdToReaderNodeMap .put (node .getId (), node .getTags ());
616
+ java .util .Iterator <Entry <String , Object >> it = node .getTags ().entrySet ().iterator ();
617
+ Map <String , Object > temp = new HashMap <>();
618
+
619
+ while (it .hasNext ()) {
620
+ Map .Entry <String , Object > pairs = it .next ();
621
+ String key = pairs .getKey ();
622
+ if (!hgv_tags .contains (key ))
623
+ continue ;
624
+ temp .put (key , pairs .getValue ());
625
+ }
626
+ if (!temp .isEmpty ()) osmNodeIdToReaderNodeMap .put (node .getId (), temp );
613
627
getNodeMap ().put (node .getId (), nextPillarId + 3 );
614
628
nextPillarId ++;
615
629
}
0 commit comments