Comments inline... On 15 December 2015 at 13:55, Ken Roe <[email protected]> wrote:
> I am trying to understand the proper way to efficiently filter a > SpacialIndexFeatureSource. > So this implementation is wrapped around an in memory feature collection, which has the feature IDs stored in JTS spatial index. The goal is to find the set of locations that are within a radius of a > starting point. I am attempting to do this with the DWithin filter. > Not sure if it is smart enough to optimize that - normally you use a spatial index to do BBOX checks to short list content ... and then do the actual geometry on geometry tests. In this case you would want to expand your bounding box by the radius ... use a BBOX query to short list features - and then go through them and do with DWITHIN check. Can you do that as part of your initial query to SpatialIndexFeatureSource? <bbox filter> AND <dwithin filter> Unfortunately using SpatialIndexFeatureSource as shown in the tutorials > results in UnsupportedOperationException on > SpatialIndexFeatureCollection.subCollection, which looking at the source > isn’t a surprise since that method throws UnsupportedOperationException. > I am trying to kill all the subCollection methods because they were not consistently implemented by data store implementations. I liked the idea of gradually refining results, drilling into the details ... but doing a top level query proved more popular. Is there a good example of how to best find nearby locations using > GeoTools? Am I doing something wrong? > Normally you would just do your dwithin query against the feature source, and trust the implementation was smart enough to make use of the spatial index. In this case you will need to check if it is ... or do it yourself using AND.
------------------------------------------------------------------------------
_______________________________________________ GeoTools-GT2-Users mailing list [email protected] https://lists.sourceforge.net/lists/listinfo/geotools-gt2-users
