[Mapserver-users] getFeatureInfo on dynamic layer -emptyexception
Daniel Morissette
morissette at dmsolutions.ca
Wed Nov 5 07:24:27 PST 2003
Frieso ter Haseborg wrote:
> Hi Daniel,
>
> thanx a lot for the explanation of this MS-behaviour. So MS doesn't
> cascade getFeatureInfo-requests. That brings me to another question: How
> do I build a _cascading_ wms-server-architecture capable of
> getFeatureInfo-requests?
>
The right way to do that would be to use WFS GetFeature requests instead
of GetFeatureInfo, but this is still fairly new territory and some parts
are still under development in MapServer 4.1.
Anyway, the idea is that you would configure your server as both a WMS
and a WFS. Then issue a DescribeLayer request to your WMS which would
return you a reference to a WFS layer. Then your client builds a
GetFeature request for the WFS layer which could possibly be cascaded
through multiple WFS servers.
> I'm not sure if I understood the handling of the
> getWMSFeatureInfoURL()-method correctly, but I think this only helps me
> on the client-side. What do I do with another WMS-server, which tries to
> access the dynamic layers on a remote mapserver created by my
> php-component?
>
Perhaps you need to rethink your servers architecture to connect to the
servers directly instead of cascading. Using MapServer as a WMS client
is OK, but doing multiple levels of cascading is not a good idea since
it slows things down and increses the chances of problems.
> So far, I didn't manage to get a working sample of a
> getWMSFeatureInfoURL, so excuse my perhaps premature disbelief: What
> would be the result of the getWMSFeatureInfoURL()-method? Wouldn't that
> be an URL, where again a getFeatureInfo-request is launched against my
> dynamic layer?
getWMSFeatureInfoURL() operates only on WMS layers (i.e. CONNECTIONTYPE
WMS) and will produce a GetFeatureInfo url that you can use to connect
to this server.
Say you have the following mapfile in your PHP MapScript client app:
LAYER
NAME prov_bound
TYPE RASTER
STATUS ON
CONNECTIONTYPE WMS
CONNECTION
"http://remote.wms.addr/cgi-bin/mswms_gmap?VERSION=1.0.0&FORMAT=image/png&LAYERS=prov_bound&QUERY_LAYERS=prov_boounds&TRANSPARENT=true"
PROJECTION
"init=epsg:42304"
END
END
Then calling getWMSFeatureInfoURL() will return something like:
http://remote.wms.addr/cgi-bin/mswms_gmap?VERSION=1.0.0&FORMAT=image/png&LAYERS=prov_bound&TRANSPARENT=true&REQUEST=GetFeatureInfo&SRS=...&BBOX=...&INFO_FORMAT=...&X=...&Y=...
It's hard to explain in a few lines, but hopefully you get the idea.
Daniel
--
------------------------------------------------------------
Daniel Morissette morissette at dmsolutions.ca
DM Solutions Group http://www.dmsolutions.ca/
------------------------------------------------------------
More information about the MapServer-users
mailing list