[mapserver-users] WMS raster display, getfeatureinfo from vectorlayer

percy percyd at pdx.edu
Tue Jul 15 19:07:10 EDT 2008


status: RESOLVED
I spent a little while trying to get a mapscript wrapper to work...
Getcapabilities and getfeatureinfo worked fine, but never got an image out.

We ended up solving the problem this way:
Created two mapfiles called GMNA_OWS_display.map and GMNA_OWS query.map

One identically named layer in each file, Geologic_Map_of North_America

Display mapfile has layer set to RASTER, with a template set to 
null.html so that the layer advertises itself as queryable.

Query mapfile has layer set to polygon and points to the vector data, 
and has all of the template parameters set appropriately.

With HTACCESS turned on for that folder, a mod_rewrite section in the 
.htaccess file looks for the getfeatureinfo string and the mapfile named 
display and substitutes the query mapfile, actual code below:
-----------htaccess file------
RewriteEngine on
RewriteCond   %{QUERY_STRING} 
^[A-z0-9,.%/-?&=]+GetFeatureInfo[A-z0-9,.%/-?&=]+

RewriteCond   %{QUERY_STRING}  ^(.*)GMNA_OWS_display(.*)

RewriteRule   ^.*mapserv.cgi.*$ 
/cgi-bin/mapserv.cgi?%1GMNA_OWS_query%2    [L]
---------end of htaccess----------

I hope this helps someone else for future reference, and thanks for the 
help,
Percy



Kralidis,Tom [Burlington] wrote:
> You could use a mapscript WxS wrapper to, when receiving a GetFeatureInfo request, replace the LAYERS/QUERY_LAYERS parameters with the vector layer.
> 
> ..Tom
> 
> 
> -----Original Message-----
> From: mapserver-users-bounces at lists.osgeo.org on behalf of percy
> Sent: Fri 11-Jul-08 10:38
> To: mapserver
> Cc: Steve Lime
> Subject: Re: [mapserver-users] WMS raster display,getfeatureinfo from	vectorlayer
>  
> I'm starting to think that just handling this with a mapscript wrapper 
> script might be the easiest approach. Any thoughts?
> Thanks,
> Percy
> 
> percy wrote:
>> thanks, nice idea. I tried it, and that did not work...
>>
>> relevant mapfile section:
>>
>> LAYER
>>     NAME "Geologic_Map_Of_North_America"
>>     TYPE RASTER
>>     STATUS ON
>>     data "/vol/www/ngmdb/htdocs/GMNA_INDEX_tiled.tif"
>>     maxscale 10000000
>>     MINSCALE 500000
>> Metadata
>> "WMS_TITLE" "Geologic Map Of North America"
>> "WMS_SRS" "epsg:4326"
>> END # metadata
>> END #layer
>> LAYER
>>     NAME "Geologic_Map_Of_North_America"
>>     TYPE query
>>     STATUS On
>>     data GMNA_S_OneGeo
>>     TOLERANCE 0
>>     TOLERANCEUNITS pixels
>>     TRANSFORM TRUE
>>     DUMP TRUE
>>     HEADER "templates/GMNA_query_header.html"
>>     TEMPLATE "templates/GMNA_query_body.html"
>>     FOOTER "templates/GMNA_query_footer.html"
>> Metadata
>> "WMS_TITLE" "Geologic Map Of North America"
>> "WMS_SRS" "epsg:4326"
>> GML_INCLUDE_ITEMS 
>> "DisplayNam,OneGeology,Lithologic,GeologicAg,AgeMin,AgeMax,AgeMetadat"
>> WMS_INCLUDE_ITEMS 
>> "DisplayNam,OneGeology,Lithologic,GeologicAg,AgeMin,AgeMax,AgeMetadat"
>> END # metadata
>> END #layer
>>
>>
>> Steve Lime wrote:
>>> What about using GROUPs or layers with the same name where the second 
>>> layer
>>> is TYPE QUERY?
>>>
>>> Steve
>>>
>>>>>> On 7/10/2008 at 2:14 PM, in message <48765F96.20209 at pdx.edu>, percy
>>> <percyd at pdx.edu> wrote:
>>>> I discussed this issue with Tom K. on the IRC yesterday, and he 
>>>> thought it was of general interest and should be posted and 
>>>> potentially requested as a feature.
>>>>
>>>> Scenario: we have a Geologic map that has super complex cartography 
>>>> that we don't want to reproduce in the mapfile (600+ classes, tons 
>>>> of patterns, etc). So we dumped out a raster of it to serve as WMS.
>>>>
>>>> However, when the user does a GetFeatureInfo on this WMS, we want to 
>>>> return attribute data from the original shapefile.
>>>>
>>>> I can envision this being taken care of at the layer level as a 
>>>> metadata tag like "WMS_query_redirect".
>>>>
>>>> In the short term we're working on a little apache mod_rewrite magic 
>>>> to take care of it :-)
>>>>
>>>> Cheers,
>>>> Percy
>>>
> 

-- 
David Percy
Geospatial Data Manager
Geology Department
Portland State University
http://gisgeek.pdx.edu
503-725-3373


More information about the mapserver-users mailing list