Open vlandau opened 2 years ago
Thanks for the report. I'll take a closer look when I get a chance, but a couple quick notes:
resolution
, but presumably it's using proj:transform
?gdalinfo
)Thanks @TomAugspurger. I'll get the links for each STAC item and will take a look. I'll also post those links here in case you get a change to look at it as well. Will report back here shortly with those links.
Here's are the urls for the "bad" stac item:
Here's are the urls for the "good" item:
Currently downloading these to inspect with GDAL but it's taking a while.
⟩ gdalinfo data/USGS_13_n34w098.tiff
Driver: GTiff/GeoTIFF
Files: data/USGS_13_n34w098.tiff
Size is 10812, 10812
Coordinate System is:
GEOGCRS["NAD83",
DATUM["North American Datum 1983",
ELLIPSOID["GRS 1980",6378137,298.257222101004,
LENGTHUNIT["metre",1]]],
PRIMEM["Greenwich",0,
ANGLEUNIT["degree",0.0174532925199433]],
CS[ellipsoidal,2],
AXIS["geodetic latitude (Lat)",north,
ORDER[1],
ANGLEUNIT["degree",0.0174532925199433]],
AXIS["geodetic longitude (Lon)",east,
ORDER[2],
ANGLEUNIT["degree",0.0174532925199433]],
ID["EPSG",4269]]
Data axis to CRS axis mapping: 2,1
Origin = (-98.000555556293307,34.000555555795103)
Pixel Size = (0.000092592592692,-0.000092592592692)
Metadata:
AREA_OR_POINT=Area
BandDefinitionKeyword=*
DataType=*
Image Structure Metadata:
COMPRESSION=LZW
INTERLEAVE=BAND
PREDICTOR=3
Corner Coordinates:
Upper Left ( -98.0005556, 34.0005556) ( 98d 0' 2.00"W, 34d 0' 2.00"N)
Lower Left ( -98.0005556, 32.9994444) ( 98d 0' 2.00"W, 32d59'58.00"N)
Upper Right ( -96.9994444, 34.0005556) ( 96d59'58.00"W, 34d 0' 2.00"N)
Lower Right ( -96.9994444, 32.9994444) ( 96d59'58.00"W, 32d59'58.00"N)
Center ( -97.5000000, 33.5000000) ( 97d30' 0.00"W, 33d30' 0.00"N)
Band 1 Block=256x256 Type=Float32, ColorInterp=Gray
Description = Layer_1
Min=142.573 Max=403.063
Minimum=142.573, Maximum=403.063, Mean=262.266, StdDev=44.176
NoData Value=-9999
Overviews: 5406x5406, 2703x2703, 1352x1352, 676x676, 338x338
Metadata:
LAYER_TYPE=athematic
RepresentationType=*
STATISTICS_MAXIMUM=403.06253051758
STATISTICS_MEAN=262.2663938277
STATISTICS_MINIMUM=142.57325744629
STATISTICS_STDDEV=44.175693340491
STATISTICS_VALID_PERCENT=100
⟩ gdalinfo data/USGS_13_n31w103.tiff (soil_moisture)
Driver: GTiff/GeoTIFF
Files: data/USGS_13_n31w103.tiff
Size is 10812, 10812
Coordinate System is:
GEOGCRS["NAD83",
DATUM["North American Datum 1983",
ELLIPSOID["GRS 1980",6378137,298.257222101004,
LENGTHUNIT["metre",1]]],
PRIMEM["Greenwich",0,
ANGLEUNIT["degree",0.0174532925199433]],
CS[ellipsoidal,2],
AXIS["geodetic latitude (Lat)",north,
ORDER[1],
ANGLEUNIT["degree",0.0174532925199433]],
AXIS["geodetic longitude (Lon)",east,
ORDER[2],
ANGLEUNIT["degree",0.0174532925199433]],
ID["EPSG",4269]]
Data axis to CRS axis mapping: 2,1
Origin = (-103.000555555555565,31.000555555555557)
Pixel Size = (0.000092592592593,-0.000092592592593)
Metadata:
AREA_OR_POINT=Area
Image Structure Metadata:
COMPRESSION=LZW
INTERLEAVE=BAND
PREDICTOR=3
Corner Coordinates:
Upper Left (-103.0005556, 31.0005556) (103d 0' 2.00"W, 31d 0' 2.00"N)
Lower Left (-103.0005556, 29.9994444) (103d 0' 2.00"W, 29d59'58.00"N)
Upper Right (-101.9994444, 31.0005556) (101d59'58.00"W, 31d 0' 2.00"N)
Lower Right (-101.9994444, 29.9994444) (101d59'58.00"W, 29d59'58.00"N)
Center (-102.5000000, 30.5000000) (102d30' 0.00"W, 30d30' 0.00"N)
Band 1 Block=256x256 Type=Float32, ColorInterp=Gray
Description = Layer_1
Min=560.307 Max=1660.885
Minimum=560.307, Maximum=1660.885, Mean=962.446, StdDev=176.971
NoData Value=-999999
Overviews: 5406x5406, 2703x2703, 1352x1352, 676x676, 338x338
Metadata:
LAYER_TYPE=athematic
STATISTICS_MAXIMUM=1660.8853759766
STATISTICS_MEAN=962.4457942364
STATISTICS_MINIMUM=560.30670166016
STATISTICS_STDDEV=176.97062422337
STATISTICS_VALID_PERCENT=100
Nothing seems funny here. I'll look into the actual stac metadata now -- I didn't initially see any differences after comparing the outputs of to_dict()
, but I'll take a closer look.
Ah, looks like the transform entry in the bad item is just wrong. The math also doesn't make sense for the bounding box, transform, and dimensions (ROWxCOL).
transform for "bad" item (item.properties["transform"]
):
'proj:transform': [1e-05,
0.0,
-103.0005555556,
0.0,
-1e-05,
31.00055555556,
0.0,
0.0,
1.0]
transform, and dimensions (ROWxCOL)
transform for "good" item ( (item.properties["transform"]
):
'proj:transform': [9.2592593e-05,
0.0,
-98.0005555563,
0.0,
-9.2592593e-05,
34.0005555558,
0.0,
0.0,
1.0]
You'll notice that these don't line up with the pixel sizes that were output from gdalinfo
above, so it looks like the data are correct, but the stac metadata is not.
There are several items where this problem is arising. Based on an admittedly superficial look, all of the problem items also seem to be dated 2013.
Thanks for tracking that down. We'll look into it.
Sorry for failing to update the status here. In https://github.com/stactools-packages/threedep/pull/12, we fixed the upstream stactools package used to generate these items.
We'll need to pull that into our pipeline and regenerate all these items.
I'm noticing inconsistencies with the USGS 3DEP elevation data when trying to load tiles into DataArrays via stackstac. I posted an issue in the stackstac repo but I'm starting to think the issue might be in the item entries in the STAC itself.
I'm encountering an issue where stackstac throws an error (which appears to be because it can't find the resolution in the item). Specifying a resolution the the stackstac.stack call manually fixes that issue, but then I end up empty (0-length) indices for
band
andtime
, and a few other attributes are missing as well.Any idea what might be going on? MWEs are below.
To create the wonky DataArray:
Output:
To create a normal DataArray with a different bbox
output: