I want to consume a GeoServer layer that has the time dimension enabled from an external WMS service that I have no control over. Time dimension is updated frequently, several times in an hour. Using Leaflet to visualize this layer but I'm having trouble programmatically figuring out what are the values for time dimension at any point in time.

In the GetCapabilites request I see for example that <Dimension name="time" units="ISO8601" multipleValues="0" current="1">2021-01-12T02:50:00Z/2021-01-12T09:40:00Z/PT5M</Dimension>

I'm wondering if there's a way to get GeoServer return only the possible time dimension values to the client. I could of course figure out some heuristics or parse the whole GetCapabilites request but this seems like killing a fly with nuclear bomb so looking for more elegant solution. Ideally an API endpoint that just returns an array of time dimension values for a layer.


2021-01-12T02:50:00Z/2021-01-12T09:40:00Z/PT5M is the list of all the time steps available - it starts at 2021-01-12T02:50:00Z and ends at 2021-01-12T09:40:00Z and is in steps of 5 minutes (PT5M) which should be all the information your client needs.

If you need to list the actual time steps (and there could well be a lot of them so this will slow down GetCapabilities requests for everyone using the service) you can set the presentation to List rather than Period for that layer as described in the manual.

  • I understand what the syntax means. So what you're saying is that GetCapabilities is the best and only way to get the layer time dimension information? Consider this example. User visits my leaflet app. To display the layer at the most recent point in time I need to fire the capabilites request and find the time. 15 minutes passes and another user visits the app. Since layer is updated frequently in geoserver the end time has changed. I need to fire another capabilites request and parse it and pass it to leaflet.
    – atzz_12
    Jan 12 at 13:09
  • 1
    That's all the WMS protocol allows for. GeoServer has a community module allowing to explore dimensions without having to download the full caps document. It's labelled a WMTS extension, but really, there is nothing WMTS specific to it: docs.geoserver.org/stable/en/user/community/… Jan 12 at 13:13
  • Understood. Unfortunately I don't have any control over the service. I'll look into the extension if I ever build a WMS service myself. Thanks Andrea & Ian
    – atzz_12
    Jan 12 at 15:40

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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