@Override public Map<String, String> getTags() { return this.getRepresentativeSubPoint().getTags(); }
@Override public Map<String, String> getTags() { return subPoint().getTags(); }
/** * A simple point is one that only has the mandatory entity tags. See * {@link AtlasTag#TAGS_FROM_OSM} for the 5 tags. Examples of non-simple points include stop * lights, barriers, etc. * * @param atlas * The {@link Atlas} to check * @param pointIdentifier * The {@link Point} identifier to use * @return {@code true} if the given identifier represents a simple {@link Point} */ private boolean isSimplePoint(final Atlas atlas, final long pointIdentifier) { return atlas.point(pointIdentifier).getTags().size() == AtlasTag.TAGS_FROM_OSM.size(); }
public static CompletePoint from(final Point point) { return new CompletePoint(point.getIdentifier(), point.getLocation(), point.getTags(), point .relations().stream().map(Relation::getIdentifier).collect(Collectors.toSet())); }
/** * Updates the {@link Point} tags for all existing {@link Point}s in the original Atlas, and * adds it to the updated Atlas. */ private void addUpdatedPoints() { this.getAtlas().points().forEach(point -> { final long pointIdentifier = point.getIdentifier(); if (this.changeSet.getUpdatedPointTags().containsKey(pointIdentifier)) { final Point originalPoint = this.getAtlas().point(pointIdentifier); final Map<String, String> updatedTags = originalPoint.getTags(); updatedTags.putAll( this.changeSet.getUpdatedPointTags().get(pointIdentifier).getTags()); this.getBuilder().addPoint(pointIdentifier, originalPoint.getLocation(), updatedTags); } }); }
private void addExistingPointsAndLines() { this.getAtlas().points().forEach(point -> { // Add the point, if it hasn't been deleted if (!this.changeSet.getDeletedPoints().contains(point.getIdentifier())) { this.getBuilder().addPoint(point.getIdentifier(), point.getLocation(), point.getTags()); } }); this.getAtlas().lines().forEach(line -> { // Add the line, if it hasn't been deleted if (!this.changeSet.getDeletedLines().contains(line.getIdentifier())) { this.getBuilder().addLine(line.getIdentifier(), line.asPolyLine(), line.getTags()); } }); }
line -> builder.addLine(line.getIdentifier(), line.asPolyLine(), line.getTags())); atlas.points().forEach(point -> builder.addPoint(point.getIdentifier(), point.getLocation(), point.getTags()));
@Test public void testFull() { final Atlas atlas = this.rule.getAtlas(); final Point source = atlas.point(33); final CompletePoint result = CompletePoint.from(source); Assert.assertEquals(source.getIdentifier(), result.getIdentifier()); Assert.assertEquals(source.bounds(), result.bounds()); Assert.assertEquals(source.getLocation(), result.getLocation()); Assert.assertEquals(source.getTags(), result.getTags()); Assert.assertEquals( source.relations().stream().map(Relation::getIdentifier) .collect(Collectors.toSet()), result.relations().stream().map(Relation::getIdentifier) .collect(Collectors.toSet())); }
final Map<String, String> tags = point.getTags(); if (pointsNeedingSyntheticTag.contains(identifier))
private void writePointsToBuilder(final Atlas atlas, final ProtoAtlas.Builder protoAtlasBuilder) { long numberOfPoints = 0; for (final Point point : atlas.points()) { final ProtoPoint.Builder protoPointBuilder = ProtoPoint.newBuilder(); protoPointBuilder.setId(point.getIdentifier()); protoPointBuilder.setLocation( ProtoAtlasBuilder.PROTOLOCATION_CONVERTER.backwardConvert(point.getLocation())); final Map<String, String> tags = point.getTags(); protoPointBuilder .addAllTags(ProtoAtlasBuilder.PROTOTAG_LIST_CONVERTER.backwardConvert(tags)); numberOfPoints++; protoAtlasBuilder.addPoints(protoPointBuilder.build()); } protoAtlasBuilder.setNumberOfPoints(numberOfPoints); }
point.getLocation(), point.getTags()));
point.getLocation(), point.getTags()));
/** * Add all points, areas and lines that pass the given matcher to the sub-atlas, using the given * {@link PackedAtlasBuilder}. * * @param matcher * The matcher to consider * @param builder * The {@link PackedAtlasBuilder} used to build the sub-atlas */ private void indexPointsAreasLines(final Predicate<AtlasEntity> matcher, final PackedAtlasBuilder builder) { for (final Point point : this.atlas.points(matcher::test)) { builder.addPoint(point.getIdentifier(), point.getLocation(), point.getTags()); } for (final Area area : this.atlas.areas(matcher::test)) { builder.addArea(area.getIdentifier(), area.asPolygon(), area.getTags()); } for (final Line line : this.atlas.lines(matcher::test)) { builder.addLine(line.getIdentifier(), line.asPolyLine(), line.getTags()); } } }
pointMember.getTags());