Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
Re: [geomesa-dev] Query result is unstable on geomesa_2.11-2.1.0 against geomesa2.11-2.0.2

Hello,

Was the data ingested using 2.0.2, and now you are querying it with 2.1.0? If so, did you update the coprocessor jar configuration in your hbase tables to point to the geomesa-2.1.0 jar? Have you checked your hbase logs for errors?

If everything is configured correctly and you don't see any errors, then it should be consistent from run to run. How many feature are coming back, and by how much does the count differ? How long is the query taking to run?

Thanks,

Emilio

On 12/5/18 5:51 AM, 张福高 wrote:

Hi GeoMesa Devs,

I am encountering issue when trying to query by using geomesa-hbase on geomesa_2.11-2.1.0. Previously, I took geomesa2.11-2.0.2 to make the following query, the returned result is stable and unique. In order to utilize new characteristics of geomesa_2.11-2.1.0 like precision indexing and hbase partition, I turned to it but found that based on the same hbase catalog and the same fiter and query, every time the result is unstable and different. It seems that the input is constant but result is various, which makes me confused.
Relevant code is following:
` ...
val typeName = "..."
val ds = DataStoreFinder.getDataStore(params).asInstanceOf[HBaseDataStore]
val ff:FilterFactory2 = CommonFactoryFinder.getFilterFactory2
val calc = new GeodeticCalculator()
val geoFac = new GeometryFactory

def metersToDegrees(meters: Double, point: Point):Double = {

calc.setStartingGeographicPoint(point.getX, point.getY);
calc.setDirection(0,meters)
val dest2D = calc.getDestinationGeographicPoint
val destPoint = geoFac.creatPoint(new Coordinate(dest2D.getX, dest2D.getY))
point.distance(destPoint)

}

def bufferGeo(geom: Geometry, meters: Double): Geometry = {

   geom.buffer(metersToDegrees(meters, geom.getCentoid))    

}
def testSpatialQuery(): Unit ={

val source = ds.getFeatureSource(typeName)
val geomProperty = ff.property(source.getSchema.getGeometryDescriptor.getName)
val geomtryFactory = JTSFactoryFinder.getGeometryFactory
val coord = new Coorinate(120.496, 32.512)
val point = geomtryFactory.createPoint(coord)
val geometry = bufferGeo(point, 1000)
val geomFilter = ff.intersects(geomProperty, ff.literal(geometry))
val combineFilter = ff.and(geomFilter, ECQL.toFilter("occurtime during 2018-02-12T00:10:00.000Z/2018-02-12T23:59:00.000Z"))
val featureCollection = source.getFeatures(combineFilter)
val iterator = featureCollection.features()
var count = 0
while (iterator.hasNext){
    val sf = iterator.next()
    count = count + 1
}
println("Total count " + count)

} `



 



 



 



 



 


_______________________________________________
geomesa-dev mailing list
geomesa-dev@xxxxxxxxxxxxxxxx
To change your delivery options, retrieve your password, or unsubscribe from this list, visit
https://dev.locationtech.org/mailman/listinfo/geomesa-dev


Back to the top