[postgis-users] Help with query

mark balman mark.balman at gmail.com
Wed Dec 10 11:04:51 PST 2008


Hi All

I have managed to resolve the query with the following suggestion - thanks
to Rob Burgholzer's suggestion to use UNION

Keeping this simple, I kept the following Layer for selecting the polygon
features within the specified distances defined in the class expressions

DATA "the_geom FROM (SELECT intname,the_geom, gid, distance(the_geom,
geometryfromtext('POINT(' || (%mapx%) || ' ' || (%mapy%) || ')',4326)) AS
dist from kbapoly) as myquery using SRID=4326 using unique gid"

In my map I have used Robert's suggestion in a new LAYER called buffers:

DATA "the_geom from (  (SELECT buffer(geometryfromtext('POINT(' || (%mapx%)
|| ' ' || (%mapy%) || ')',4326), 1) AS the_geom, (gid::float8 + 0.1) as gid
FROM kbapoly) UNION (SELECT buffer(geometryfromtext('POINT(' || (%mapx%) ||
' ' || (%mapy%) || ')',4326), 2) AS the_geom, (gid::float8 + 0.2) as gid
 FROM kbapoly) UNION (SELECT buffer(geometryfromtext('POINT(' || (%mapx%) ||
' ' || (%mapy%) || ')',4326), 3) AS the_geom, (gid::float8 + 0.3) as gid
FROM kbapoly) ) as myquery using srid=4326 using unique gid"

Now I can click on my map and select all features which fall within the
specified distances and displayed within concentric rings. Result, one happy
chappy

Many thanks

Mark
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.osgeo.org/pipermail/postgis-users/attachments/20081210/b3f999dd/attachment.html>


More information about the postgis-users mailing list