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

Paul Ramsey pramsey at refractions.net
Thu Aug 30 12:41:37 PDT 2007


Cut the polygon up into smaller polygons, by laying a regular grid on  
top of it. Make a new polygon table (for the fill) and an edges table  
(for the boundary).

P

On 30-Aug-07, at 8:20 AM, Stefan Zweig wrote:

> 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
>
> _______________________________________________
> postgis-users mailing list
> postgis-users at postgis.refractions.net
> http://postgis.refractions.net/mailman/listinfo/postgis-users




More information about the postgis-users mailing list