2

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).

asked Apr 6, 2016 at 19:04
4
  • 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. Commented 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. Commented 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. Commented Apr 7, 2016 at 5:52
  • 3
    Assuming this is a vector layer. Check this ReST call: docs.geoserver.org/2.8.x/en/user/rest/api/… notice the recalculate parameter. Commented Apr 7, 2016 at 18:02

1 Answer 1

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(...);
answered Sep 25, 2016 at 8:12
2

Your Answer

Draft saved
Draft discarded

Sign up or log in

Sign up using Google
Sign up using Email and Password

Post as a guest

Required, but never shown

Post as a guest

Required, but never shown

By clicking "Post Your Answer", you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.