[Geoserver-devel] Layer group bounds and layers bounds being over ridden

I’m trying to create a LayerGroup of two existing layers (which are both created from the same coverage store) that have distinct bounding boxes.

tiles.png

Like this - but when I create a layer group of the two layers, it correctly calculates the new larger bounding box but it displays tiles for the whole bbox from the underlying store like this:

group.png

Does any one know why this might be? is it a bug? and if it is where should I look to fix it?

My suspicion is that someone is being clever and trying to save time or requests by combining the two layers into one?

Ian

···

Ian Turton

Hi Ian,

Interesting. I don’t think it’s a bug since the bboxes of the two layers is unioned, there’s only one bbox and the client would be within its rights to request tiles within that bounds.

If you wanted separate bboxes, wouldn’t you have to serve separate layers?

Peter

From: Ian Turton ijturton@anonymised.com
Sent: February 25, 2021 8:47 AM
To: Geoserver-devel geoserver-devel@lists.sourceforge.net
Subject: [Geoserver-devel] Layer group bounds and layers bounds being over ridden

I’m trying to create a LayerGroup of two existing layers (which are both created from the same coverage store) that have distinct bounding boxes.

Like this - but when I create a layer group of the two layers, it correctly calculates the new larger bounding box but it displays tiles for the whole bbox from the underlying store like this:

Does any one know why this might be? is it a bug? and if it is where should I look to fix it?

My suspicion is that someone is being clever and trying to save time or requests by combining the two layers into one?

Ian

Ian Turton

I was thinking the same. In WMS GeoServer treats bounding boxes are purely informative, a way for the client to
get in the right viewing area for the layer, but would respond to any request outside of them.
They are not enforced, you can check by restricting the bbox and using the map preview… it should completely ignore it.

GWC defines the grid subsets based on those boxes for sure, and might refuse to serve outside of those.
Looking at your pictures, it would even seem it intersects with tile boxes, and returns only part of the data?
But once it’s a group, the restriction is the box of the group, the one of the layers is likely ignored (GWC does not even know the “thing” is a layer).

Cheers
Andrea

(attachments)

image005.png
image006.png

···

Regards, Andrea Aime

== GeoServer Professional Services from the experts! Visit http://goo.gl/it488V for more information. == Ing. Andrea Aime @geowolf Technical Lead GeoSolutions S.A.S. Via di Montramito 3/A 55054 Massarosa (LU) phone: +39 0584 962313 fax: +39 0584 1660272 mob: +39 339 8844549 http://www.geo-solutions.it http://twitter.com/geosolutions_it ------------------------------------------------------- Con riferimento alla normativa sul trattamento dei dati personali (Reg. UE 2016/679 - Regolamento generale sulla protezione dei dati “GDPR”), si precisa che ogni circostanza inerente alla presente email (il suo contenuto, gli eventuali allegati, etc.) è un dato la cui conoscenza è riservata al/i solo/i destinatario/i indicati dallo scrivente. Se il messaggio Le è giunto per errore, è tenuta/o a cancellarlo, ogni altra operazione è illecita. Le sarei comunque grato se potesse darmene notizia. This email is intended only for the person or entity to which it is addressed and may contain information that is privileged, confidential or otherwise protected from disclosure. We remind that - as provided by European Regulation 2016/679 “GDPR” - copying, dissemination or use of this e-mail or the information herein by anyone other than the intended recipient is prohibited. If you have received this email by mistake, please notify us immediately by telephone or e-mail.

On Thu, 25 Feb 2021 at 14:16, Andrea Aime <andrea.aime@anonymised.com> wrote:

I was thinking the same. In WMS GeoServer treats bounding boxes are purely informative, a way for the client to
get in the right viewing area for the layer, but would respond to any request outside of them.
They are not enforced, you can check by restricting the bbox and using the map preview… it should completely ignore it.

But each individual layer is correctly defined with a bounding box and doesn’t display anything outside it’s bounds. But when I put them in a layer group I get back data that is not in either of the layers’ bounds. Should the two layers not be handled separately? rather than being added together with an expanded bounding box?

GWC defines the grid subsets based on those boxes for sure, and might refuse to serve outside of those.
Looking at your pictures, it would even seem it intersects with tile boxes, and returns only part of the data?
But once it’s a group, the restriction is the box of the group, the one of the layers is likely ignored (GWC does not even know the “thing” is a layer).

GWC isn’t involved here and the tiling in the background is also unrelated (other than being what makes up the image pyramid store the two layers are published from).

If you wanted separate bboxes, wouldn’t you have to serve separate layers?

I really want to only add one layer for the two areas that are defined as different layers.

Ian

I really don’t understand how this is possible, in a WMS request.
I just took a 2.18.x, the sf:dem layer, restricted its declared bounding box, and it did nothing to the layer preview,
it’s still showing the entire layer. As expected, the bbox I see there is purely informative, GetMap ignores it and
grabs all data available.

I believe we need a bit more of explanation, seems like you’re hitting an odd behavior in the “two separate layers” case to me (they look like the same map, I don’t know how you made them display only part of it):

  • What is the coverage store?
  • Are these two separate raster sources in the same store (e…g, two raster layers in a geopackage)
  • Or is this “magical” bbox restriction enforced via some other mechanism, like GeoFence?
    Generally speaking, I’m not aware of any clever bit merging two layers coming from the same source.

Cheers

Andrea

···

== GeoServer Professional Services from the experts! Visit http://goo.gl/it488V for more information. == Ing. Andrea Aime @geowolf Technical Lead GeoSolutions S.A.S. Via di Montramito 3/A 55054 Massarosa (LU) phone: +39 0584 962313 fax: +39 0584 1660272 mob: +39 339 8844549 http://www.geo-solutions.it http://twitter.com/geosolutions_it ------------------------------------------------------- Con riferimento alla normativa sul trattamento dei dati personali (Reg. UE 2016/679 - Regolamento generale sulla protezione dei dati “GDPR”), si precisa che ogni circostanza inerente alla presente email (il suo contenuto, gli eventuali allegati, etc.) è un dato la cui conoscenza è riservata al/i solo/i destinatario/i indicati dallo scrivente. Se il messaggio Le è giunto per errore, è tenuta/o a cancellarlo, ogni altra operazione è illecita. Le sarei comunque grato se potesse darmene notizia. This email is intended only for the person or entity to which it is addressed and may contain information that is privileged, confidential or otherwise protected from disclosure. We remind that - as provided by European Regulation 2016/679 “GDPR” - copying, dissemination or use of this e-mail or the information herein by anyone other than the intended recipient is prohibited. If you have received this email by mistake, please notify us immediately by telephone or e-mail.

So I have an Image Mosaic Coverage store for the whole country, from this I have published 2 layers with restricted bounding boxes - A & B in this image:

tiles.png

These are distinct layers and when requested in QGIS they only display what is in the declared native bounding box.

When I place the two layers in a Layer Group so I only need to add one layer in QGIS, the declared bounds are ignored and data for the whole of the layer group bounds is returned (possibly in both layers?)

What I expected GeoServer to do was extract the required data from Layer A and a Layer B draw it as a single image and return it to QGIS with nothing in between the two layers.

This is all vanilla GeoServer with no GeoFence added (though I have thought of trying that next).

Ian

···

Ian Turton

Maybe QGIS is only asking for the bbox declared in the capabilities? I can assure you GeoServer is completely ignoring the bbox declared in the layers,
it’s informative, not mandatory. Try yourself in a layer preview (I did, reported outcomes in the previous mail in this thread).

If it’s QGIS, it would explain why you get the expected BBOX when they are separate, but the whole thing once they are unioned (QGIS is asking for
the bbox of the whole layer).

In general, I strongly recommend running tests without an external client, as they normally come with the client specific behavior mixed in,
you want to see what GeoServer does in face of a straight GetMap request (the openlayers preview in GeoServer is very close to bare bones, I normally use that).

Cheers
Andrea

···

== GeoServer Professional Services from the experts! Visit http://goo.gl/it488V for more information. == Ing. Andrea Aime @geowolf Technical Lead GeoSolutions S.A.S. Via di Montramito 3/A 55054 Massarosa (LU) phone: +39 0584 962313 fax: +39 0584 1660272 mob: +39 339 8844549 http://www.geo-solutions.it http://twitter.com/geosolutions_it ------------------------------------------------------- Con riferimento alla normativa sul trattamento dei dati personali (Reg. UE 2016/679 - Regolamento generale sulla protezione dei dati “GDPR”), si precisa che ogni circostanza inerente alla presente email (il suo contenuto, gli eventuali allegati, etc.) è un dato la cui conoscenza è riservata al/i solo/i destinatario/i indicati dallo scrivente. Se il messaggio Le è giunto per errore, è tenuta/o a cancellarlo, ogni altra operazione è illecita. Le sarei comunque grato se potesse darmene notizia. This email is intended only for the person or entity to which it is addressed and may contain information that is privileged, confidential or otherwise protected from disclosure. We remind that - as provided by European Regulation 2016/679 “GDPR” - copying, dissemination or use of this e-mail or the information herein by anyone other than the intended recipient is prohibited. If you have received this email by mistake, please notify us immediately by telephone or e-mail.

On Thu, 25 Feb 2021 at 15:34, Andrea Aime <andrea.aime@anonymised.com> wrote:

On Thu, Feb 25, 2021 at 4:22 PM Ian Turton <ijturton@anonymised.com…> wrote:

What I expected GeoServer to do was extract the required data from Layer A and a Layer B draw it as a single image and return it to QGIS with nothing in between the two layers.

Maybe QGIS is only asking for the bbox declared in the capabilities? I can assure you GeoServer is completely ignoring the bbox declared in the layers,
it’s informative, not mandatory. Try yourself in a layer preview (I did, reported outcomes in the previous mail in this thread).

You are quite right I was being seduced by QGIS honouring it and it being an easy solution to the clients’ problem. It’s a shame that we can’t allow users to clip down large data sources this way, does anyone know if GeoFence can handle this requirement?

Ian

Hi Ian,

yes, GeoFence can clip data sources based on a target polygon, including raster data (well just recently even
vector data, at the clipping level).

Takes a bit to get used to, it helps if you wrote IPTables rules in the past, as the logic of rule application is similar
(recommend to read it carefully before trying to set them up)

Cheers
Andrea

···

Regards, Andrea Aime

== GeoServer Professional Services from the experts! Visit http://goo.gl/it488V for more information. == Ing. Andrea Aime @geowolf Technical Lead GeoSolutions S.A.S. Via di Montramito 3/A 55054 Massarosa (LU) phone: +39 0584 962313 fax: +39 0584 1660272 mob: +39 339 8844549 http://www.geo-solutions.it http://twitter.com/geosolutions_it ------------------------------------------------------- Con riferimento alla normativa sul trattamento dei dati personali (Reg. UE 2016/679 - Regolamento generale sulla protezione dei dati “GDPR”), si precisa che ogni circostanza inerente alla presente email (il suo contenuto, gli eventuali allegati, etc.) è un dato la cui conoscenza è riservata al/i solo/i destinatario/i indicati dallo scrivente. Se il messaggio Le è giunto per errore, è tenuta/o a cancellarlo, ogni altra operazione è illecita. Le sarei comunque grato se potesse darmene notizia. This email is intended only for the person or entity to which it is addressed and may contain information that is privileged, confidential or otherwise protected from disclosure. We remind that - as provided by European Regulation 2016/679 “GDPR” - copying, dissemination or use of this e-mail or the information herein by anyone other than the intended recipient is prohibited. If you have received this email by mistake, please notify us immediately by telephone or e-mail.