[GIS] Updating bounding box of layer using geoserver API

extentsgeoserver

Is there a way to set the Bounding Box of a geoserver layer using the REST Api? I get the BB extent using a postgis query and then I could pass it to a json or xml and post it. But I haven't found any examples online.

I read that gsconfig doesn't support this functionality.
My geoserver version is rather old (2.5).

Best Answer

You should update the FeatureType of your layer. The feature type API is useful for this purpose.
You can use Geoserver-manager (java library) for calling rest APIs.

GeoServerRESTManager manager = new GeoServerRestManager(url,user,pass);
manager.getPublisher().publishDBLayer(...);
Related Question