static Long getTaggedOrImpliedValue(final Taggable taggable, final Long impliedValue) { final Optional<Long> taggedValue = getTaggedValue(taggable); return taggedValue.isPresent() ? taggedValue.get() : impliedValue; }
private Predicate<Edge> intersectsCoreWayInvalidly(final Area building) { // An invalid intersection is determined by checking that its highway tag is car navigable // or core way based on the configuration value return edge -> (this.carNavigableEdgesOnly ? HighwayTag.isCarNavigableHighway(edge) : HighwayTag.isCoreWay(edge)) // And if the edge intersects the building polygon && edge.asPolyLine().intersects(building.asPolygon()) // And ignore intersections where edge has highway=service and building has // Amenity=fuel && !(HIGHWAY_SERVICE_TAG.test(edge) && Validators.isOfType(building, AmenityTag.class, AmenityTag.FUEL)) // And if the layers have the same layer value && LayerTag.getTaggedValue(edge).orElse(0L) .equals(LayerTag.getTaggedValue(building).orElse(0L)) // And if the building/edge intersection is not valid && !isValidIntersection(building, edge) // And if the edge has no Access = Private tag && !Validators.isOfType(edge, AccessTag.class, AccessTag.PRIVATE); }
final Optional<Long> layerTagValue = LayerTag.getTaggedValue(object); final boolean isTagValueValid = layerTagValue.isPresent();
? LayerTag.getTaggedValue(edge) : Optional.of(OSM_LAYER_DEFAULT); final Optional<Long> crossingEdgeLayer = Validators .hasValuesFor(crossingEdge, LayerTag.class) ? LayerTag.getTaggedValue(crossingEdge) : Optional.of(OSM_LAYER_DEFAULT); return edgeAsPolyLine.intersections(crossingEdgeAsPolyLine).stream()