Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
[geomesa-users] Exception in storing null Point for geometry

Hello Everyone

I am using `Point` geometry type in geomesa for strong lat-long details in feature type. In one of the use case while storing a new feature I don't have value for lat-long so I tried sending `null` object for `createPoint` function, but the library 'jts' throwing exception while processing null Geometry type. [Here][1] is the source code. By seeing the implementation of `jts`library, It seems difficult for storing null in geomesa Point. It seems function createUuid needs an empty check for the Point.
Here is the snapshot of my code:

    sf.setAttribute(Attributes.GEOMETRY.getValue(), JTSFactoryFinder.getGeometryFactory().createPoint((Coordinate)null/*new Coordinate(event.lat, event.lng)*/));

Attaching logs for exception:

java.lang.IllegalStateException: getX called on empty Point

    at com.vividsolutions.jts.geom.Point.getX(Point.java:124)

    at org.locationtech.geomesa.utils.uuid.Z3UuidGenerator$.createUuid(Z3FeatureIdGenerator.scala:93)

    at org.locationtech.geomesa.utils.uuid.Z3UuidGenerator$.createUuid(Z3FeatureIdGenerator.scala:70)

    at org.locationtech.geomesa.utils.uuid.Z3FeatureIdGenerator.createId(Z3FeatureIdGenerator.scala:32)

    at org.locationtech.geomesa.index.geotools.GeoMesaFeatureWriter$.featureWithFid(GeoMesaFeatureWriter.scala:64)

    at org.locationtech.geomesa.index.geotools.GeoMesaFeatureWriter.writeFeature(GeoMesaFeatureWriter.scala:128)

    at org.locationtech.geomesa.index.geotools.GeoMesaAppendFeatureWriter$class.write(GeoMesaFeatureWriter.scala:194)

    at org.locationtech.geomesa.accumulo.data.AccumuloAppendFeatureWriter.write(AccumuloFeatureWriter.scala:19)

    at com.hps.GeomesaClient.insert(GeomesaClient.java:129)


Thank You

Suresh Prajapti


Back to the top