Skip to main content

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

We usually recommend defaulting to Null Island.

https://en.wikipedia.org/wiki/Null_Island

Basically, set the default geometry to Point(0,0).


Emilio Lahr-Vivaz <elahrvivaz@xxxxxxxx> writes:

> Hi Suresh,
>
> Currently we don't allow null geometries - this provides query
> consistency, as otherwise you may get inconsistent results depending on
> the specific index being used.
>
> Thanks,
>
> Emilio
>
> On 05/15/2017 08:42 AM, Suresh Prajapati wrote:
>> 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
>> <https://github.com/locationtech/geomesa/blob/master/geomesa-utils/src/main/scala/org/locationtech/geomesa/utils/uuid/Z3FeatureIdGenerator.scala#L93>
>> 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
>>
>>
>>
>> _______________________________________________
>> geomesa-users mailing list
>> geomesa-users@xxxxxxxxxxxxxxxx
>> To change your delivery options, retrieve your password, or unsubscribe from this list, visit
>> https://dev.locationtech.org/mailman/listinfo/geomesa-users
>
> _______________________________________________
> geomesa-users mailing list
> geomesa-users@xxxxxxxxxxxxxxxx
> To change your delivery options, retrieve your password, or unsubscribe from this list, visit
> https://dev.locationtech.org/mailman/listinfo/geomesa-users


Back to the top