locationtech / spatial4j

LocationTech Spatial4j: A Geospatial Library for Java

Home Page:https://projects.eclipse.org/projects/locationtech.spatial4j

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

JtsShapeFactory.makeShapeFromGeometry IllegalStateException on empty Point

abrokenjester opened this issue · comments

When using JtsShapeFactory.makeShapeFromGeometry on a Geometry that represents an empty Point, an IllegalStateException is thrown:

java.lang.IllegalStateException: getX called on empty Point
	at org.locationtech.jts.geom.Point.getX(Point.java:102)
	at org.locationtech.spatial4j.shape.jts.JtsShapeFactory.makeShapeFromGeometry(JtsShapeFactory.java:478)

Perhaps it could properly convert an empty JTS Geometry to a corresponding empty Shape.