[postgis-users] PostGIS - server side optimization

Markus Schaber schabios at logi-track.com
Mon Jan 10 06:40:00 PST 2005


Hi, Jordi,

On Wed, 05 Jan 2005 09:32:13 -0800
Paul Ramsey <pramsey at refractions.net> wrote:

> Ralph is correct, this is a data organization problem.
> If you want a fast hack though, you could try this.
> Create an "area" attribute (or "length") and populate it with an update. 
> Then use:
> 
> select primary_key, AsText(geom) AS geometry
> FROM yourtable
> WHERE geom && GeometryFromText('yourbox')
> ORDER BY area
> LIMIT 200

Alternatively, you could calculate a threshold (e. G. 2 square pixels in
current projection are 4242 area units) and use something like

select primary_key, AsText(geom) AS geometry
FROM yourtable
WHERE geom && GeometryFromText('yourbox')
AND area > 4242
LIMIT 200

HTH,
Markus
-- 
markus schaber | dipl. informatiker
logi-track ag | rennweg 14-16 | ch 8001 zürich
phone +41-43-888 62 52 | fax +41-43-888 62 53
mailto:schabios at logi-track.com | www.logi-track.com



More information about the postgis-users mailing list