I'm creating a data store in GeoServer from an OpenLayers DrawFeature control, using WFS-T to save the geometry into GeoServer. This works great, except the data store's bounding box doesn't get set in GeoServer. However, if you create a data store from a shapefile, the bounding box gets automatically set. I know you can go into the GeoServer admin page and tell it to calculate the bounding box, but I need a way to do it programmatically.
[GIS] Updating a layer’s bounding box in GeoServer after WFS-T insert
geoserveropenlayers-2wfs-t
Related Question
- Geoserver to Leaflet – Getting WFS Data from Geoserver into Leaflet
- [GIS] can I get map’s bounding box at any time, after user clicks button
- [GIS] How to make Geoserver dynamically calculate the bounding box of a postgis backed Layer
- [GIS] How to set up wfs-t service in Geoserver using openlayers from postgis data
Best Answer
Unfortunately there is no easy way to do it (no REST api and no URL hacking thanks to Wicket [pun intended]). In case you feel like coding, the source of the webui that handles the update of the bbox is in BasicResourceConfig.java.