[Mapserver-users] getFeatureInfo on dynamic layer -emptyexception
Frieso ter Haseborg
ter-haseborg at sf-datentechnik.de
Tue Nov 4 03:14:41 PST 2003
Hi Debbie,
yes, I get an image of my dynamic layers. It works for one and for
multiple layers and also in combination with static data from vector- or
raster-files.
>[...]I need to add some parameters
>to the connection string.
In my setup it works without parameters like
"?version=1.1.0&request=Getmap&layers=...&format=..." since MS add's
them automatically when performing a WMS-request like
http://latlong24.gis.agr.gc.ca/cgi-bin/mapserv_40?map=/usr/www/httpd/htd
ocs/mapdata/itis/test.map&Layers=taxa&mode=map
In the connection-parm I've just the path to the php, actually there
will be added some parameters like 'uid' and 'pwd' for security
purposes, but no wms-parms since this are passed automatically.
btw: This should work for you too, AFAIK this is standard MS behaviour,
I didn't add any special features to achieve this.
In my understanding MS should call my php with the request passed behind
the mapfile-parm, so when calling
http://my.ip/cgi-bin/mapserv.exe?map=../htdocs/kmvims/test.map&version=1
.1.0&request=GetMap
I want MS to call my php like this:
http://my.ip/kmvims/test4.php?version=1.1.0&request=GetMap. This part
works!
When calling
http://my.ip/cgi-bin/mapserv.exe?map=../htdocs/kmvims/test.map&version=1
.1.0&request=GetFeatureInfo&query_layers=wms&x=251&y=329&INFO_FORMAT=tex
t/plain
I want MS to call my php like this:
http://my.ip/kmvims/test4.php?version=1.1.0&request=GetFeatureInfo&query
_layers=wms&x=251&y=329&INFO_FORMAT=text/plain
So I could do the getFeatureInfo-processing in my php and just return a
plain text, html or whatever MS needs to process. But MS refuses to call
the php at all on doing a getFeatureInfo-req.
I'm not sure if I understand the query-interface part, I thought in a
wms-implementation each layer would return the results in a certain
format and MS would combine them. Is there any documentation about a
query-interface I overlooked?
>Are you able to send a getfeatureinfo request directly to your script
>http://my.ip/kmvims/test4.php
>as in
>http://my.ip/kmvims/test4.php?version=1.1.0&request=getfeaturei
>nfo&query_layers=wms&x=251&y=329&INFO_FORMAT=text/plain??
Yes this works, on a call like this I get a "test" as a result of my
"echo 'test'" coded for the "getFeatureInfo"-part.
TIA,
Frieso
>-----Original Message-----
>From: Debbie Pagurek [mailto:pagurekd at agr.gc.ca]
>Sent: Monday, November 03, 2003 5:46 PM
>To: Frieso ter Haseborg
>Cc: mapserver-users at lists.gis.umn.edu
>Subject: RE: [Mapserver-users] getFeatureInfo on dynamic layer
>-emptyexception
>
>
>Aside from trying to do a getfeatureinfo request - are you able to even
>just see the image of your dynamic layer when you set up your dynamic
>layer within a mapfile like this?
>
>I am asking because in order for me to see my dynamic layer of points
>via a wms request from within a mapfile, I need to add some parameters
>to the connection string. Here's what my LAYER looks like in
>my mapfile
>
>
>( by the way I haven't tested getfeatureinfo - I don't really
>understand this part yet because it looks to me like you would need an
>interface with a query tool on it and it is Mapserver that then forms a
>query request and it would need to know how to generate a
>getfeatureinfo
>request?)
>
>Here is my LAYER and I can see the image of my dynamic layer points:
>LAYER
> NAME "taxa"
> TYPE RASTER
> STATUS ON
> TEMPLATE VOID
> CONNECTION
>"http://myhost/mapdata/itis/testscript.php?version=1.1.0&reques
>t=Getmap&layers=Cyanocitta%20cristata&format=image/png"
> CONNECTIONTYPE WMS
> PROJECTION
> "init=epsg:4326"
> END
> METADATA
> "wms_title" "test"
> "wms_srs" "EPSG:4326"
> "wms_abstract" "itis wms layer"
> "wms_extent" "-180 -90 180 90"
> "wms_opaque" "1"
> "wms_onlineresource"
>"http://latlong24.gis.agr.gc.ca/mapdata/itis/testscript.php?ver
>sion=1.1.0&request=Getmap&layers=Cyanocitta%20cristata"
> "wms_server_version" "1.1.0"
> "wms_name" "test"
> END
>END
>
>I can then see the dynamic layer in the browser when I send the URL:
>http://latlong24.gis.agr.gc.ca/cgi-bin/mapserv_40?map=/usr/www/
httpd/htdocs/mapdata/itis/test.map&Layers=taxa&mo>de=map
>
>this is different from what you are trying to do with your URL, which
>is trying sending a WMS getfeatureinfo request to your dynamic
>layer via
>a wms layer included in a mapfile.
>Are you able to send a getfeatureinfo request directly to your script
>http://my.ip/kmvims/test4.php
>as in
>http://my.ip/kmvims/test4.php?version=1.1.0&request=getfeaturei
>nfo&query_layers=wms&x=251&y=329&INFO_FORMAT=text/plain??
>
>Debbie
>
>
>
>>>> "Frieso ter Haseborg" <ter-haseborg at sf-datentechnik.de> 11/03/03
>11:23AM >>>
>Hi Debbie,
>
>thanks for your response.
>
>>[...]
>>I wonder if you have a problem because you have named your layer
>>"wms" and maybe this is a reserved word. Try naming your layer
>>something else?
>Looks like the layer-name is not cause of the problem, with a more
>qualified term or simply any other "non-reserved-word"-name it doesn't
>work either.
>
>>[...]
>>another thing I see is that you are requesting a WMS layer, but you
>>have specified TYPE POLYGON in your mapfile Layer section.
>>It should be TYPE RASTER.
>Whoops! Sorry, these are remains of my desperate trials to isolate the
>problem. I had the idea that perhaps getFeatureInfo-requests would
>only
>be executed on non-raster layers. But there's no difference in this
>special problem when changing the layer-type: in both cases the php
>simply isn't called at all.
>
>TIA,
>Frieso
>
More information about the MapServer-users
mailing list