[mapserver-users] Geographic query with postgis
Paul Ramsey
pramsey at refractions.net
Tue Oct 16 09:59:58 PDT 2001
The problem seems to be that you are doing a join as part of your query.
You might be able to
hide this by creating a VIEW of your joined data, and have mapserver
query the view in the ordinary way. Be forwarned, this kind of spatial
join will not be optimized by the spatial index, so the performance will
degrade quite fast as the amount of data goes up.
BTW, no, you cannot access more than one geometry column at a time. In
any event, mapserver can only render one geometry type per layer (point
layer, line layer, polygon layer), so rendering roads in the same layer
as house points would not work so well.
jrom wrote:
>
> 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
>
--
__
/
| Paul Ramsey
| Refractions Research
| Email: pramsey at refractions.net
| Phone: (250) 885-0632
\_
More information about the MapServer-users
mailing list