Opened 7 years ago
Closed 7 years ago
#1550 closed defect (fixed)
WCPS_Nodata value in intervals is error
Reported by: | Bang Pham Huu | Owned by: | Bang Pham Huu |
---|---|---|---|
Priority: | major | Milestone: | 9.5 |
Component: | petascope | Version: | development |
Keywords: | Cc: | Dimitar Misev, Vlad Merticariu | |
Complexity: | Medium |
Description
Current nodata as extra parameter in WCPS works with separate values, such as:
for c in (test_mean_summer_airtemp) return encode(c[Lat(-20:-20), Long(120:121)], "tiff", "{ \"nodata\": [0, 1, 2 , 3], \"geoReference\":{\"crs\":\"EPSG:4326\"} }")
but not with intervals, such as:
for c in (test_mean_summer_airtemp) return encode(c[Lat(-20:-20), Long(120:121)], "tiff", "{ \"nodata\": [0:1, 1:2, 3:4], \"geoReference\":{\"crs\":\"EPSG:4326\"} }")
It needs to fix the NoData model class in Petascope to deserialize JSON input string correctly.
Change History (4)
comment:1 by , 7 years ago
comment:2 by , 7 years ago
Resolution: | → invalid |
---|---|
Status: | new → closed |
comment:3 by , 7 years ago
Resolution: | invalid |
---|---|
Status: | closed → reopened |
I discussed with Dimitar and actually the nilValues in GDAL must be separated, so if one imports coverage with a double nilValue, wcst_import will round it with floor:ceil (such as: 10.00001 to 10:11) and stored in petascopedb.
with a WCPS, nilValue is passed internally as a mandatory parameter beside CRS, e.g: nodata=[10:11] but it is not valid so Dimitar suggested:
in encode you don't specify a null value if there's something like 0:1 but if it's 0:0 you take 0
Then WCPS need to handle this case for nilValues in interval.
comment:4 by , 7 years ago
Resolution: | → fixed |
---|---|
Status: | reopened → closed |
I managed to ingest the case in comment:3 when the nilValues are double for test_rgb with first 2 bands and an integer for the third band, the DescribeCoverage like this:
swe:field name="red"> <swe:Quantity> <swe:nilValues> <swe:NilValues> <swe:nilValue reason="">-100</swe:nilValue> <swe:nilValue reason="">-99</swe:nilValue> </swe:NilValues> </swe:nilValues> <swe:uom code="10^0"/> </swe:Quantity> </swe:field> <swe:field name="green"> <swe:Quantity> <swe:nilValues> <swe:NilValues> <swe:nilValue reason="">20</swe:nilValue> <swe:nilValue reason="">21</swe:nilValue> </swe:NilValues> </swe:nilValues> <swe:uom code="10^0"/> </swe:Quantity> </swe:field> <swe:field name="blue"> <swe:Quantity> <swe:nilValues> <swe:NilValues> <swe:nilValue reason="">35</swe:nilValue> </swe:NilValues> </swe:nilValues> <swe:uom code="10^0"/> </swe:Quantity>
and Rasql from the WCPS query (for c in (test_rgb1) retur nencode(c, "png")) will have nodata with only the first value for each band from the WcpsCoverageMetadata class and getNodata method (line 152).
\"nodata\":[-100,20,35]}
so it can be closed.
This is not valid JSON:
\"nodata\": [0:1, 1:2, 3:4]