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

David Quinn daithiquinn at gmail.com
Thu Jan 26 11:22:46 PST 2012


I emailed prematurely - I thought the problem was solved with this tweak,
but it is not. I think that it is an Openlayers problem rather than a
Mapserver one. I'll ask my question on the Openlayers list instead.

-David

On Thu, Jan 26, 2012 at 11:48 AM, David Quinn <daithiquinn at gmail.com> wrote:

> Just to follow up with the resolution of this problem, even though it
> seems to be more on the OpenLayers side. I noticed that I was getting the
> following error message in Firebug: "NetworkError: 404 Not Found -
> http://mysite.com/js_libraries/img/blank.gif"
>
> My openlayers javascript is stored in the 'js_libraries' folder. I added
> a folder 'img' with 'blank.gif', and my problem disappeared. Now, only the
> queried area is displayed onscreen (but I realize that openlayers is
> sending a larger query, and replacing the results from Mapserver with a
> blank gif).
>
> David
>
>
>
> On Wed, Jan 25, 2012 at 7:11 PM, Frank Warmerdam <warmerdam at pobox.com>wrote:
>
>> 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&LAYERS=roads&TRANSPARENT=TRUE&SERVICE=WMS&VERSION=1.1.1&REQUEST=GetMap&STYLES=&FORMAT=image%2Fpng&SRS=EPSG%3A900913&BBOX=-8234561,4996137,-8214993,5015705&WIDTH=256&HEIGHT=256<http://mysite.com/mapserv.cgi?map=roads.map&LAYERS=roads&TRANSPARENT=TRUE&SERVICE=WMS&VERSION=1.1.1&REQUEST=GetMap&STYLES=&FORMAT=image%2Fpng&SRS=EPSG%3A900913&BBOX=-8234561,4996137,-8214993,5015705&WIDTH=256&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
>>
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.osgeo.org/pipermail/mapserver-users/attachments/20120126/9fe0f4d3/attachment.htm>


More information about the MapServer-users mailing list