Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

NotGeoreferencedWarning after merging datasets #145

Closed
jbmuir opened this issue Feb 21, 2024 · 6 comments
Closed

NotGeoreferencedWarning after merging datasets #145

jbmuir opened this issue Feb 21, 2024 · 6 comments

Comments

@jbmuir
Copy link

jbmuir commented Feb 21, 2024

I have a list of datasets data generated using (roughly)

        data = [odc.stac.load((item,),
                           crs=crs,
                           resolution=resolution,
                           chunks={},
                           x = (xmin, xmax),
                           y = (ymin, ymax),
                           resampling="cubic_spline",
                          ) for item in items]

for a stac items items.
After merging with data_merged = xr.merge(data, compat="override"), I get a NotGeoreferencedWarning when actually trying to load the data, whereas loading the data individually does not give the warning. As far as I can tell, the combined dataset has the same spatial_ref and data.odc ... as the individual pieces.

@Kirill888
Copy link
Member

@jbmuir I have seen those warnings pop-up during reproject stages, without any ill-effects and is really an issue in odc-geo, I think, or even deeper in rasterio. Does the data actually look fine though?

Also why do you need to xr.merge over just supplying all the stac items to the load function? Curious about use-cases people have.

@jbmuir
Copy link
Author

jbmuir commented Feb 22, 2024

@Kirill888 It does look ok; the reason I need to merge after loading individually is that I'm dealing with geophysical data which have inconsistent band names within a collection (normally each asset will be a single monolithic COG describing e.g. national level gravity; a collection would be e.g. free-air anomaly, Bouguer anomaly etc). I'm building this catalog myself; maybe in the future I will change the model to have uniform assets per item although geophysical data is so heterogeneous compared to satellite imagery that you would probably end up with extremely small collections.

@Kirill888
Copy link
Member

Thanks for info @jbmuir see issue in odc-geo, you can add more details there if you'd like.

I will change the model to have uniform assets per item although geophysical data is so heterogeneous compared to satellite imagery that you would probably end up with extremely small collections.

Doesn't have to be, odc-stac does not assume that every asset is referenced by every item within a collection. So, at least in theory, you can have one large collection with all the possible bands, but individual items will only reference a subset of those each.

@mdsumner
Copy link

mdsumner commented May 1, 2024

@jbmuir any chance of a reprex? I see this in other contexts and have been trying to pin it down 👌

@mdsumner
Copy link

mdsumner commented May 1, 2024

as in, does your example return the full message like

NotGeoreferencedWarning: Dataset has no geotransform, gcps, or rpcs. The identity matrix will be returned.

I get that from rasterio when opening a dataset with geolocation arrays, i.e.

dsn = "/vsicurl/http://esgf-data1.llnl.gov/thredds/fileServer/css03_data/CMIP6/ScenarioMIP/DKRZ/MPI-ESM1-2-HR/ssp126/r1i1p1f1/SIday/siconc/gn/v20190710/siconc_SIday_MPI-ESM1-2-HR_ssp126_r1i1p1f1_gn_20150101-20191231.nc"
rasterio.open(dsn)

I can't imagine a situation where a sentinel/landsat item would have geolocation arrays, but it could also be triggered by a "none" geotransform - so maybe there's files out there that just don't have that info properly.

i.e. this will return the same error as above

rasterio.open("/vsicurl/https://static.wixstatic.com/media/8959d6_af917b5494184676952b5bc69f6d5e7b~mv2_d_14168_4343_s_3_2.png")

So, can we get the details of the stac query? (Happy to do this offline if you can't share etc).

(it also seems to only warn once per session, so be sure to run in new instances if you run both to check my claims)

@Kirill888
Copy link
Member

This is an issue with odc-geo or rasterio opendatacube/odc-geo#131 not odc-stac.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants