2

Using GeoServer you can do a WMS request to receive a single PNG representation of a certain layer using something like this.

http://localhost:8080/geoserver/wms?service=WMS&version=1.1.0&request=GetMap&layers=spearfish&styles=&bbox=589425.9342365642,4913959.224611808,609518.6719560538,4928082.949945881&width=512&height=359&srs=EPSG:26713&format=image%2Fpng

Is it possible to alter this request to directly request different "zoom levels" or "tiles" of the layer? I assume you need to do a Web Map Tile Service (WMTS) request but I can't seem to find any documentation on how to do this. Any guidance would be helpful.

1 Answer 1

3

If you want to get a 256*256 PNG tile of a certain map service from geoserver you can do it with including tiled=TRUE in your request:

http://localhost:8080/geoserver/wms?LAYERS=spearfish&STYLES=&FORMAT=image%2Fpng&TILED=true&TILESORIGIN=589425.93423656%2C4913959.2246118&SERVICE=WMS&VERSION=1.1.1&REQUEST=GetMap&SRS=EPSG%3A26713&BBOX=589425.93423656,4913959.2246118,609518.67195605,4934051.9623313&WIDTH=256&HEIGHT=256

But there's no zoom parameter in the request, and the client side application will take care of the certain zoom level and the bounding box.

But if you insist on using WMTS (which capability is included in GeoServer with GeoWebCache integration) you can do it with the following request:

http://v2.suite.opengeo.org/geoserver/gwc/service/wmts/?SERVICE=WMTS&REQUEST=GetTile&VERSION=1.0.0&LAYER=medford%3Abuildings&STYLE=_null&TILEMATRIXSET=EPSG%3A900913&TILEMATRIX=EPSG%3A900913%3A13&TILEROW=3030&TILECOL=1300&FORMAT=image%2Fpng 

Here the TILEROW and TILECOL are the key parameters. But if you want to extend your knowledge about WMTS I would suggest you to check out the official OGC standard here:

http://www.opengeospatial.org/standards/wmts

And you can find useful information about WMTS in geoserver at the following link:

http://docs.geoserver.org/latest/en/user/webadmin/tilecache/defaults.html?highlight=wmts

I hope this helps!

4
  • Thanks. I was hoping to store multiple tiles from a map service before using something like OpenLayers to render them. But this just isn't possible it seems... Commented Mar 28, 2013 at 10:46
  • It's possible... there are two expressions for "storing multiple tiles from a map service": caching and seeding refers to saving your map in different zoom levels as small tiles. You should search for these two expression. But with GeoServer you should use GeoWebCache, please check the documentation of it here: docs.geoserver.org/latest/en/user/geowebcache/index.html Good luck! Commented Mar 28, 2013 at 12:03
  • Thanks again. So I seeded the map and started using the TIREROW and TILECOL parameters but I can still only reach the tiles of the top most zoom level, not the tiles from different zoom levels. Same goes for that example from v2.suite.opengeo.org, the range is really small: "Row 3016 is out of range, min: 3074 max:3081" What am I missing? Commented Mar 28, 2013 at 14:34
  • O nevermind! The zoomlevel was inside the TILEMATRIX parameter. Commented Mar 28, 2013 at 14:47

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

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