[mapserver-users] WMS non-square extent query using openlayers

Frank Warmerdam warmerdam at pobox.com
Wed Jan 25 19:11:37 EST 2012


On Wed, Jan 25, 2012 at 3:34 PM, David Quinn <daithiquinn at gmail.com> wrote:
> Just to clarify - so non-square results should be returned without doing
> anything special on the mapserver side?

David,

That is my understanding in WMS mode.

>>
>>
>> But if I were you, I'd start by examining that WMS request is actually
>> being generated and sent to MapServer by OpenLayers and determine
>> if it is doing what it ought to.
>
>
> This is an example of the html that is returned on screen:
>
> <img id="OpenLayersDiv119" style="width: 256px; height: 256px; position:
> relative; opacity: 0.5;" class="olTileImage"
> src="http://mysite.com/mapserv.cgi?map=roads.map&amp;LAYERS=roads&amp;TRANSPARENT=TRUE&amp;SERVICE=WMS&amp;VERSION=1.1.1&amp;REQUEST=GetMap&amp;STYLES=&amp;FORMAT=image%2Fpng&amp;SRS=EPSG%3A900913&amp;BBOX=-8234561,4996137,-8214993,5015705&amp;WIDTH=256&amp;HEIGHT=256">
>
> In this case, I set SIZE 64 64 in my mapfile, but it did not make a
> difference, as 256 seems to be used. The polygon bounds calculated in
> browser using openlayers are as follows: -8254128,4976569,-8215574,4996932
>
> I can now see that the problem is due to the entire tile being included, and
> not clipped to the upper extent. But this is strange, as the verticals are
> being clipped ok, as is the lower extent.

I see that the request getting sent to MapServer is 256x256 and
for a BBOX that is 19568m by 19568m so it seems the problem
is with client side request composition.

Note that the SIZE keyword in your map file has no effect
on anything when using WMS requests.  I believe it is the
default image size when using non-WMS map=mode requests
to MapServer without an explicit size in the request.

Best regards,
-- 
---------------------------------------+--------------------------------------
I set the clouds in motion - turn up   | Frank Warmerdam, warmerdam at pobox.com
light and sound - activate the windows | http://pobox.com/~warmerdam
and watch the world go round - Rush    | Geospatial Software Developer


More information about the mapserver-users mailing list