[Mapserver-users] multiple request in one layer

Smith, Michael ERDC-CRREL-NH Michael.Smith@erdc.usace.army.mil
Thu, 27 Mar 2003 07:00:34 -0500


You could do it with a SQL statement like 

  DATA "GEOM from (select S.GEOM from STREETS S union all select P.GEOM from  PATH P)"


Mike Smith
email: michael.smith@erdc.usace.army.mil
RSGISC
ERDC - CRREL 
Hanover, NH  03755
(603) 646-4765



-----Original Message-----
From: Vincent Schut [mailto:schut@sarvision.com] 
Sent: Thursday, March 27, 2003 6:18 AM
To: Schlemmer Thilo; Mapserver-Users-Request@Lists. Gis. Umn. Edu (E-Mail)
Subject: Re: [Mapserver-users] multiple request in one layer


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@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@lists.gis.umn.edu
> http://lists.gis.umn.edu/mailman/listinfo/mapserver-users

-- 
______________________________________
Vincent Schut (schut@sarvision.com)
Sarvision B.V.
Wageningen, The Netherlands
www.sarvision.com
_______________________________________________
Mapserver-users mailing list
Mapserver-users@lists.gis.umn.edu
http://lists.gis.umn.edu/mailman/listinfo/mapserver-users
_______________________________________________
Mapserver-users mailing list
Mapserver-users@lists.gis.umn.edu
http://lists.gis.umn.edu/mailman/listinfo/mapserver-users