1

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 Apr 6 '16 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 Apr 6 '16 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 Apr 7 '16 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. – simogeo Apr 7 '16 at 18:02
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(...);

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.