private void addRelation(final PackedAtlasBuilder builder, final Relation relation) { final RelationBean bean = new RelationBean(); relation.members().forEach(member -> bean.addItem(member.getEntity().getIdentifier(), member.getRole(), member.getEntity().getType())); builder.addRelation(relation.getIdentifier(), relation.osmRelationIdentifier(), bean, relation.getTags()); } }
private boolean canAddEdgeToBoundary(final Edge edge, final Route boundary) { return edge.getIdentifier() != -boundary.end().getIdentifier() && edge.getOsmIdentifier() == boundary.end().getOsmIdentifier() && boundary.end().end().getLocation().equals(edge.start().getLocation()) && !boundary.includes(edge); } }
@Override public JsonObject geoJsonProperties() { final JsonObject properties = super.geoJsonProperties(); properties.addProperty("startNode", start().getIdentifier()); properties.addProperty("endNode", end().getIdentifier()); return properties; }
@Override public Iterable<Location> getRawGeometry() { return getLocation(); }
/** * @return The underlying {@link PolyLine}, which will not have the end {@link Location} equal * to the start {@link Location}. i.e. the area will not be closed. */ @Override public Iterable<Location> getRawGeometry() { return asPolygon(); }
@Override public String toString() { return "[TemporaryOrderedNode: id = " + this.nodeIdentifier + " (" + this.node.getLocation() + "), offset = " + this.offset + ", occurrence = " + this.occurrenceIndex + "]"; } }
@Override public Rectangle bounds() { return this.edge.bounds(); }
@Override public int indexOf(final Edge edge) { return this.edge.getIdentifier() == edge.getIdentifier() ? 0 : -1; }
@Override public Node end() { return this.source.end(); }
@Override protected boolean isCounted(final LineItem item) { for (final Relation relation : item.relations()) { if (relation.containsValue("type", RELATION_TYPE_MATCHES) && relation.containsValue("route", RELATION_ROUTE_MATCHES)) { return true; } } return false; }
public Route getRoute() { if (this.route == null) { this.route = Route.fromNonArrangedEdgeSet(this.members, false); } return this.route; }
public TemporaryOrderedNode(final Node node, final Ratio offset, final int occurrenceIndex) { this.nodeIdentifier = node.getIdentifier(); this.node = node; this.offset = offset; this.occurrenceIndex = occurrenceIndex; }
@Override public Set<Relation> relations() { return this.source.relations(); }
@Override public int hashCode() { return this.source.hashCode(); }
@Override public String toString() { return configurableString("", ""); }
@Override public int hashCode() { return super.hashCode(); }