PostGIS multiple table query

david techer davidtecher at YAHOO.FR
Tue Oct 25 11:21:21 EDT 2005


If U try without giving 'users':

DATA "location from (select cars.location, cars.date from
cars where cars.id = users.id) as myquery using unique location
using srid = -1"

Can U tell us what mapserver told u as message in "declare asbinay(....)" before error's message?

--david;
-------------------------------------------------
Jean David TECHER
e-mail: davidtecher(at)yahoo(dot)fr
site: http://techer.pascal.free.fr/postgis/
-------------------------------------------------



Edward Nuttall a écrit :

>Dear all,
>
>I am trying to get a PostGIS Layer working, the following layer works fine:
>
>
>      LAYER
>             NAME "my_layer"
>             TYPE POINT
>             STATUS ON
>             CONNECTIONTYPE POSTGIS
>             CONNECTION "dbname=my_db user=me host=localhost port=5432"
>
>             DATA "location from (select cars.location, cars.date from
>cars) as myquery using unique location using srid = -1"
>
>              TEMPLATE "/home/qgis/mariss/image_info.html"
>
>              CLASS
>                     NAME "My Layer"
>                     OUTLINECOLOR 0 0 0
>                     COLOR 220 220 0
>                     SIZE 7
>                     SYMBOL "circle"
>              END
>              PROJECTION
>                     "+proj=latlong"
>              END
>
>              METADATA
>                     WMS_TIMEEXTENT "2005-02-05/2009-10-01"
>                     WMS_TIMEITEM "date"
>              END
>
>     END
>
>
>However, when I extend the Query to included another table, as shown below:
>
>
>      LAYER
>             NAME "my_layer"
>             TYPE POINT
>             STATUS ON
>             CONNECTIONTYPE POSTGIS
>             CONNECTION "dbname=my_db user=me host=localhost port=5432"
>
>             DATA "location from (select cars.location, cars.date from
>cars, users where cars.id = users.id) as myquery using unique location
>using srid = -1"
>
>             TEMPLATE "/home/qgis/mariss/image_info.html"
>
>             CLASS
>                     NAME "My Layer"
>                     OUTLINECOLOR 0 0 0
>                     COLOR 220 220 0
>                     SIZE 7
>                     SYMBOL "circle"
>             END
>
>             PROJECTION
>                     "+proj=latlong"
>             END
>
>             METADATA
>                     WMS_TIMEEXTENT "2005-02-05/2009-10-01"
>                     WMS_TIMEITEM "date"
>             END
>
>     END
>
>
>
>I get the following error:
>
>"Postgresql reports the error as 'ERROR: find_srid() - couldnt find the
>corresponding SRID - is the geometry registered in the GEOMETRY_COLUMNS
>table?"
>
>All geometry columns in all the tables are 'working' as layers in the
>mapfile and have been registered in the GEOMETRY_COLUMNS table, also the
>select query does return a result set. I can see there is some SRID error,
>and this is where I get confused, when I've added my geometry columns I
>have always used -1, indeed anywhere SRID pops up I have just used -1.
>
>Any help would be much appreciated,
>
>Thanks
>Ed
>
>  
>

	

	
		
___________________________________________________________________________ 
Appel audio GRATUIT partout dans le monde avec le nouveau Yahoo! Messenger 
Téléchargez cette version sur http://fr.messenger.yahoo.com



More information about the mapserver-users mailing list