[MapProxy] Mapproxy sends wrong request parameters to WMS server
Rahkonen Jukka
Jukka.Rahkonen at mmmtike.fi
Wed Aug 31 09:36:56 EDT 2011
Hi,
You forget that MapProxy is really a proxy in between you and the real server. The configuration file sets the rules for discussion between MapProxy and the remote server. Read http://mapproxy.org/docs/1.1.1/configuration.html I suppose that the 1184x1184 sized request comes from these two settings
meta_size
MapProxy does not make a single request for every tile but will request a large meta-tile that consist of multiple tiles. meta_size defines how large a meta-tile is. A meta_size of [4, 4] will request 16 tiles in one pass. With a tile size of 256x256 this will result in 1024x1024 requests to the source WMS.
meta_buffer
MapProxy will increase the size of each meta-tile request by this number of pixels in each direction. This can solve cases where labels are cut-off at the edge of tiles.
And the format/png comes from these two
format
The internal image format for the cache. The default is image/png.
request_format
MapProxy will try to use this format to request new tiles, if it is not set format is used. This option has no effect if the source does not support that format or the format of the source is set explicitly (see suported_format or format for sources).
If you send the failing request from your browser you will see the error message from the remote GeoWebCache service:
400: Requested horizontal resolution: 45250.720744687496 , best match: 39135.7584765625 exceeds 10% threshold. Perhaps the client is configured with an incorrect set of scales (resolutions), or the DPI setting is off compared to the one in GWC ?
Do http://129.206.229.158:8180/geowebcache_122/service/wms?service=wms=version=1.1.0&request=getcapabilities and read
<Abstract>Note that not all GeoWebCache instances provide a full WMS service.</Abstract>
This is obviously true with this GWC service. Next do
http://129.206.229.158:8180/geowebcache_122/service/wms?service=wms=version=1.1.0&request=getcapabilities&tiled=true
and thereafter you should have some information to go forward. Alternatively do
http://129.206.229.158:8180/geowebcache_122/service/wmts?REQUEST=getcapabilities
-Jukka Rahkonen-
Perdomo Curbelo wrote:
Hello, Im doing some basic tests on Mapproxy and I am having some issues with certain WMS servers. Right now my config file includes 3 layers attached to 3 different servers like this:
layers:
- name: fronteras
title: Omniscale OSM WMS - osm.omniscale.net<http://osm.omniscale.net>
sources: [cache_fronteras]
- name: topo
title: Cubewerx
sources: [cache_topo]
- name: osm
title: OSM
sources: [cache_osm]
caches:
cache_fronteras:
grids: [GLOBAL_MERCATOR, global_geodetic_sqrt2]
sources: [serv1]
cache_topo:
grids: [GLOBAL_MERCATOR, global_geodetic_sqrt2]
sources: [serv2]
cache_osm:
sources: [serv3]
sources:
serv1:
type: wms
req:
url: http://osm.omniscale.net/proxy/service?
layers: osm
serv2:
type: wms
req:
url: http://demo.cubewerx.com/demo/cubeserv/cubeserv.cgi?
layers: Foundation.ETOPO2
serv3:
type: wms
req:
url: http://129.206.229.158:8180/geowebcache_122/service/wms?
layers: osm_auto:all
Both layers "topo" and "fronteras" work fine. For example, if i write these requests in my browser:
http://127.0.0.1:2222/service?LAYERS=fronteras&FORMAT=image%2Fjpeg&service=WMS&VERSION=1.1.1&REQUEST=GetMap&STYLES=&EXCEPTIONS=application%2Fvnd.ogc.se_inimage&SRS=EPSG%3A4326&BBOX=-28.6083984375,19.1162109375,-2.2412109375,36.6943359375&WIDTH=600&HEIGHT=400
http://127.0.0.1:2222/service?LAYERS=topo&FORMAT=image%2Fjpeg&service=WMS&VERSION=1.1.1&REQUEST=GetMap&STYLES=&EXCEPTIONS=application%2Fvnd.ogc.se_inimage&SRS=EPSG%3A4326&BBOX=-28.6083984375,19.1162109375,-2.2412109375,36.6943359375&WIDTH=600&HEIGHT=400<http://127.0.0.1:2222/service?LAYERS=fronteras&FORMAT=image%2Fjpeg&service=WMS&VERSION=1.1.1&REQUEST=GetMap&STYLES=&EXCEPTIONS=application%2Fvnd.ogc.se_inimage&SRS=EPSG%3A4326&BBOX=-28.6083984375,19.1162109375,-2.2412109375,36.6943359375&WIDTH=600&HEIGHT=400>
I get the propper image as expected. But when I query the third server:
http://127.0.0.1:2222/service?LAYERS=osm&FORMAT=image%2Fjpeg&service=WMS&VERSION=1.1.1&REQUEST=GetMap&STYLES=&EXCEPTIONS=application%2Fvnd.ogc.se_inimage&SRS=EPSG%3A4326&BBOX=-28.6083984375,19.1162109375,-2.2412109375,36.6943359375&WIDTH=600&HEIGHT=400<http://127.0.0.1:2222/service?LAYERS=fronteras&FORMAT=image%2Fjpeg&service=WMS&VERSION=1.1.1&REQUEST=GetMap&STYLES=&EXCEPTIONS=application%2Fvnd.ogc.se_inimage&SRS=EPSG%3A4326&BBOX=-28.6083984375,19.1162109375,-2.2412109375,36.6943359375&WIDTH=600&HEIGHT=400>
I get a HTTP error. Looking inside mapproxy log file, it shows this warning and thea ctual request to the server:
2011-08-31 12:23:20,063 - WARNING - mapproxy.source.wms - could not retrieve WMS map: HTTP Error "http://129.206.229.158:8180/geowebcache_122/service/wms?layers=osm_auto%3Aall&width=1184&version=1.1.1&bbox=-10801469.341,-782715.16964,782715.16964,10801469.341&service=WMS&format=image%2Fpng&styles=&srs=EPSG%3A900913&request=GetMap&height=1184": 400
Notice that the parameters are all messed up. Original width and height was 256x256 and it changes to 1184x1184. It also changes the image format from jpeg to png, and also the bounding box and EPSG values are completely different. I have never used these values before so its not likely to be a cached query or some old requests previously done.
I hope you can give me some clues about this error. Thanks in advance.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.osgeo.org/pipermail/mapproxy/attachments/20110831/265ee703/attachment-0001.html
More information about the MapProxy
mailing list