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,

I am not able to reproduce this... I ingested ~3M records into a local hbase cluster and used the command line tools to export using a polygon based on a buffered point, plus a during clause. My export consistently returns the same number of features (~600k).

Have you checked all the hbase region servers for errors, as well as your local logs? One thing to try is a bbox query with 'loose bounding box' disabled - this will set up a filter in hbase equivalent to the polygon query. If that is also failing, then likely your region servers are not handling the request filters correctly for whatever reason.

https://www.geomesa.org/documentation/user/datastores/query_config.html#loose-bounding-box

Thanks,

Emilio

On 12/5/18 8:31 PM, 张福高 wrote:

Hi GeoMesa Devs,

Thanks for your answer. Data was ingested by 2.1.0 and the coprocessor was configured correctly, The amount features comming back should be  150000 but the returned one on 2.1.0 is between 15000+ and 40000+ from run to run.  It is worthy to note that by the simple spatial query like BOX(...), the result is consistent . However, with polygon query like circle, the query result is various. 
` ...
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