[postgis-users] Improving Performance

Tyler Mitchell TMitchell at lignum.com
Thu Feb 19 16:46:49 PST 2004


> SELECT * FROM <points table>
> WHERE the_geom && <polygon>
>        AND PointInPolygon(prepareForPIP(<polygon>), the_geom);
> 
> Basically, you need to write two functions:
> 
> 1. something that takes a postgis (or WKB) polygon and returns
>     a structure thats makes it very easy to do Point-In-Polygon tests.
>     Typically this builds a spatial index on the vertex-to-vertex edges
>     that makes up the polygon.  The hard part is that the structure has
>     to be in its 'serializable' form [This means (1) dont use true
>     pointers - you have to use offsets and (2) the structure has to be
>     continuous in memory].

I don't understand all of your caveats here, but I assume 
PointInPolygon(box2d(<polygon>), the_geom doesn't cut it.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.osgeo.org/pipermail/postgis-users/attachments/20040219/980cede5/attachment.html>


More information about the postgis-users mailing list