Suresh Prajapati
Suresh Prajapati

Reputation: 4457

Geomesa accumulo storing null Point for geometry

I am using Point geometry type in geomesa for strong lat-long details in feature type. In on 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 is the source code. By seeing the implementation of jtslibrary, It seems difficult for storing null in geomesa Point. What are the possibilities I can go for? 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)

Upvotes: 0

Views: 204

Answers (1)

GeoJim
GeoJim

Reputation: 1355

GeoMesa is a spatial/spatio-temporal database system. As such, storing data without a geometry is not a primary use case. Many of the indices in GeoMesa assume valid longitude-latitude points.

Upvotes: 0

Related Questions