mark balman | 7 Oct 11:16

dynamic sql

Hi All

I am trying to create a dynamic sql query that a user can enter latitude
and longitude coordinates together with a specified distance. So far I
have created the following query (not sure if correct but it does work
and have also tried st_distance query)

select * from azev2_1 where distance_spheroid(GeomFromText('Point(-70
20)',4326),the_geom,'SPHEROID["WGS 84",6378137,298.257223563]') <
250000;

What I am trying to achieve is to get this to work using the Mapserver
Demo application (basic version) as a starting point (running under
MS4W. So far this
following Layer definition works:

LAYER
 CONNECTIONTYPE postgis
 NAME "test"
 CONNECTION "user=mark password=mark dbname=ibat_proto host=localhost"
 DATA "the_geom FROM (select * from kbapoly where
st_distance(the_geom,GeomFromText('Point(1 0)',4326)) <6) AS myquery
using unique gid"
 STATUS OFF
 TYPE POLYGON
 TEMPLATE "templates/azes.html"
 CLASS
 OUTLINECOLOR 0 0 0
 COLOR  128 128 128
 END
(Continue reading)


Gmane