[postgis-users] quickly select a small piece of a large polygon

Stefan Zweig stefanzweig1881 at web.de
Thu Aug 30 08:20:23 PDT 2007


hi list,

i have some very large polygons, e.g. border of russia and border of usa. 
if i run a 

select the_geom 
from states 
where the_geom && SetSRID(MakeBox2D(SetSRID(MakePoint(47.994358,49.70676),4326),SetSRID(MakePoint(56.45114,53.249866),4326)),4326)

which is the bounding box of only a small part of russia, postgis selects the whole russia shape (because bbox of russia and map bbox overlap) which slows down the select. much more points are read (whole russian border) than actually needed (only the small piece of the border which is within) for the bounding box of my map. as we run a map application where users are allowed to live pan within a map i need to speed up this part of the task.

i tried to use the intersect operator in such a manner: intersect the russian border with my bounding box, but recognized that the intersection itself is too slow compared with selecting the whole shape.

so does anybody have a better idea how to speed up this task


i appreciate any help. thanks in advance,

stefan
_____________________________________________________________________
Der WEB.DE SmartSurfer hilft bis zu 70% Ihrer Onlinekosten zu sparen!
http://smartsurfer.web.de/?mc=100071&distributionid=000000000066




More information about the postgis-users mailing list