[Geoserver-users] help:compute a layer bounding box problem

Recently, I met a problem. My program need the geoserver compute a layer bounding box automaticly when I add a new feature to the layer. Could the geoserver provide the interface to the public?
Thank you!

That has been asked on stack exchange as well:

http://gis.stackexchange.com/questions/10049/updating-a-layers-bounding-box-in-geoserver-after-wfs-t-insert

You may be able to set up a WPS process to calculate the bounds (i.e. full table scan of all content). I am not sure if there is a way to set up the REST API to allow us to “kick” the layer into recalculating the bounds.

The code to calculate the bounds is attached to a button in the wicket user interface, since calculating the bounds may take a long time it is not something you want to do as you add features one at a time.

···

Jody Garnett

On Wed, Jun 11, 2014 at 7:21 PM, fanxing926 <fanxing926@anonymised.com> wrote:

Recently, I met a problem. My program need the geoserver compute a layer bounding box automaticly when I add a new feature to the layer. Could the geoserver provide the interface to the public?
Thank you!


HPCC Systems Open Source Big Data Platform from LexisNexis Risk Solutions
Find What Matters Most in Your Big Data with HPCC Systems
Open Source. Fast. Scalable. Simple. Ideal for Dirty Data.
Leverages Graph Analysis for Fast Processing & Easy Data Exploration
http://p.sf.net/sfu/hpccsystems


Geoserver-users mailing list
Geoserver-users@anonymised.comsts.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/geoserver-users

On Sat, Jun 14, 2014 at 11:04 AM, Jody Garnett <jody.garnett@anonymised.com>
wrote:

That has been asked on stack exchange as well:

http://gis.stackexchange.com/questions/10049/updating-a-layers-bounding-box-in-geoserver-after-wfs-t-insert

You may be able to set up a WPS process to calculate the bounds (i.e. full
table scan of all content). I am not sure if there is a way to set up the
REST API to allow us to "kick" the layer into recalculating the bounds.

The code to calculate the bounds is attached to a button in the wicket
user interface, since calculating the bounds may take a long time it is not
something you want to do as you add features one at a time.

Just one observation. If the problem was just adding features, that would
be easy, you just grow the existing bounds with the ones of the new feature.
The slow part kicks in when you remove or modify a feature that has at
least one point touching the existing bounds, in that case you have to
recompute them from scratch (uh, theoretically it would be sufficient to
use a subset of the features again, but still, they could end up being
the whole data set depending on the feature being removed/modified and the
spatial data distribution).

Cheers
Andrea

--

GeoServer Professional Services from the experts! Visit
http://goo.gl/NWWaa2 for more information.

Ing. Andrea Aime
@geowolf
Technical Lead

GeoSolutions S.A.S.
Via Poggio alle Viti 1187
55054 Massarosa (LU)
Italy
phone: +39 0584 962313
fax: +39 0584 1660272
mob: +39 339 8844549

http://www.geo-solutions.it
http://twitter.com/geosolutions_it

-------------------------------------------------------

The transaction batch events are supposed to calculated the effected bounding box, but do not indicate if it was adds, modifications or deletes contributing to the change.

Still with funding a dev may be able to detect the special case when only adds have occurred and update the layer bounds as needed.

Jody

···

Jody Garnett

On Sat, Jun 14, 2014 at 7:22 PM, Andrea Aime <andrea.aime@anonymised.com> wrote:

On Sat, Jun 14, 2014 at 11:04 AM, Jody Garnett <jody.garnett@anonymised.com> wrote:

That has been asked on stack exchange as well:

http://gis.stackexchange.com/questions/10049/updating-a-layers-bounding-box-in-geoserver-after-wfs-t-insert

You may be able to set up a WPS process to calculate the bounds (i.e. full table scan of all content). I am not sure if there is a way to set up the REST API to allow us to “kick” the layer into recalculating the bounds.

The code to calculate the bounds is attached to a button in the wicket user interface, since calculating the bounds may take a long time it is not something you want to do as you add features one at a time.

Just one observation. If the problem was just adding features, that would be easy, you just grow the existing bounds with the ones of the new feature.
The slow part kicks in when you remove or modify a feature that has at least one point touching the existing bounds, in that case you have to
recompute them from scratch (uh, theoretically it would be sufficient to use a subset of the features again, but still, they could end up being
the whole data set depending on the feature being removed/modified and the spatial data distribution).

Cheers
Andrea

==

GeoServer Professional Services from the experts! Visit
http://goo.gl/NWWaa2 for more information.

==

Ing. Andrea Aime

@geowolf
Technical Lead

GeoSolutions S.A.S.
Via Poggio alle Viti 1187
55054 Massarosa (LU)
Italy
phone: +39 0584 962313
fax: +39 0584 1660272
mob: +39 339 8844549

http://www.geo-solutions.it
http://twitter.com/geosolutions_it