[postgis-users] spatial functions in PostGIS connection

Mike Leahy mgleahy at alumni.uwaterloo.ca
Tue Mar 21 13:27:48 PST 2006


Tom,

I'm pretty sure you can put anything in the data for a PostGIS layer.
At a minimum, I think you need the geometry plus a unique identifier.
Assuming 'gid' is your unique identifier in the geometry table, you
would be able to do something like:

DATA "the_geom from (select gid, the_geom from outbreaks where
distance(wkb_geometry,'POINT(-122 45)') = 10) as foo using unique gid
using srid=-1"

So you can put pretty much any query inside the brackets aliased as
'foo', as long as it contains the geometry column specified at the start
and the unique identifier named at the end, and that the geometries use
the srid also named at the end of the data string.

Mike

Kralidis,Tom [Burlington] wrote:
> Hi,
> 
> I have a point dataset in PostGIS which I display via OGC:WMS with no
> problems:
> 
> 
>   NAME "outbreaks"
>   CONNECTIONTYPE postgis
>   CONNECTION "user=postgres dbname=devgeodb2"
>   DATA "the_geom from outbreaks"
> 
> ..is it possible to embed PostGIS functions in the LAYER/DATA statement
> like:
> 
>   NAME "outbreaks"
>   CONNECTIONTYPE postgis
>   CONNECTION "user=postgres dbname=devgeodb2"
>   DATA "the_geom from outbreaks where distance(wkb_geometry,'POINT(-122
> 45)') = 10"
> 
> I tried this and got a ServiceException.  I also tried 
> 
> Thanks
> 
> ..Tom
> _______________________________________________
> 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