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)
} `