Take the 2-minute tour ×
Geographic Information Systems Stack Exchange is a question and answer site for cartographers, geographers and GIS professionals. It's 100% free, no registration required.

WMS GetMap queries take a BBOX parameter for the map and a WIDTH and HEIGHT parameter for the image.

If the aspect ratio of the image (WIDTH/HEIGHT) doesn't match the aspect ratio of the BBOX (dx/dy) does the spec say it will distort the image into that WIDTH/HEIGHT aspect or does it say it will increase the area of the map returned in the image.

The server I'm playing with is doing the latter, but I see mentions on the web of the former behaviour.

In the case of increasing the area of the map, does the spec say that either the vertical or horizontal extent of the image will match the requested BBOX (depending on if its too tall or too wide)?

I suppose the safest thing is to always call with matching aspect ratios...

Here's some test grabs with three different aspect ratio WIDTH/HEIGHT settings and the same BBOX for your comparison:

wget -O test.png "http://www.osmgb.org.uk/OSM-GB/wms?SERVICE=WMS&VERSION=1.1.1&REQUEST=GetMap&LAYERS=OSM-GB:__all__&SRS=
EPSG:27700&BBOX=532685,176236,542182,183918&FORMAT=image/png&WIDTH=400&HEIGHT=400"
wget -O test2.png "http://www.osmgb.org.uk/OSM-GB/wms?SERVICE=WMS&VERSION=1.1.1&REQUEST=GetMap&LAYERS=OSM-GB:__all__&SRS
=EPSG:27700&BBOX=532685,176236,542182,183918&FORMAT=image/png&WIDTH=400&HEIGHT=800"
wget -O test3.png "http://www.osmgb.org.uk/OSM-GB/wms?SERVICE=WMS&VERSION=1.1.1&REQUEST=GetMap&LAYERS=OSM-GB:__all__&SRS
=EPSG:27700&BBOX=532685,176236,542182,183918&FORMAT=image/png&WIDTH=800&HEIGHT=400"
share|improve this question
    
What WMS are you using? GeoServer? We run on GeoServer and the image distorts for us, so we have to do some maths to make sure it doesn't! –  Rob Quincey Jun 29 '12 at 13:41
    
osmgb.org.uk/OSM-GB/wms - I get images with no distortion! Could an OGC standard be vague? –  Spacedman Jun 29 '12 at 13:56
1  
WMS Specification: In the case where the aspect ratio of the BBOX and the ratio width/height are different, the WMS shall stretch the returned map so that the resulting pixels could themselves be rendered in the aspect ratio of the BBOX. - Source: portal.opengeospatial.org/files/?artifact_id=14416 –  Chau Jun 29 '12 at 14:24
    
Chau, I think that's an answer, and it seems to mean the WMS I'm querying is non-compliant... Its GetCapabilities says its Geoserver. –  Spacedman Jun 29 '12 at 14:28
    
What I'm saying is, put that in an answer and I'll tick it for you. –  Spacedman Jun 29 '12 at 17:03

1 Answer 1

up vote 0 down vote accepted

The WMS server in question passes these requests through to the "OGC Mapnik" WMS server, which is non-compliant to the standard. There is some discussion about this.

Solution is to only query with the aspect ratio the same.

share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.