[postgis-users] improving within()

Fred Lehodey lehodey at gmail.com
Mon Jun 29 09:16:21 PDT 2009


Hi Marco,
ST_DWithin(geometry, geometry, float)

Returns true if geometries are within the specified distance of one another.
Uses indexes if available.

HTH,
Fred




On Mon, Jun 29, 2009 at 4:46 PM, Marco Lechner - FOSSGIS e.V. <
marco.lechner at fossgis.de> wrote:

> hi list,
>
> we are using within(geometry, geometry) to test if some (~1200) points
> are within a polygon. the polygon is defined as buffer(linegeometry,
> dist). the problem is, that the line is always the same and therefore
> the result of buffer(linegeometry, dist)  is always the same. while
> iterating through the points the within() calculates the
> buffer(linegeometry) each time again. the function takes 40s. instead of
> 0.04s if i calculate the buffergeometry first and use it as "fixed
> geometry" at within() - is this somehow improvable (within() recognizing
> such a behaviour?, ...)?
>
> Marco
> _______________________________________________
> postgis-users mailing list
> postgis-users at postgis.refractions.net
> http://postgis.refractions.net/mailman/listinfo/postgis-users
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.osgeo.org/pipermail/postgis-users/attachments/20090629/922b5351/attachment.html>


More information about the postgis-users mailing list