use of org.opentripplanner.routing.edgetype.NamedArea in project OpenTripPlanner by opentripplanner.
the class WalkableAreaBuilder method createNamedAreas.
private void createNamedAreas(AreaEdgeList edgeList, Ring ring, Collection<Area> areas) {
Polygon containingArea = ring.toJtsPolygon();
for (Area area : areas) {
Geometry intersection = containingArea.intersection(area.toJTSMultiPolygon());
if (intersection.getArea() == 0) {
continue;
}
NamedArea namedArea = new NamedArea();
OSMWithTags areaEntity = area.parent;
int cls = StreetEdge.CLASS_OTHERPATH;
cls |= OSMFilter.getStreetClasses(areaEntity);
namedArea.setStreetClass(cls);
String id = "way (area) " + areaEntity.getId() + " (splitter linking)";
I18NString name = __handler.getNameForWay(areaEntity, id);
namedArea.setName(name);
WayProperties wayData = wayPropertySet.getDataForWay(areaEntity);
Double safety = wayData.getSafetyFeatures().first;
namedArea.setBicycleSafetyMultiplier(safety);
namedArea.setOriginalEdges(intersection);
StreetTraversalPermission permission = OSMFilter.getPermissionsForEntity(areaEntity, StreetTraversalPermission.PEDESTRIAN_AND_BICYCLE);
namedArea.setPermission(permission);
edgeList.addArea(namedArea);
}
}
Aggregations