opengeospatial / Bounding-Box-Abstract-Specification

Other
0 stars 0 forks source link

Proposed BoundingBox model #7

Open jerstlouis opened 2 years ago

jerstlouis commented 2 years ago

Proposing this as a potential model for the Bounding Box

AxisBounds

NOTE: A low bound greater than high implies going across the wrap-around point of the axis (e.g., the antimeridian)

BoundingBox

This is an axis-aligned building box, but could be used to define an oriented bounding box as well if the CRS of the BBOX is the local space prior to that re-orientation, that bounding box could then be re-oriented and positioned with e.g., a GeoPose. This may not be necessary if the BoundingBox is used within the context of a particular object (which is aware of its own orientation) -- in that case the fact that the BoundingBox is an object-oriented bounding box is simply something to be aware of based on the context of where/how it is defined (perhaps the CRS should be optional for that use case only).

pebau commented 2 years ago

this bypasses all earlier findings, based on long discussions. Let us not reinvent the wheel!

In particular: one bbox, one CRS!

jerstlouis commented 2 years ago

@pebau This is only one BBOX, but as for one CRS, the multiple CRSes conceptually define "one" CRS being the continuum made up of all the components CRSes, enabling ad-hoc compounding of CRSes without the major unresolved issues of using URIs with def/crs-compound for ad-hoc compounding (clients having to either parse or actually retrieve definitions implying costly server round-trips from URIs to identify CRSes).

That is the unresolved discussion in:

KathiSchleidt commented 2 years ago

@pebau by one CRS per BBOX, are you including compound CRS?

Also, is there a limit to the number of CRS one can compound? Can one compound a 2D spatial with an additional 1D elevation plus Time, or does that break some rule?

pebau commented 2 years ago

@KathiSchleidt

@pebau by one CRS per BBOX, are you including compound CRS?

indeed, if multiple axes are to be combined then have a CRS around each (such as time) or a set of axes (such as lat/lon), and 19111 allows combination. Note: I am using this phrasing because Roger Lott has instructed us that not axes are combined in a "compound CRS", but CRSs.

Also, is there a limit to the number of CRS one can compound? Can one compound a 2D spatial with an additional 1D elevation plus Time, or does that break some rule?

no limit. Special rules may apply though, such as "no lat without lon, and vice versa". That is depending on the application.

RogerLott commented 2 years ago

@KathiSchleidt Compound CRS is defined in OGC Abstract Spec Topic 2, clause 9.3. https://docs.ogc.org/as/18-005r5/18-005r5.html#34

RogerLott commented 2 years ago

Not sure whether this comment is for this issue or elsewhere, but has the distinction between an envelope and a bounding box been discussed?

KathiSchleidt commented 2 years ago

@RogerLott don't think envelope vs. bounding box has come up yet (care to share the distinction?)

We're still trawling for existing related models, to my view should also include the extent from 19123

RogerLott commented 2 years ago

19115 (sic, metadata) defines extent. It has several components including a geographic bounding box component. That requires longitudes to be in the range −180 =< λ =< +180 degrees which is useful for distnguishing between an extent that do or do not cross the 180 meridian. My understanding that this is intended as coarse metadata for data discovery purposes. As such no specific geographic CRS is required (although in working practice WGS 84 is often assumed) so values are rarely quoted to more than 2 decimal places of a degree which at the equator is about 1km. In extreme circumstances differences in coordinate values for a point referenced to different geodetic datums can reach up to 1.5km (more usually in the order of 100m, and with modern CRSs related to ITRF will be within a metre or two). Whatever, this 19115 geographic bbox concept is not intended to be used for accurate measure of min/max limits of axes. Somewhere (?spatial schema??) the concept of an envelope is defined. The envelope bounds(lower and upper) can be given to any required coordinate resolution and be as many dimensions as the coodinate space. More or less what @jerstlouis has posted at the head of this issue. So no reason why the concept is limited to spatial dimensions. Seems to me that the concept proposed here as 'bbox' is what has previously been called an envelope and is a different concept to the geographic bbox of 19115. If this is the case, IMHO having two different concepts differentiated only by the presence or absence of the adjective geographic is going to cause confusion.

samadammeek commented 2 years ago

I think Envelope is 19107 Spatial Schema - has coords lowerCorner + upperCorner of type DirectPosition.

19115 Bounding Box uses extent with temporal, vertical, and geographic extent. I think they're trying to achieve different things. Envelope appears to offer the ability to determine CRS, but BBOX does not? The positions in BBOX are lat/long? (I think my understanding fits with @RogerLott)

pebau commented 2 years ago

Seems to me that the concept proposed here as 'bbox' is what has previously been called an envelope and is a different concept to the geographic bbox of 19115. If this is the case, IMHO having two different concepts differentiated only by the presence or absence of the adjective geographic is going to cause confusion.

Actually, I find this quite natural: the bbox is n-D, the geographic bbox is a bbox restricted to the geographic dimensions.

BTW, a bbox may be associated with an object it describes; in this case it must span all dimensions of the object, otherwise the object is not described completely (in coverages, a bbox may be used to describe the domain set). Or a bbox is freestanding, such as in coverage subsetting operations; in this case, it may have less dimensions than the object addressed. (But not more - you cannot subset along dimensions not present in an object.)

KathiSchleidt commented 2 years ago

Still confused as to any subtle difference between BBox, Envelope & Extent. Something in the back of my brain is telling me that some of these options require the strict minimal size, while others are content with being somehow around.

@pebau on geographic vs. vanilla bbox, I'd see an n-D bbox with >=2 spatial axes as a geographic n-D bbox - does this break something?

pebau commented 2 years ago

@KathiSchleidt not necessarily. The axes say it explicitly - "geo" for many means there are 2 somehow ;-) perpendicular horizontal axes; if the CRS contains such axes, it is ok. If not...well, if there is height and time (borehole timeseries!) it is still geo, right? Without any of these we might call it non-geo.

Personally, the "geo" property doesn't matter much to me technically, it is just a loose characterization. When is geo statistics "geo"? ;-)

pebau commented 2 years ago

@KathiSchleidt "strict minimal size" again is a loose term, sorry. Some cases to illustrate:

Just to contribute to confusion :)

RogerLott commented 2 years ago

@KathiSchleidt An extent (with a small e) can be spatial, temporal, parametric, spatio-temporal, spatio-parametric, parametric-temporal or spatio-temporal-parametric, that is is does not matter what the axes or dimensions are. Its minima and maxima can be described through the lower and upper bounds of an Envelope

Within ISO 19115 (geographic information metadata) there is an EX_Extent class. It is not quite the same as an extent with a small e (an Envelope) as it is a bit more constrained. Its elements are spatial and/or temporal and/or spatio-temporal and/or a textual description. The spatial element is in a horizontal+vertical or 2D+1D paradigm, divided into geographic and vertical. The geographic element can be either a bounding polygon or a geographic bounding box. This geographic bounding box is what I described earlier, 2D latitude and longitude without any defined CRS. The term is often abbreviated just to bounding box or bbox. The vertical element does require a (vertical) CRS identification.

What is missing from EX_Extent compared to extent with an Envelope? No parametric (so the minima and maxima for e.g. a pressure axis cannot be described). No ability to describe the spatial extent in terms of a projected CRS, geographic 3D, geocentric CRS or engineering (local) CRS. No ability to identify the CRS(s) except for any 1D vertical CRS element. Temporal extent is limited to periods described using ISO 8601 (date time), so unable to say e.g. "from lower_bound seconds to upper_bound seconds POSIX time" or identify a temporal CRS defining POSIX time. No ability to identify coordinate epoch for dynamic CRSs.

When somebody mentions a bounding box I immediately assume they mean an EX_Extent geographic bounding box rather than an Envelope. I may not be alone in making this assumption.

So what is this issue trying to solve? There already are models for EX_Extent and for Envelope (although Envelope is described in spatial schema, its concept has applicability to non-spatial). Is this issue trying to modify the EX_Extent model to become the Envelope model? Or to be able to use any CRS? Or add ways of dealing with multiple smaller EX_Extents/Envelopes? Or dealing with wrap-around for some axes (particularly longitude)? All of the above?

KathiSchleidt commented 2 years ago

@pebau you still haven't quite answered my question on strict minimal surrounding thingy vs. just surrounding thingy.

Its clear that the size of this thingy can change depending on CRS (as least with a rectilinear thingy, if you shift the axes you get a different shape/size)

What I'm looking for has more to do with the specification, must this thingy be the absolute minimum size, taking the foreseen axes into account, or does it suffice that all points are contained within this thingy?

KathiSchleidt commented 2 years ago

@RogerLott Trying to pull out the essence of these different thingies, found the following:

extent, aka Envelope:

EX_Extent (ISO 19115, intended as coarse metadata for data discovery purposes):

geographic bounding box:

Bounding Box: General assumption EX_Extent geographic bounding box rather than an Envelope

Question: how is the textual description encoded under EX_Extent?

What is this issue trying to solve? Think this is up to @chris-little to define, but based on the degree of confusion here, I do believe that a common model would be valuable.

Given the similarities & differences between extent/Envelope vs. EX_Extent, I'm wondering if a common model would be possible, providing stricter constraints on extent/Envelope while maintaining structural alignment between these 2 highly related concepts.

pebau commented 2 years ago

@KathiSchleidt I'd need to check the "minimum" requirement in 19107, don't know that.

Mind you: in coverages a bbox is not a first-class citizen concept, it is just an auxiliary construct (i) for getting a rapid overview on location and (ii) together with further information (resolution) a shorthand for describing a domain set. The domain set is what matters, and there are many ways of describing that, depending on coverage type etc.

That said: In coverages at least we can say that the bbox of a regular grid must not exceed the minimum bbox by 1 pixel resolution or more - because otherwise another row of direct positions would be included in the grid described by the bbox.

pebau commented 2 years ago

so EX_EXTENT not having a CRS is a big NoNoNoDoNotUseThis

Here is an example for coordinates published without CRS: {{{ Breitengrad: 48° 16' 44'' N Längengrad: 13° 37' 43'' O }}} WGS84? not likely in Europe. GPS? Some UTM zone?

cnreediii commented 2 years ago

Quite the conversation! The following is a bit tongue in check but . . .

Life was so much simpler back in the late 1970's when I designed and programmed MOSS :-) The GIS community back then called the "thingy" a minimum bounding rectangle (MBR). The MBR was computed from the coordinate set of a given feature geometry. The MBR was oriented to the axis of the CRS in which the feature geometry coordinates were stored, in the US usually UTM, State Plane, or Lat/Long. Done! One has to remember what the primary use cases were for having MBRs - spatial search/filtering. Simple to compute. Simple to store. Simple to use.

One can go the next step and compute the minimum bounding box. In computational geometry, the smallest enclosing box problem is that of finding the oriented minimum bounding box enclosing a set of points. This is very useful information when doing collision detection in 2D or 3D space or some other related operation.

Apparently life has gotten more complex in the geo world thanks to standards :-)

samadammeek commented 2 years ago

@KathiSchleidt re: value in common model.

If we were to create one, what job would it do for us?

KathiSchleidt commented 2 years ago

@samadammeek

In bitchy witch mode, I'd answer: what job do any standards do for us? ;)

On a more serious note, as BB models seem to crop up across OGC standards (both in the spatial search/filtering context used by OWS/APIs, as well as some data specifications, e.g., Coverage Extent), I think it would make it easier to utilize multiple standards if there were a consistent model. In addition, the utter lack of clarity we've been getting from the experts here (reason why I did the longer post above trying to collect what folks think they're thinking) tells me that we have a problem that needs solving.

chris-little commented 2 years ago

Which is why I drafted some text for an abstract, dimension independent, definition of a bounding box. The conversation above has helpfully produced a detailed deep dive into existing definitions, some of which are concrete specialisations rather than abstract. One firm conclusion seems to be: one CRS + one object => one minimal (unique) bounding box (CRS axes aligned) and lots of non-minimal bounding boxes. Bounding boxes are 'rectangular' and are specified by min and max coordinate values of the object on each CRS Axis. The dimensions of the bbox may be reduced to the dimensions of the object, but whether the 'unused' dimensions are unbounded or null is not clear.

chris-little commented 2 years ago

Extent and envelope seem rather more fluid in accepted abstract definitions, though there seem to be plenty of concrete ones, but nobody has debated convex hull which is unique for each object, and independent of any specific CRS. Whether is can be usefully used outside of mathematics is not clear.