I'm trying to create a layer from a PostGIS table with REST api, I can create the layer but couldn't add the time dimension.

I can configure the dimension in the interface and I did try to get the feature description but no dimensions infomation:

        <atom:link xmlns:atom="http://www.w3.org/2005/Atom" rel="alternate" href="http://localhost:8080/geoserver/rest/styles/point.xml" type="application/xml"/>
    <resource class="featureType">
        <atom:link xmlns:atom="http://www.w3.org/2005/Atom" rel="alternate" href="http://localhost:8080/geoserver/rest/workspaces/terrama/datastores/view_focos13postgisstore/featuretypes/focos.xml" type="application/xml"/>

Solution: This is the xml model I'm using to do this.

        <entry key="time">
  • where is the documentation on how to develop this xml model ? For example, when looking at the geoserver REST api (docs.geoserver.org/latest/en/user/rest/index.html) i can't find that i need to specify "attribute" as "time_attribute" nor that "devaultValue" has an extra level named "strategy". – J.A.Cado Sep 11 '19 at 6:43

Just enable it with the UI once, and check how the layer and the attached resource get modified (I believe you'll find the change in the resource). Then repeat the same using the REST API.

This approach is valid for any configuration that you can carry on with the UI.


I had the same need, I solved it in python with gsoncig


My code :

from geoserver.catalog import Catalog
cat = Catalog("http://localhost:8080/geoserver/rest/", "admin", "geoserver")
coverage = cat.get_resource_by_url("http://localhost:8080/geoserver/rest/workspaces/test1/coveragestores/netCDFupload/coverages/CHARGE.xml")
from geoserver.support import DimensionInfo
timeInfo = DimensionInfo("time", "true", "LIST", None, "ISO8601", None)
elevationInfo = DimensionInfo("elevation", "true", "LIST", None, "EPSG:5030", None)
coverage.metadata = ({'time': timeInfo, 'elevation': elevationInfo})

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.