[mapserver-users] ScaleHint

Daniel Morissette morissette at dmsolutions.ca
Wed Jul 18 09:15:56 EDT 2001


Paul Ramsey wrote:
> 
> I have started exploring the WMS capability somewhat... I was wondering
> why the WMS does not provide a ScaleHint for layers which have
> explicitly defined min and max scales? 

Probably just an omission... I'll try to check that.

> What will the MapServer WMS do if
> a client does  GetMap on a layer using an extent which violates the
> maxscale? 

The layer just won't show up.

> I am thinking in terms of writing a client which knows nothing
> about the WMS except there is a service there: in order to properly
> request scale-restricted layers, the ScaleHint is vital. Otherwise the
> client could request every contour in the province, when in fact
> contours should only be requested at a close-in zoom level.
> Thanks for the info,
> Paul
> 
> PS - Doesn't requiring the 'map' parameter violate the WMS spec? (I
> recognize the difficulty, however -- what is a service description
> absent a map file? Perhaps a simple wrapper example could be bundled.)

2-parts answer:

1- No it does not violate the spec... at first sight it seems like it
would, but there was a discussion this recently on one of the WMT
mailing list that made me realize that the following is a valid
onlineResource URL and does not violate the spec:

     http://my.host.com/cgi-bin/mapserv?map=/path/to/demo.map&

Basically the rule is that the OnlineResource URL has to contain a
trailing "?" or "&" so that the client is ready to append parameters to
it.  It is also recommended that clients check for the presence of the
trailing "?" or "&" and try to be smart and add one in case it is
omitted since several servers (including the first ones we did setup)
tend to not include it even though it is required.

2- However, I prefer not pushing my luck, so I usually setup a wrapper
shell script that sets the MS_MAPFILE environment variable and then
passes control to the mapserv executable... that results on a cleaner
OnlineResource URL.

   #! /bin/sh
   MS_MAPFILE=/path/to/demo.map
   export MS_MAPFILE
   /path/to/mapserv

I'll have this included in the WMS HOWTO as well.

BTW, for those interested in discussing WMS issues, a public mailing
list has been started recently and lots of interesting stuff is
discussed there:
  http://www.intl-interfaces.net/mailman/listinfo/wms-dev
-- 
------------------------------------------------------------
 Daniel Morissette               morissette at dmsolutions.ca
 DM Solutions Group              http://www.dmsolutions.ca/
------------------------------------------------------------
  Don't put for tomorrow what you can do today, because if 
      you enjoy it today you can do it again tomorrow.



More information about the mapserver-users mailing list