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).
-
I found this: docs.geoserver.org/2.5.x/en/user/geowebcache/rest/layers.html It seems you can use the geowebcache rest api (available also in geoserver 2.5) to modify a layer.user1919– user19192016年04月06日 19:29:08 +00:00Commented Apr 6, 2016 at 19:29
-
Not sure to understand but geoserver calculate the BBOX when inserting the layer with Rest. If the bbox changes you can delete and re-create the layer.WKT– WKT2016年04月06日 21:11:38 +00:00Commented Apr 6, 2016 at 21:11
-
I know that geoserver Rest calculates the bounding box when the layer is CREATED. What I need is to programmatically change the bounding box without dropping the layer completely.user1919– user19192016年04月07日 05:52:12 +00:00Commented Apr 7, 2016 at 5:52
-
3Assuming this is a vector layer. Check this ReST call: docs.geoserver.org/2.8.x/en/user/rest/api/… notice the recalculate parameter.simogeo– simogeo2016年04月07日 18:02:28 +00:00Commented Apr 7, 2016 at 18:02
1 Answer 1
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(...);
-
This answer is ok, but the link is broken. I suggest switching to this: docs.geoserver.org/latest/en/user/rest/api/…André Carvalho– André Carvalho2022年09月27日 17:00:18 +00:00Commented Sep 27, 2022 at 17:00
-