Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -72,16 +72,16 @@ public static Geometry getGeometry(
.map(nd -> new Coordinate(nd.getLongitude(), nd.getLatitude()))
.toArray(Coordinate[]::new);
if (areaDecider.isArea(entity)) {
try {
if (coords.length >= 4 && coords[0].equals2D(coords[coords.length - 1])) {
return geometryFactory.createPolygon(coords);
} catch (IllegalArgumentException e) {
LOG.warn("way/{} should be closed - falling back to linestring geometry", way.getId());
System.out.println("way/"+way.getId()+" should be closed - falling back to linestring geometry");
return geometryFactory.createLineString(coords);
} else {
LOG.warn("way/{} doesn't form a linear ring - falling back to linestring", way.getId());
}
} else if (coords.length >= 2) {
}
if (coords.length >= 2) {
return geometryFactory.createLineString(coords);
} else if (coords.length == 1) {
}
if (coords.length == 1) {
LOG.info("way/{} is single-noded - falling back to point geometry", way.getId());
return geometryFactory.createPoint(coords[0]);
} else {
Expand Down