Reputation: 91
I am using GeoServer and seed tiles on my server. The tiles are created successfully but i dont know which pattern the directory structure is following... (i.e. .../EPSG_4326_05/0_0/00_06.png) I want to use the tiles in a OpenLayers application and there i want to use a OSM source which is using the XYZ-pattern which is commonly used as URL pattern for tile-serving. Is there a way to tell the geoserver it should create the tiles with the XYZ structure?
Upvotes: 7
Views: 19945
Reputation: 1
url: "http://localhost:8080/<path_to_complete_directory_of_tiles_file>/{z}/{x}/{-y}.png/jpeg"
I am using tomcat to host the geoserver so I make my blobstore path in root directory inside the tomcat folder which directly accessible by tomcat. *** GEOSERVER SUPPORTS XYZ format ***
Upvotes: 0
Reputation: 412
This may be too late by here is my XYZ URL for geoserver layer:
http://localhost/gwc/service/tms/1.0.0/gis:service@EPSG%3A900913@png/{z}/{x}/{-y}.png
Geoserver will cache the tiles automatically as you request through URL.
Upvotes: 9
Reputation: 5669
Cool, I had the same question one hour ago. Here goes the summary.
Note:
What the OP calls
XYZ
format is the format popularized by Google Maps where a global/basemap is server-side split and served as tiles in a{z}/{x}/{y}
format where zoom, latitude and longitude are represented internally [1]. Effectively, the name of the service providing such "format" isTile Map Service (TMS)
[2], and GeoServer does provide such service [3].XYZ
is just the name of the class in OpenLayers used to access aTMS
server [4].
That being said, here is how you'd do to have a TMS service running between your GeoServer and OpenLayers:
With GWC and TMS enabled you should see your raster layers listed under http://localhost:8080/gwc/service/tms/1.0.0
(or, in general, <geoserver-path>/gmc/service/tms/1.0.0
).
Then, you just have to call one of those TileMaps from OpenLayer:
var tileURL = "<tilemap-from-gwc-list-above>" + "/{z}/{x}/{-y}.jpg" // or '.png'
var map = new ol.Map(<your params here>);
var bm = new ol.layer.Tile({
source: new ol.source.XYZ({
url: tileURL
})
})
map.addLayer(bm)
Hope that helps. Cheers.
Refs:
Upvotes: 8
Reputation: 10976
GeoServer (actually GeoWebCache) can provides a number of end points that can server tiles.
None of these uses the so called XYZ system (because that isn't a standard) but OpenLayers has a Tiled Layer that can handle TMS and WMTS servers using the TileImage source.
Upvotes: 0