GeoWebCache: Difference between revisions
Brian Wilson (talk | contribs) Created page with "== Overview == This is a story about setting up a GeoServer instance to function as a cascading tile cache. That is, I want to have access to tiles that are on a remote..." |
Brian Wilson (talk | contribs) |
||
Line 88: | Line 88: | ||
# Fill in the form as above... | # Fill in the form as above... | ||
For "Mode", | For "Mode", refer to https://docs.geoserver.org/master/en/user/data/webadmin/layergroups.html | ||
I think I want "Named Tree" in this case. | |||
In the GUI I can sort the order of the layers the way I want, nice. | |||
=== Reference the layer group in ArcGIS Portal === | === Reference the layer group in ArcGIS Portal === |
Revision as of 00:01, 5 December 2019
Overview
This is a story about setting up a GeoServer instance to function as a cascading tile cache.
That is, I want to have access to tiles that are on a remote and possibly unreliable service, so I want GeoServer to act as a proxy and pull in and cache tiles that live somewhere else.
I want to be able to seed the cache so that many of the tiles are already available at least for low zoom levels, to really speed things up.
I want to be able to group services together so that they appear as a layer group in my web map.
Docker project
I will check it into github soon as it's working and put the link here.
Basically I build off the existing wildsong/geoserver project and then set it up only as a cache. Right now it's running on port 8080, and my intention is to set up a proxy on IIS on port 443. I have to learn how to do that. :-)
Geoserver set up
The first time it's run, it has no credentials set, so log in with "admin" and "geoserver" and change them.
Create a Workspace
You have to have a workspace before you can do anything else.
- Under Data, Workspaces
- Add new workspace
Give it a concise name and a URI. Make it the default workspace (if you want to).
"Note A workspace name is a identifier describing your project. It must not exceed ten characters or contain spaces. A Namespace URI (Uniform Resource Identifier) can usually be a URL associated with your project with an added trailing identifier indicating the workspace. The Namespace URI filed does not need to resolve to an actual valid web address."
You can adjust settings for the caching by going to Tile Caching settings.
At least set the BlobStore to point at /geoserver/gwc/tmp so that the tiles will be persisted in the docker volume. Remember to enable it too.
Add a remote service
This could be whatever is supported remotely -- I've tried WMS and WMTS and WMS seems always to be smoother.
In my testing with the OregonExplorer server I found some of the services (older ones) did not work in WMS and I had to set up WMTS services.
- Under "Data", Store
- Add new store
- WMS - Cascades a remote Web Map Service
- New WMS Connection
- Workspace - defaults to cc-cache
- WMS Source Name - osip2018
- Description: 2018 1' orthophoto of Oregon
- Enabled: yes, of course
- Capabilities URL: Go to the remote site and click the WMS link and copy and paste the link address from the browser
- (leave the rest blank or defaults)
- Save -- Hitting "save" tests the link. If the URL is unreachable, the save operation will fail.
- You still have to publish it. Click on Publish
- Give it a title that's better than OSIP_2018_OSIP_2018_WM, like maybe "OSIP 2018"
- Fill in the rest of the form as you see fit.
- These services always happiest at EPSG:4326, leave it at that.
- Fill in a bounding box that corresponds to the area you want to serve. I use -124.1,45.77,-123.35,46.3
In the Layer section, you can edit the cache settings for each layer to override things like the image type (PNG, JPEG, etc) and to override the BlobStore to stash the tiles in a different place and so on...
You can turn off the "queryable" flag under Publishing settings.
Preview the service
If you did all that correctly you should now be able to preview the new layer.
- under Data, select Layer Preview.
- In the Layer Preview list, click OpenLayers for the service you just created.
This should open an OpenLayers preview and you can see the data and zoom around in it.
Once you are convinced you can preview the service in OpenLayers, you should open it in QGIS to make sure it works there, too.
Add more services
I added NAIP 2016 from OregonExplorer.
Make several of your layers into a group
- Data -> Layer Groups
- Add new layer group
- Fill in the form as above...
For "Mode", refer to https://docs.geoserver.org/master/en/user/data/webadmin/layergroups.html
I think I want "Named Tree" in this case.
In the GUI I can sort the order of the layers the way I want, nice.
Reference the layer group in ArcGIS Portal
Use the layer group from Portal in a map
We're done.