Depending on your need - and since you are only testing against a point 
there are lots faster ways to accomplish this.

For example you could make a bounding box query distance/2 around your 
point (you would get a few more features because
it is not a circle but it would go *much* faster. You could do the 
bounding box filter first AND the distance check for faster
performance as well.

Is your data in PostGIS? It sounds like something may of gone wrong and 
it is doing the work on the client side?
Jody
> Hi list,
> I'm trying to use a GeometryDistanceFilter in my applications, but 
> It's very very slow (about 10 seconds to give me the result).
> What I need to do is to retrieve all the features near a point.
> If I try to execute the same query directly on PostGIS, I obtain the 
> result in 200 ms.
>  
> This is the code:
>  
> *private* FilterFactory factory = 
> FilterFactoryFinder./createFilterFactory/();
> *private* GeometryFilter filter = 
> factory.createGeometryDistanceFilter(FilterType./GEOMETRY_DWITHIN/);
> Coordinate coord = *new* 
> Coordinate(pointToQuery.getX(),pointToQuery.getY());
> Point point = geometryFactory.createPoint(coord);
> Expression pointToContain = factory.createLiteralExpression(point);
> distanceFilter.addRightGeometry(pointToContain);
> distanceFilter.setDistance(distance);
> coll = source.getFeatures(distanceFilter);
>  
> I know that there is only the RightGeometry in this filter, this is 
> because if I try to set the LeftGeometry the filter don't run...
>  
> Ideas?
>  
> Thanks in advance.
> Jacopo
> ------------------------------------------------------------------------
>
> -------------------------------------------------------------------------
> This SF.net email is sponsored by: Splunk Inc.
> Still grepping through log files to find problems?  Stop.
> Now Search log events and configuration files using AJAX and a browser.
> Download your FREE copy of Splunk now >> http://get.splunk.com/
> ------------------------------------------------------------------------
>
> _______________________________________________
> Geotools-gt2-users mailing list
> [email protected]
> https://lists.sourceforge.net/lists/listinfo/geotools-gt2-users
>   


-------------------------------------------------------------------------
This SF.net email is sponsored by: Microsoft
Defy all challenges. Microsoft(R) Visual Studio 2005.
http://clk.atdmt.com/MRT/go/vse0120000070mrt/direct/01/
_______________________________________________
Geotools-gt2-users mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/geotools-gt2-users

Reply via email to