Skip to content

Commit

Permalink
Update tag
Browse files Browse the repository at this point in the history
  • Loading branch information
sebhoerl committed May 29, 2023
1 parent 942cbdd commit 4e88e4b
Showing 1 changed file with 8 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -87,11 +87,13 @@ static public interface FacilityPlacementVoter {
}

static public class OSMFacilityPlacementVoter implements FacilityPlacementVoter {
private final static String HIGHWAY_TAG = "osm:way:highway";

public OSMFacilityPlacementVoter(RoadNetwork network) {
boolean foundAttribute = false;

for (Link link : network.getLinks().values()) {
if (link.getAttributes().getAttribute("osm:highway") != null) {
if (link.getAttributes().getAttribute(HIGHWAY_TAG) != null) {
foundAttribute = true;
break;
}
Expand All @@ -104,7 +106,7 @@ public OSMFacilityPlacementVoter(RoadNetwork network) {

@Override
public boolean canPlaceFacility(Link link) {
String highway = (String) link.getAttributes().getAttribute("osm:highway");
String highway = (String) link.getAttributes().getAttribute(HIGHWAY_TAG);

if (highway != null) {
if (highway.contains("motorway")) {
Expand All @@ -114,6 +116,10 @@ public boolean canPlaceFacility(Link link) {
if (highway.contains("trunk")) {
return false;
}

if (highway.contains("_link")) {
return false;
}
}

return true;
Expand Down

0 comments on commit 4e88e4b

Please sign in to comment.