[MapProxy] Serving MBTiles via MapProxy
Jorge Arévalo
jorge.arevalo at deimos-space.com
Fri Dec 9 07:58:53 EST 2011
Ok, if helps, this is my MBTiles file (~ 60MB):
http://dl.dropbox.com/u/6599273/data/tiles_F.mbtiles
And I can see it properly with MBTiles viewer
http://viswaug.wordpress.com/2011/06/28/mbtilesviewer/
Here, an screenshot:
http://dl.dropbox.com/u/6599273/capturas/mbtiles_coverage.png
The MBTiles file was created in 2 steps:
1.- Execute gdal2tiles against a GeoTIFF file. The output was a
TMS-compatible directory structure.
2.- Execute mbutil against the output directory of step 1: mb-util
directory myfile.mbtiles
Finally, my yaml file looks like this:
services:
wms:
srs: ['EPSG:900913', 'EPSG:4326', 'EPSG:23030']
image_formats: ['image/jpeg', 'image/png']
layers:
- name: my_mbtiles_layer
title: My MBTiles layer
sources: [my_mbtiles_cache]
cache:
my_mbtiles_cache:
sources: []
grids: [my_grid]
cache:
type: mbtiles
filename: /path/to/myfile.mbtiles
grids:
my_grid:
tile_size: [256, 256] # size of the PNG files
srs: 'EPSG:900913' # gdal2tiles uses that output srs for generated tiles
res: [9783.93961875000059, 4891.96980937500030,
2445.98490468750015, 1222.99245234375007, 611.49622617187504,
305.74811308593752, 152.87405654296876, 76.43702827148438,
38.21851413574219, 19.10925706787109, 9.55462853393555] # the
resolutions at zoom levels 4-14, the generated zoom levels.
res_factor: 2
bbox_srs: 'EPSG:4326'
bbox: [-6.54,38.35,-3,40.65]
And still blank images :-( How could I serve that MBTiles file via
MapProxy, using a WMS service, for example?
Many thanks in advance, and best regards,
Jorge
2011/12/5 Jorge Arévalo <jorge.arevalo at deimos-space.com>:
> 2011/11/22 Oliver Tonnhofer <olt at omniscale.de>:
>>
>> On 21.11.2011, at 18:37, Jorge Arévalo wrote:
>>> All my tiles form a coverage inside the BBOX (in epsg:4326):
>>> [-6.54,38.35,-3,40.65]
>>>
>>> But the problem is I get a blank image of 256x256 px, and a HTTP code
>>> 200. So, the response is ok, but nothing is rendered in it. The
>>> MBTiles coverage is ok. I can see it in a desktop viewer. Here, an
>>> screenshot:
>>>
>>> http://dl.dropbox.com/u/6599273/capturas/mbtiles_coverage.png
>>>
>>> So, where can be the problem?
>>
>>
>> How did you create the MBTiles? Are you sure that it contains tiles from level 0 on? You can check with sqlite from the commandline:
>>
>> sqlite3 mytiles.mbtiles 'select * from tiles where zoom_level = 0'
>>
>
> Hello,
>
> Sorry for the delay in my response. I was busy with a different project.
>
> My MBTiles file actually only contains zooms from 4 to 14. Google Maps
> zoom levels. My metadata are:
>
> bounds: -6.54,38.35,-3,40.65
> minzoom: 4
> maxzoom: 14
>
> When I execute the 'demo' program and try to fetch my data using the
> WMS service and PNG format, this is one of the queries I get:
>
> GET /service?LAYERS=my_mbtiles_layer&FORMAT=image%2Fpng&SERVICE=WMS&VERSION=1.1.1&REQUEST=GetMap&STYLES=&EXCEPT=application%2Fvnd.ogc.se_inimage&SRS=EPSG%3A4326&BBOX=-1.598789691925,1.577430847,-1.5859150886536,1.5857005119323&WIDTH=600&HEIGHT=400
>
> The BBOX looks strange for me... I've defined the extent of my layer
> in the 'grid' section, as you can see, but the BBOX defined for the
> query is a really tiny one (where does it come from?). Anyway, if I
> manually rewrite the query using my defined BBOX:
>
> GET /service?LAYERS=my_mbtiles_layer&FORMAT=image%2Fpng&SERVICE=WMS&VERSION=1.1.1&REQUEST=GetMap&STYLES=&EXCEPT=application%2Fvnd.ogc.se_inimage&SRS=EPSG%3A4326&BBOX=-6.54,38.35,-3,40.65&WIDTH=600&HEIGHT=400
>
> I get an empty image too. Concretely, a 600x400 empty PNG file.
> Dimensions and file type are ok, but the image is only white. I don't
> know what's happening, but my bets are:
>
> - Something related with the zoom levels (I only have Google Maps 4-14)
> - Something related with my defined grid (res_factor?)
>
> Any other suggestion?
>
> Best regards,
>
> --
> Jorge Arévalo
> Internet & Mobility Division, DEIMOS
> jorge.arevalo at deimos-space.com
> http://mobility.grupodeimos.com/
> http://www.libregis.org
> http://geohash.org/ezjqgrgzz0g
--
Jorge Arévalo
Internet & Mobility Division, DEIMOS
jorge.arevalo at deimos-space.com
http://mobility.grupodeimos.com/
http://www.libregis.org
http://geohash.org/ezjqgrgzz0g
More information about the MapProxy
mailing list