opengeospatial / ogc-geosparql

Public Repository for the OGC GeoSPARQL Standards Working Group
78 stars 20 forks source link

Function to project to a lower dimension #231

Closed situx closed 2 years ago

situx commented 2 years ago

We need a toproject function to project to lower dimensions

rggibb commented 2 years ago

OGC AS DGGS 2.0 defines a projectTo parameter that can be applied to any of the ZoneQuery functions defined at https://docs.ogc.org/as/20-040r3/20-040r3.html#tab-ZoneQuery. projectTo is defined as follows in 8.3.3.1.

projectTo

While this construct could be used to implement more complex spatio-temporal queries, that isn’t the intent of Query2D, and isn’t specified for ZoneQuery either.

situx commented 2 years ago

@rggibb How can this projectTo function deal with measurement coordinates like in POINT M representations in WKT? The third dimension of a point may be the z coordinate or the m coordinate depending on the definition.

rggibb commented 2 years ago

@situx In DGGS the dimensionality doesn't include a linear referenencing dimension, so they are out of scope. The premise of projectto is that the operation removes axes, rather than changing them. So by analogy in a traditional CRS coordinate space, if your initial dimensionality was defined as (lat,long,ht), projectTo is designed to reduce the dimensionalty to (lat, long) or (lat,ht) but isn't designed to achieve a projection change to a planar (x,y) coordinate space.

So what would it mean if a more general projectTo were applied in a (x,y,m) coord space? If we apply the same logical thinking then projectTo(1,1,0) would perform the operation in (x,y) space and projectTo(1,0,1) would perform the operation in (x,m) space .. is this the outcome we are looking for?

situx commented 2 years ago

I believe that would work. Then the only question for me is accessibility, i.e. whether to adopt this function or to define several functions like to2D, to2DM or sth. like that for clarity or for non-clarity because these are maybe too many functions?

rggibb commented 2 years ago

I would caution against splitting it out into multiple functions, primarily because if you did would you distinguish between 2D representing two spatial dimensions vs one spatial and one temporal, which of course could equally be 2D such as vertical and temporal - is calling all of those 2D itself a tad confusing?

What I think does have merit is retaining a single function or method but maybe improving the way it is parametised. I'd be happy to engage with the group on whether using a single 4D coord to represent the space being projected to, is over simplifying it and as a result introducing some potential confusion/complexity. For instance if you wanted to project to a (x,y) at a ht of 2, the notation is projectTo(1,1,2.0,0), but if you want to projectTo a ht of 1, there is some potential for confusion because we then have to distinguish between 1 representing a boolean 1 and 1 representing a ht of 1.0. OR to put it another way, if instead we specified it as projectTo(a,b,c,d) where a,b,c,d are each one of [T,F,n] with n a real number. That actually better represents the concept but also makes it plain that each variable can be either a boolean or a real. What does this mean for programming it? Any ideas/thoughts?