[gdal-dev] Re: Different image with WMS vs tiled WMS

Eduardo Ramalho eduardo.ramalho at gmail.com
Tue Jun 1 12:48:19 EDT 2010


Hi!

Found the answer to the problem described in the original email !

The XML file configuration of gdal_translate was wrong. The bounding
box coordinates had to be adapted for a tile base request (TMS). I had
to expand the rigth border to take in account the tile pixel size and
the scale factor at zoom level 0.

Anyway, thanks for this great lib.

Eduardo Ramalho





On Tue, May 25, 2010 at 4:41 PM, Eduardo Ramalho
<eduardo.ramalho at gmail.com> wrote:
> Hello!
>
> I'm using "gdal_translate" 1.7.1 to create a local png file, by WMS
> protocol, from GeoServer 2.0.1.
>
> The file created by WMS is ok. When I try to access the same content
> by tiled WMS (WMS-C) the file generated is not quite right.
>
> The difference is on the top right corner of the generated image. By
> WMS, my geometry bounding box touches the image border on all sides.
>
> When I request the same image (same pixel dimension, projection and
> georeferenced coordinates) the image has an blank band between the
> border and my geomerty on top and on right corners. My geometry is not
> clipped but it appears like it was scaled down to fit that band on the
> same image pixel dimension.
>
> I probably missing something but cannot find any documentation to
> justify this problem. Can someone lead me to the rigth path ?
>
> I investigate the GeoServer logs, to try to understand what Gdal was
> requesting. This is what I found.
>
> 1) A correct image is generated with this kind of request:
>
> /geoserver/wms?service=WMS&version=1.1.0&request=GetMap&layers=portugal:caopa&styles=
> &bbox=-119191.408,-300404.804,162129.081,276083.767
> &width=996&height=2048
> &srs=EPSG:3763&format=image/png
>
> 1.1) The projection EPSG:3763 is native to my datasource.
> 1.2) The Bounding box is calculated by postgis for my geometry
> 1.3) The width and height is the request image dimension.
>
>
> 2) For a tiled WMS request, I only changed the following items on XML
> configuration file:
>
> 2.1) The URL to GeoWebCache service (inside GeoServer)
> 2.2) The blocksize from 996x2048 to 256x256. The 256 is my tile size
> as defined on GeoWebCache.
>
> This generates 32 http requests by WMS like this.
>
> /geoserver/gwc/service/wms?request=GetMap&version=1.1.1&layers=portugal:caopa&styles=&srs=EPSG:3763&format=image/png
> &width=228&height=256
> &bbox=97730.41484337,-300404.80400000,162129.08100000,-228343.73262500
>
> 2.3) it request 8 rows and 4 columns
> 2.4) 16 requests had "...&width=228..." and not "256".
> 2.5) all the bbox parameters never outgrown my geometry bbox.
>
> Is this enough to understand what is happening ?
>
> Kind regards,
>
> Eduardo
>


More information about the gdal-dev mailing list