private long getLayerTagValueForPoint(final Atlas atlas, final long identifier) { return LayerTag.getTaggedOrImpliedValue(atlas.point(identifier), 0L); }
private boolean locationPartOfMultipleWaysWithDifferentLayerTags(final Atlas atlas, final Location location) { final long distinctLayerTagValues = StreamSupport .stream(atlas.linesContaining(location).spliterator(), false) .map(line -> LayerTag.getTaggedOrImpliedValue(atlas.line(line.getIdentifier()), 0L)) .distinct().count(); return distinctLayerTagValues > 1; }
/** * Determines whether the given {@link Line} has any intersecting {@link Line}s, with the same * layer tag value that meet the definition of an {@link Edge}, running through it at the given * {@link Location}. * * @param location * The {@link Location} to use * @param line * The {@link Line} to use * @return {@code true} if there is at least one {@link Edge} with the same layer tag value * intersecting the given line at the given location */ private boolean locationIsPartOfAnIntersectingEdgeOfTheSameLayer(final Location location, final Line line) { final long targetLayerValue = LayerTag.getTaggedOrImpliedValue(line, 0L); return Iterables // Find all intersecting edges .stream(this.rawAtlas.linesContaining(location, target -> target.getIdentifier() != line.getIdentifier() && isAtlasEdge(target) && target.asPolyLine().contains(location))) // Check whether that edge has the same layer value as the line we're looking at .anyMatch(candidate -> { final long layerValue = LayerTag.getTaggedOrImpliedValue(candidate, 0L); return targetLayerValue == layerValue; }); }
final Location location, final Line line) final long targetLayerValue = LayerTag.getTaggedOrImpliedValue(line, 0L); final long layerValue = LayerTag.getTaggedOrImpliedValue(candidate, 0L); final boolean edgesOnDifferentLayers = targetLayerValue != layerValue; final PolyLine candidatePolyline = candidate.asPolyLine();