LineString geometry = edge.getGeometry();
if (geometry != null) {
if (coordinates.size() == 0) {
coordinates.extend(geometry.getCoordinates());
} else {
coordinates.extend(geometry.getCoordinates(), 1); // Avoid duplications
}
}
}
Geometry geom = GeometryUtils.getGeometryFactory().createLineString(coordinates);
this.geometry = PolylineEncoder.createEncodings(geom);