Changes between Version 4 and Version 5 of PetascopeSubsets


Ignore:
Timestamp:
Feb 28, 2014, 12:10:49 PM (10 years ago)
Author:
Piero Campalani
Comment:

examples.

Legend:

Unmodified
Added
Removed
Modified
  • PetascopeSubsets

    v4 v5  
    118118''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'''.
    119119
    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 does not want to los that "half-pixel" that would inevitably get lost if footprints were to be ignored.
    121 We also consider here ''"closed sample spaces"'', so the borders of the footprints are all part of the footprint itself: jointly with the "closed interval" WCS requirement, this means for instance that two adjacent footprints ''share'' the border and a slice of trim bound right on that border will pick both grid points.
     120A 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 does not want to lose that "half-pixel" that would inevitably get lost if footprints were to be ignored.
     121
     122We 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.
    122123
    123124Clarified this, the last point is how coverage bounds are set before shipping, with respect to the input subsets. That means whether our service should return the ''request bounding box'' or the ''minimal bounding box''.
    124125
    125 Following the (strong) encouragement in the WCS standard itself (`NOTE` paragraph to requirement 38), ''Petascope'' will fit the input subsets to the extents of sample spaces (e.g. to the pixel areas). This means that the input bbox will usually be extended to the next footprint border. This is also a consequence of our decision to apply subsets on footprints: a value which ''lies'' inside a pixel will always select the associated grid point, even if the position of the grid point is actually outside of the subset interval.
     126Following the (strong) encouragement in the WCS standard itself (`NOTE` paragraph to requirement 38), ''Petascope'' will fit the input subsets to the extents of sample spaces (e.g. to the pixel areas), thus returning the '''minimal bounding box'''. This means that the input bbox will usually be extended to the next footprint border. This is also a consequence of our decision to apply subsets on footprints: a value which ''lies'' inside a pixel will always select the associated grid point, even if the position of the grid point is actually outside of the subset interval.
    126127
    127128Please note that before version 9.0 of `rasdaman` the ''request bounding box'' is returned instead by ''Petascope''.
     
    132133== Examples
    133134
    134 This is probably better understood by means of examples:
    135 
    136 {{{
    137 #!sh
     135In 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
     137Coverage information:
     138
     139{{{
    138140--------------------
    139141mean_summer_airtemp (EPSG:4326)
    140 [0:885, 0:710]
    141 x(111.975, 156.275)
    142 y(-44.525, -8.975)
    143 res(0.05, 0.05)
     142Size is 886, 711
     143Pixel Size = (0.050000000000000,-0.050000000000000)
     144Upper Left  ( 111.9750000,  -8.9750000)
     145Lower Left  ( 111.9750000, -44.5250000)
     146Upper Right ( 156.2750000,  -8.9750000)
     147Lower Right ( 156.2750000, -44.5250000)
    144148--------------------
    145 
    146    130.975  131.025  131.075  131.125  131.175
    147 X:  ...o--------o--------o--------o--------o...
    148          cell380  cell381  cell382  cell383
    149           [s1]
    150        [== s2 ==]
    151          [==== s3 ====]
    152          [======== s4 =======]
    153     [=================== s5 ===================] (BEYOND BBOX)
    154 
    155     -22.975  -22.925  -22.875  -22.825  -22.795
    156 Y:  ...o--------o--------o--------o--------o...
    157          cell280  cell279  cell278  cell277
    158           [s1]
    159        [== s2 ==]
    160          [==== s3 ====]
    161          [======== s4 =======]
    162     [=================== s5 ===================] (BEYOND BBOX)
    163 
    164 s1: m[380:380, 280:280]
    165  - for m in (mean_summer_airtemp) return encode(trim(m, {x(131:131.01), y(-22.951:-22.95)}),"csv")
    166  - http://localhost:8080/petascope/wcs2?
    167       service=WCS&version=2.0.0&request=GetCoverage&coverageid=mean_summer_airtemp&
    168       subset=x(131,131.01)&subset=y(-22.951,-22.95)
    169 
    170 s2: m[380:381, 279:280]
    171  - for m in (mean_summer_airtemp) return encode(trim(m, {x(130.975:131.025), y(-22.975:-22.925)}),"csv")
    172  - http://localhost:8080/petascope/wcs2?
    173       service=WCS&version=2.0.0&request=GetCoverage&coverageid=mean_summer_airtemp&
    174       subset=x(130.975,131.025)&subset=y(-22.975,-22.925)
    175 
    176 s3: m[380:381, 279:280]
    177  - for m in (mean_summer_airtemp) return encode(trim(m, {x(131:131.05), y(-22.95:-22.9)}),"csv")
    178  - http://localhost:8080/petascope/wcs2?
    179       service=WCS&version=2.0.0&request=GetCoverage&coverageid=mean_summer_airtemp&
    180       subset=x(131,131.05)&subset=y(-22.95,-22.9)
    181 
    182 s4: m[380:382, 278:280]
    183  - for m in (mean_summer_airtemp) return encode(trim(m, {x(131:131.1), y(-22.95:-22.85)}),"csv")
    184  - http://localhost:8080/petascope/wcs2?
    185       service=WCS&version=2.0.0&request=GetCoverage&coverageid=mean_summer_airtemp&
    186       subset=x(131,131.1)&subset=y(-22.95,-22.85)
    187 
    188 s5: m[0:885, 0:710]
    189  - for m in (mean_summer_airtemp) return encode(trim(m, {x(100:200), y(-50:50)}),"csv")
    190  - http://localhost:8080/petascope/wcs2?
    191       service=WCS&version=2.0.0&request=GetCoverage&coverageid=mean_summer_airtemp&
    192       subset=x(100,200)&subset=y(-50,50)
    193 
    194 -=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
    195 
    196 TIME AXIS EXAMPLE:
    197 
    198      09h20    10h20    11h20    12h20    13h20
    199 T:     o--------o--------o--------o--------o
    200           cell0    cell1    cell2    cell3
    201           [s1]
    202        [== s2 ==]
    203          [==== s3 ====]
    204          [======== s4 =======]
    205     [=================== s5 ===================]
    206 
    207 ------------------------------------------------------------------------------------------------
    208 s1: (9h25,9h30) --> [LOx:HIx, LOy:HIy, 0:0]
    209  - http://localhost:8080/petascope/wcs2?
    210      service=WCS&version=2.0.0&request=GetCoverage&coverageid=MODIS_33N_2010170_WGS84&
    211      subset=x(10,11)&subset=y(45,46)&subset=t(2010-06-19T09:25,2010-06-19T09:30)
    212  - for c in (MODIS_33N_2010170_WGS84) return encode(
    213     trim(
    214       c,{t:"http://www.opengis.net/def/crs/ISO/0/8601"                        ("2010-06-19T09:25":"2010-06-19T09:30"),
    215          y:"http://kahlua.eecs.jacobs-university.de:8080/def/crs/EPSG/0/4326" (45:46),
    216          x:"http://kahlua.eecs.jacobs-university.de:8080/def/crs/EPSG/0/4326" (10:11)}),
    217   "csv")
    218 ------------------------------------------------------------------------------------------------
    219 s2: (9h20,10h20) --> [LOx:HIx, LOy:HIy, 0:1]
    220  - http://localhost:8080/petascope/wcs2?
    221       service=WCS&version=2.0.0&request=GetCoverage&coverageid=MODIS_33N_2010170_WGS84&
    222       subset=x(10,11)&subset=y(45,46)&subset=t(2010-06-19T09:20,2010-06-19T10:20)
    223  - for c in (MODIS_33N_2010170_WGS84) return encode(
    224     trim(
    225       c,{t:"http://www.opengis.net/def/crs/ISO/0/8601"                        ("2010-06-19T09:20":"2010-06-19T10:20"),
    226          y:"http://kahlua.eecs.jacobs-university.de:8080/def/crs/EPSG/0/4326" (45:46),
    227          x:"http://kahlua.eecs.jacobs-university.de:8080/def/crs/EPSG/0/4326" (10:11)}),
    228   "csv")
    229 ------------------------------------------------------------------------------------------------
    230 s3: (10h00,11h00) --> [LOx:HIx, LOy:HIy, 0:1]
    231  - http://localhost:8080/petascope/wcs2?
    232       service=WCS&version=2.0.0&request=GetCoverage&coverageid=MODIS_33N_2010170_WGS84&
    233       subset=x(10,11)&subset=y(45,46)&subset=t(2010-06-19T10:00,2010-06-19T11:00)
    234  - for c in (MODIS_33N_2010170_WGS84) return encode(
    235     trim(
    236       c,{t:"http://www.opengis.net/def/crs/ISO/0/8601"                        ("2010-06-19T10:00":"2010-06-19T11:00"),
    237          y:"http://kahlua.eecs.jacobs-university.de:8080/def/crs/EPSG/0/4326" (45:46),
    238          x:"http://kahlua.eecs.jacobs-university.de:8080/def/crs/EPSG/0/4326" (10:11)}),
    239   "csv")
    240 ------------------------------------------------------------------------------------------------
    241 s4: (9h30,11h50) --> [LOx:HIx, LOy:HIy, 0:2]
    242  - http://localhost:8080/petascope/wcs2?
    243       service=WCS&version=2.0.0&request=GetCoverage&coverageid=MODIS_33N_2010170_WGS84&
    244       subset=x(10,11)&subset=y(45,46)&subset=t(2010-06-19T09:30,2010-06-19T11:50)
    245  - for c in (MODIS_33N_2010170_WGS84) return encode(
    246     trim(
    247       c,{t:"http://www.opengis.net/def/crs/ISO/0/8601"                        ("2010-06-19T09:30":"2010-06-19T11:50"),
    248          y:"http://kahlua.eecs.jacobs-university.de:8080/def/crs/EPSG/0/4326" (45:46),
    249          x:"http://kahlua.eecs.jacobs-university.de:8080/def/crs/EPSG/0/4326" (10:11)}),
    250   "csv")
    251 ------------------------------------------------------------------------------------------------
    252 s5: (9h00,14h00) --> [LOx:HIx, LOy:HIy, 0:3]
    253  - http://localhost:8080/petascope/wcs2?
    254       service=WCS&version=2.0.0&request=GetCoverage&coverageid=MODIS_33N_2010170_WGS84&
    255       subset=x(10,11)&subset=y(45,46)&subset=t(2010-06-19T09:00,2010-06-19T14:00)
    256  - for c in (MODIS_33N_2010170_WGS84) return encode(
    257     trim(
    258       c,{t:"http://www.opengis.net/def/crs/ISO/0/8601"                        ("2010-06-19T09:00":"2010-06-19T14:00"),
    259          y:"http://kahlua.eecs.jacobs-university.de:8080/def/crs/EPSG/0/4326" (45:46),
    260          x:"http://kahlua.eecs.jacobs-university.de:8080/def/crs/EPSG/0/4326" (10:11)}),
    261   "csv")
    262 ------------------------------------------------------------------------------------------------
    263 }}}
     149}}}
     150
     151From this geo-information we deduce that the grid origin, which has to be set in the upper-left corner of the image, in the centre of the pixel are, will be:
     152
     153{{{
     154   origin(mean_summer_airtemp) = [ (111.975 + 0.025) ,  (-8.975 - 0.025) ]
     155                               = [           112.000 ,            -9.000 ]
     156}}}
     157
     158It is also reminded that ''Petascope'' will display `[-9,112]` as grid origin, since it strictly follows the order of axis defined in the WGS84 CRS. See [http://www.ogcnetwork.net/node/491 this] OGC policy and our [PetascopeUserGuide user guide] for more insights.
     159
     160=== Regular axis: point is area
     161
     162{{{
     163  KEY
     164       o = grid point
     165       | = footprint border
     166   [=s=] = subset
     167       [ = subset.lo
     168       ] = subset.hi
     169
     170_______________________________________________________________________
     171
     172         112.000   112.050   112.100   112.150   112.200
     173Long:  |----o----|----o----|----o----|----o----|----o----|-- -- -
     174          cell0     cell1     cell2     cell3     cell4
     175            [s1]
     176                 [== s2 ===]
     177                 [== s3 ==]
     178             [==== s4 ====]
     179   [== s5 ==]
     180_______________________________________________________________________
     181
     182  s1: [112.000, 112.020]
     183  s2: [112.025, 112.075]
     184  s3: [112.025, 112.070]
     185  s4: [112.010, 112.070]
     186  s5: [111.950, 112.000]
     187
     188}}}
     189
     190Applying these subsets to `mean_summer_airtemp` will have produce the following responses:
     191
     192{{{
     193        | GRID POINTS INCLUDED |  OUTPUT BOUNDING-BOX(Long)
     194   -----+----------------------+-------------------------
     195     s1 | cell0                | [ 111.975, 112.025 ]
     196     s2 | cell1, cell2         | [ 112.025, 112.125 ]
     197     s3 | cell1                | [ 112.025, 112.075 ]
     198     s4 | cell0, cell1         | [ 111.975, 112.075 ]
     199     s5 | cell0                | [ 111.975, 112.025 ]
     200}}}
     201
     202=== Irregular axis: point is point
     203
     204
     205{{{
     206  KEY
     207       o = grid point
     208   [=s=] = subset
     209       [ = subset.lo
     210       ] = subset.hi
     211
     212_______________________________________________________________________
     213
     214         112.000       112.075  112.110           112.230
     215Long:       o-------------o--------o-----------------o--- -- -
     216          cell0         cell1    cell2             cell3
     217            [s1]
     218              [== s2 ===]
     219                   [== s3 ==]
     220         [======= s4 =======]
     221   [== s5 ==]
     222_______________________________________________________________________
     223
     224  s1: [112.000, 112.020]
     225  s2: [112.010, 112.065]
     226  s3: [112.040, 112.090]
     227  s4: [111.970, 112.090]
     228  s5: [111.920, 112.000]
     229
     230}}}
     231
     232Applying these subsets to `mean_summer_airtemp` will have produce the following responses (please note tickets #<bbox>, and #<slices>):
     233
     234{{{
     235        | GRID POINTS INCLUDED |  OUTPUT BOUNDING-BOX(Long)
     236   -----+----------------------+-------------------------
     237     s1 | cell0                | [ 112.000, 112.000 ]
     238     s2 | --- (WCSException)   | [ --- ]
     239     s3 | cell1                | [ 112.075, 112.075 ]
     240     s4 | cell0, cell1         | [ 112.000, 112.075 ]
     241     s5 | cell0                | [ 112.000, 112.000 ]
     242}}}
     243
     244EOF.