Hi All, I was using the legacy operator && for determining if a point was inside a particular geometry as thus:
SELECT road_network, toponymy FROM maps AS m WHERE m.b_box &&
geomfromtext('POINT($lon $lat)',4326)
When I was faced with two geometries such as Portugal and Spain country
boundaries I began always getting the row for Spain when I was trying to
get the map of Portugal for a point inside it.
It led me to the conclusion that the && operates as a bounding box for
the corresponding geometry where, in this particular case, the bounding
box of Spain *overlaps* the one of Portugal.
So I was forced to update the query to this:
SELECT road_network, toponymy FROM maps AS m WHERE
st_within(geomfromtext('POINT($lon $lat)',4326), m.b_box)
It works but with a catch: it takes ~200ms where the && took
~25ms ... :-(
Before you ask: yes, I've created the correspondent indices using gist.
Is there any way I can work around this or optimize it?
P.S. I'm using PostgreSQL 8.2.9 on x86_64, PostGIS 1.3.3, geos 2.2.3,
proj 4.5.0
Thank you in advance for any insight on the matter.
Regards,
--
Pedro Doria Meunier <[EMAIL PROTECTED]>
signature.asc
Description: This is a digitally signed message part
_______________________________________________ postgis-users mailing list [email protected] http://postgis.refractions.net/mailman/listinfo/postgis-users
