Changes between Version 6 and Version 7 of PetascopeSubsets
- Timestamp:
- Feb 28, 2014, 1:23:31 PM (11 years ago)
Legend:
- Unmodified
- Added
- Removed
- Modified
-
PetascopeSubsets
v6 v7 1 1 = Subsets in Petascope = 2 2 3 In this page we will describe how subsets (trims and slices) are treated by ''Petascope''. Before this you will have to understand how the topology of a grid coverage is interpreted with regards to its origin, its bounding-box and the assumptions on the sample space . Some practical examplewill then be proposed.3 In this page we will describe how subsets (trims and slices) are treated by ''Petascope''. Before this you will have to understand how the topology of a grid coverage is interpreted with regards to its origin, its bounding-box and the assumptions on the sample spaces of the points. Some practical examples will then be proposed. 4 4 5 5 6 6 == Geometric interpretation of a coverage 7 7 8 This section will focus on how the topology of a grid coverage is stored in the metadata database and how Petascopeinterprets it.8 This section will focus on how the topology of a grid coverage is stored in the metadata database and how ''Petascope'' interprets it. 9 9 For point-clouds (multipoint coverages, in the GML realm), the subject is straightforward: each point is a 0D element (please not that bbox description of point-clouds are currently not implemented: see #571). 10 10 11 When it comes to the so-called ''domainSet'' of a coverage (hereby also called domain, topology or geometry), the metadata database (`petascopedb`) follows pretty much the GML model for rectified grids: the grid origin and one offset vector per grid axis are enough to deduce the full ''domainSet'' of such (regular) grids. When it comes to referenceable grids, the ''domainSet'' still is kept in a compact vectorial form by adding weighting coefficients to one or more offset vectors. For more on this pleaserefer to the [PetascopeUserGuide user guide].12 13 ''What is a grid? :: As by [http://www.opengeospatial.org/standards/gml GML standard] a grid is a ''"network composed of two or more sets of curves in which the members of each set intersect the members of the other sets in an algorithmic way"''. The intersections of the curves are represented by points: a point is 0D and is defined by a single coordinate tuple and implements ISO:19107 `GM_Point` (see D.2.3.3 and ISO 19107:2003, 6.3.11).14 15 A first question arises on where to put the grid '''origin'''. The [https://portal.opengeospatial.org/files/?artifact_id=48553 GMLCOV standard] saysthat the mapping from the domain to the range (feature space, payload, values) of a coverage is specified through a function, formally a `gml:coverageFunction`. We do not currently support the configuration of such function, whereas we stick to the default mapping which is indeed assumed when no coverage function is described. From the GML standard: ''"If the `gml:coverageFunction` property is omitted for a gridded coverage (including rectified gridded coverages) the `gml:startPoint` is assumed to be the value of the `gml:low` property in the `gml:Grid` geometry, and the `gml:sequenceRule` is assumed to be linear and the `gml:axisOrder` property is assumed to be `+1 +2`"''.11 When it comes to the so-called ''domainSet'' of a coverage (hereby also called domain, topology or geometry), the metadata database (`petascopedb`) follows pretty much the GML model for rectified grids: the grid origin and one offset vector per grid axis are enough to deduce the full ''domainSet'' of such (regular) grids. When it comes to referenceable grids, the ''domainSet'' still is kept in a compact vectorial form by adding weighting coefficients to one or more offset vectors. For more on coefficients refer to the [PetascopeUserGuide user guide]. 12 13 ''What is a grid? :: As by [http://www.opengeospatial.org/standards/gml GML standard] a grid is a ''"network composed of two or more sets of curves in which the members of each set intersect the members of the other sets in an algorithmic way"''. The intersections of the curves are represented by points: a point is 0D and is defined by a single coordinate tuple (see ISO:19107 `GM_Point`). 14 15 A first question arises on where to put the grid '''origin'''. The GML and [https://portal.opengeospatial.org/files/?artifact_id=48553 GMLCOV] standards say that the mapping from the domain to the range (feature space, payload, values) of a coverage is specified through a function, formally a `gml:coverageFunction`. We do not currently support the configuration of such function, whereas we stick to the default mapping which is indeed assumed when no coverage function is described. From the GML standard: ''"If the `gml:coverageFunction` property is omitted for a gridded coverage (including rectified gridded coverages) the `gml:startPoint` is assumed to be the value of the `gml:low` property in the `gml:Grid` geometry, and the `gml:sequenceRule` is assumed to be linear and the `gml:axisOrder` property is assumed to be `+1 +2`"''. 16 16 17 17 To better understand this, the following image is showing the difference between a ''linear'' sequence rule (what we adopt) and an other kind of mapping, the so-called ''boustrophedonic'' (check out [http://www.schemacentral.com/sc/niem20/e-gml_sequenceRule-1.html this] page for other available rules): … … 20 20 21 21 In the image, it is assumed that the first grid axis (`+1`) is the horizontal axis, while the second (`+2`) is the vertical axis; the grid starting point is the full diamond. 22 23 22 Sticking to the linear sequence rule was the best choice for `rasdaman` since that is the same rule which `rasdaman` itself uses to print the values of cells in an collection/marray. 23 24 24 Coming back to the origin question on where to put the origin of our grid coverages, we have to make it coincide to what the starting value represents in `rasdaman`, the marray origin. 25 26 25 As often done in GIS applications, the origin of an image is set to be its upper-left corner: this finally means that the origin of our rectified and referenceable grid coverages shall be there too in order to provide a coherent GML/GMLCOV coverage, where the domain is really mapped to the range of the coverage with the default coverage function. Note that placing the origin in the upper-left corner of an image means that the offset vector along the northing axis will point South, hence will have negative norm (in case the direction of the CRS axis points North!). 27 26 28 When it comes to further dimensions (a third elevation axis, time, etc.), the position of the origin depends on the way data has been ingested. Taking the example of a time series, if the marray origin (which we can denote as `[0:0:__:0]`, though it is more precisely described as `[dom.lo[0]:dom.lo[1]:__:dom.lo[n]`) is the earliest moment in time, then the grid origin will be the ea sliest moment in the series, and the offset vector in time will point to the future (positive norm); in the other case, the origin will be the latest time in the series, and its vector will point to the past (negative norm).27 When it comes to further dimensions (a third elevation axis, time, etc.), the position of the origin depends on the way data has been ingested. Taking the example of a time series, if the marray origin (which we can denote as `[0:0:__:0]`, though it is more precisely described as `[dom.lo[0]:dom.lo[1]:__:dom.lo[n]`) is the earliest moment in time, then the grid origin will be the earliest moment in the series too, and the offset vector in time will point to the future (positive norm); in the other case, the origin will be the latest time in the series, and its vector will point to the past (negative norm). 29 28 30 29 To summarize, in ''any'' case '''the grid origin must point to the marray origin'''. This is important in order to properly implement our linear sequence rule. … … 34 33 35 34 In spite of this, there is no formal way to describe GML-wise the footprint of the points of a grid. 36 While the configuration of sample spaces is still just on thewishlist (see #680), our current policy applies distinct choices separately for each grid ''axis'', in the following way:37 38 * ''regular axis'': when a grid axis as equal spacing between each of its points, then it is assumed that the sample space of the points is equal to this spacing (resolution) and that the grid points are in the middle of this interval;39 * ''irregular axis'': when a grid axis as an uneven spacing between its points, then there is no (currently implemented) way to either express or deduce its sample space, hence 0D points are assumed here (no footprint).40 41 Such policy translated in practice to a ''point-is-pixel-center'' interpretation of regular rectified images. The following art explains it visually:35 While the configuration of sample spaces is still just on our wishlist (see #680), our current policy applies distinct choices separately for each grid ''axis'', in the following way: 36 37 * ''regular axis'': when a grid axis has equal spacing between each of its points, then it is assumed that the sample space of the points is equal to this spacing (resolution) and that the grid points are in the middle of this interval; 38 * ''irregular axis'': when a grid axis has an uneven spacing between its points, then there is no (currently implemented) way to either express or deduce its sample space, hence 0D points are assumed here (no footprint). 39 40 Such policy is translated in practice to a ''point-is-pixel-center'' interpretation of regular rectified images. The following art explains it visually: 42 41 43 42 {{{ … … 74 73 The left-side grid is the GML coverage model for a regular grid: it is a network of (rectilinear) curves, whose intersections determine the grid points `'+'`. The description of this model is what `petascopedb` knows about the grid. 75 74 76 The right-hand grid is instead how ''Petascope'' intepre sts the information in `petascopedb`, and hence is the coverage that is seen by the enduser. You can see that, being this a regular grid, sample spaces (pixels) are added in the preception of the coverage, causing an extension of the bbox (`gml:boundedBy`) of half-pixel on all sides. The width of the pixel is assumed to be equal to the (regular) spacing of the grid points, hence each pixel is of size `|v_0| x |v_1|`, being `|*|` the norm operator.77 78 As a final example, imagine that we take this regular 2D pattern and we build a s eriesof such images on irregular levels of altitude:75 The right-hand grid is instead how ''Petascope'' inteprets the information in `petascopedb`, and hence is the coverage that is seen by the enduser. You can see that, being this a regular grid, sample spaces (pixels) are added in the perception of the coverage, causing an extension of the bbox (`gml:boundedBy`) of half-pixel on all sides. The width of the pixel is assumed to be equal to the (regular) spacing of the grid points, hence each pixel is of size `|v_0| x |v_1|`, being `|*|` the norm operator. 76 77 As a final example, imagine that we take this regular 2D pattern and we build a stack of such images on irregular levels of altitude: 79 78 80 79 {{{ … … 102 101 }}} 103 102 104 In `petascopedb` we will need to add an other axis to the coverage topology, assigning a vector to it, `v_2` (we support `gmlrgrid:ReferenceableGridByVectors` only, hence each axis of any kind of grid will have a vector). Weighting coefficients will then determine the height of each new z-level of the cube: such heights are encoded as distance from the grid origin `'#'` normalized by the offset vector `v_2`. Please note that the vector of northings `v_1` is not visible due toperspective: the image is showing the XZ plane.103 In `petascopedb` we will need to add an other axis to the coverage topology, assigning a vector `'v_2'` to it (we support `gmlrgrid:ReferenceableGridByVectors` only, hence each axis of any kind of grid will have a vector). Weighting coefficients will then determine the height of each new z-level of the cube: such heights are encoded as distance from the grid origin `'#'` normalized by the offset vector `v_2`. Please note that the vector of northings `v_1` is not visible due to the 2D perspective: the image is showing the XZ plane. 105 104 106 105 Regarding the sample spaces, while ''Petascope'' will still assume the points are pixels on the XY plane (eastings/northings), it will instead assume 0D footprint ''along'' Z, that is along height: this means that the extent of the cube along height will exactly fit to the lowest and highest layers, and that input Z slices will have to select the exact value of an existing layer. 107 106 108 The latter woul snot hold on regular axes: this is because input subsets are targeting the sample spaces, and not just the grid points, but this is covered more deeply in the following section.107 The latter would not hold on regular axes: this is because input subsets are targeting the sample spaces, and not just the grid points, but this is covered more deeply in the following section. 109 108 110 109 … … 118 117 ''Requirement 38'' of the [http://portal.opengeospatial.org/files/?artifact_id=48428 WCS Core] standard (OGC 09-110r4) specifies that a /subset/ is a '''closed interval'''. 119 118 120 A subsequent question is whether to apply the subsets on the coverage ''points'' or on their ''footprints'' ? While the WCS standard does not provide recommendations, we decided consider the sample spaces, being it a much more intuitive behavior for users who might ignore the internal representation of an image and doesnot want to lose that "half-pixel" that would inevitably get lost if footprints were to be ignored.119 A subsequent question is whether to apply the subsets on the coverage ''points'' or on their ''footprints''. While the WCS standard does not provide recommendations, we decided to target the sample spaces, being it a much more intuitive behavior for users who might ignore the internal representation of an image and do not want to lose that "half-pixel" that would inevitably get lost if footprints were to be ignored. 121 120 122 121 We also consider here ''"right-open sample spaces"'', so the borders of the footprints are not all part of the footprint itself: this means that two adjacent footprints will not ''share'' the border, which will instead belong to the greater point (so typically on the right side in the CRS space). A slice exactly on that border will then pick the right-hand "greater" point only . Border-points instead always include the external borders of the footprint: slices right on the native BBOX of the whole coverage will pick the border points and will not return an exception. … … 128 127 Please note that before version 9.0 of `rasdaman` the ''request bounding box'' is returned instead by ''Petascope''. 129 128 130 Practical examples will now follow. For open discussions on such policies for ''Petascope''you are suggested to reply to [https://groups.google.com/d/msg/rasdaman-users/3Zaz6snbtgU/KSsEj2oIqAIJ this] post in our mailing list.129 Practical examples will now follow. For open discussions on the policies we adopted, you are suggested to reply to [https://groups.google.com/d/msg/rasdaman-users/3Zaz6snbtgU/KSsEj2oIqAIJ this] post in our mailing list. 131 130 132 131 … … 135 134 In this section we will examine the intepretation of subsets by ''Petascope'' by taking different subsets on a single dimension of 2D coverage. To appreciate the effect of sample spaces, we will first assume regular spacing on the axis, and then irregular 0D-footprints. 136 135 137 Coverage information:136 Test coverage information: 138 137 139 138 {{{ … … 189 188 }}} 190 189 191 Applying these subsets to `mean_summer_airtemp` will haveproduce the following responses:190 Applying these subsets to `mean_summer_airtemp` will produce the following responses: 192 191 193 192 {{{ … … 207 206 KEY 208 207 o = grid point 208 209 209 [=s=] = subset 210 210 [ = subset.lo … … 231 231 }}} 232 232 233 Applying these subsets to `mean_summer_airtemp` will haveproduce the following responses (please note tickets #<bbox>, and #<slices>):233 Applying these subsets to `mean_summer_airtemp` will produce the following responses (please note tickets #<bbox>, and #<slices>): 234 234 235 235 {{{