[mapserver-users] Geographic query with postgis

jrom jga at scot.cnes.fr
Tue Oct 16 04:36:20 EDT 2001


Hi,

I'm using mapserver with postgis data.
It's working wonderfully! But i've a problem with more
complex geographic query. For example, i want to get
all the houses within a distance of 500 m from roads.
A sql query would be:
 
	SELECT house.geo_value, road.geo_value
	FROM house, road
	WHERE Distance(house.geo_value, road.geo_value) < 500

It works in an sql console without problem.
So i try to do the same in the mapfile.

	DATA "house.geo_value, road.geo_value FROM house, road"
	FILTER "Distance(house.geo_value, road.geo_value) < 500"

This time it doesn't work and mapserver returns an error:
	msPOSTGISLayerWhichShapes(): Query error. Error parsing
	POSTGIS data variable. Must contain 'geometry_column FROM
table_name'.

It seems that you canno't access more than one table or column in the
DATA field of the mapfile.

Any clue for this problem?

Thanks in advance

jrom
 



More information about the mapserver-users mailing list