[Mapserver-users] multiple request in one layer

Vincent Schut schut at sarvision.com
Thu Mar 27 06:17:53 EST 2003


Thilo,

I'm afraid you can't do that this way. Not with mapserver, neither with 
standard SQL (but I'm not an expert, if I'm wrong please correct me...)
Here comes what I think...:
Your sql query selects 2 columns from two tables. That means your result will 
be a 2 column table, and the query assumes both STREETS and PATH have the 
columns S.GEOM and P.GEOM. Just try to do the same SQL SELECT as you have in 
your mapfile in Oracle, you'll see that it returns you 2 columns. Or an 
error. Mapserver wants you to result one and only one column, which should 
contain the geometry. What you need to do is: first create a (temporary?) 
table in which you insert the column s.geom (streets) and p.geom (path), both 
into the same column in your new table. Something like:
INSERT INTO new_table (geom) SELECT geom FROM streets;
INSERT INTO new_table (geom) SELECT geom FROM path;
And then you can use this new table in your mapfile:
DATA "geom FROM new_table"

It may be possible to do this more efficient and/or in one SQL statement; As I 
said I'm not an expert. But this should do the trick, imho.

Regards,
Vincent Schut.


On Thursday 27 March 2003 11:15, Schlemmer Thilo wrote:
> Hi there,
>
>
> i want to get results from 2 tables in a mapfile-layer:
>
>
> LAYER
>     CONNECTIONTYPE oraclespatial
>     CONNECTION "something/somewhere at else"
>     NAME "STREETS"
>     DATA "S.GEOM, P.GEOM from STREETS S, PATH P"
>     STATUS off
>     TYPE LINE
>     FILTER "SHAPENAME like 'noidea'"
>  CLASS
>    EXPRESSION ...
>    .
>    .
>    .
>
>    ...but i receive the following error-message:
>
>    "msOracleSpatialLayerWhichShapes(): Error parsing OracleSpatial DATA
> variable. Must contain 'geometry_column from table_name|(SELECT stmt)'"
>
>    I can't find any information about the request of multiple tables in the
> documentation (or am i blind?).
>
>    Any ideas?
>
>    Thilo
>
>
> _______________________________________________
> Mapserver-users mailing list
> Mapserver-users at lists.gis.umn.edu
> http://lists.gis.umn.edu/mailman/listinfo/mapserver-users

-- 
______________________________________
Vincent Schut (schut at sarvision.com)
Sarvision B.V.
Wageningen, The Netherlands
www.sarvision.com



More information about the mapserver-users mailing list