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

Error with not guessing the Resolution #112

Closed
ngducphu opened this issue Mar 27, 2023 · 3 comments
Closed

Error with not guessing the Resolution #112

ngducphu opened this issue Mar 27, 2023 · 3 comments

Comments

@ngducphu
Copy link

ngducphu commented Mar 27, 2023

Anyone has any idea how to fix this solution, I attached the code in the attachment for reference.


ValueError Traceback (most recent call last)
~\AppData\Local\Temp\ipykernel_32040\1725835586.py in
1 ## Get Sentinel-1-RTC Data
2 assests = ['vh','vv']
----> 3 train_band_values=crop_yield_data.progress_apply(lambda x: get_sentinel_data(x['Longitude'], x['Latitude'],x['Season(SA = Summer Autumn, WS = Winter Spring)'],assests), axis=1)
4 vh = [x[0] for x in train_band_values]
5 vv = [x[1] for x in train_band_values]

~\Anaconda3\lib\site-packages\tqdm\std.py in inner(df, func, *args, **kwargs)
812 # on the df using our wrapper (which provides bar updating)
813 try:
--> 814 return getattr(df, df_function)(wrapper, **kwargs)
815 finally:
816 t.close()

~\Anaconda3\lib\site-packages\pandas\core\frame.py in apply(self, func, axis, raw, result_type, args, **kwargs)
8846 kwargs=kwargs,
8847 )
-> 8848 return op.apply().finalize(self, method="apply")
8849
8850 def applymap(

~\Anaconda3\lib\site-packages\pandas\core\apply.py in apply(self)
731 return self.apply_raw()
732
--> 733 return self.apply_standard()
734
735 def agg(self):

~\Anaconda3\lib\site-packages\pandas\core\apply.py in apply_standard(self)
855
856 def apply_standard(self):
--> 857 results, res_index = self.apply_series_generator()
858
859 # wrap results

~\Anaconda3\lib\site-packages\pandas\core\apply.py in apply_series_generator(self)
871 for i, v in enumerate(series_gen):
872 # ignore SettingWithCopy here in case the user mutates
--> 873 results[i] = self.f(v)
874 if isinstance(results[i], ABCSeries):
875 # If we have a view on v, we need to make a copy because

~\Anaconda3\lib\site-packages\tqdm\std.py in wrapper(*args, **kwargs)
807 # take a fast or slow code path; so stop when t.total==t.n
808 t.update(n=1 if not t.total or t.n < t.total else 0)
--> 809 return func(*args, **kwargs)
810
811 # Apply the provided function (in **kwargs)

~\AppData\Local\Temp\ipykernel_32040\1725835586.py in (x)
1 ## Get Sentinel-1-RTC Data
2 assests = ['vh','vv']
----> 3 train_band_values=crop_yield_data.progress_apply(lambda x: get_sentinel_data(x['Longitude'], x['Latitude'],x['Season(SA = Summer Autumn, WS = Winter Spring)'],assests), axis=1)
4 vh = [x[0] for x in train_band_values]
5 vv = [x[1] for x in train_band_values]

~\AppData\Local\Temp\ipykernel_32040\270945426.py in get_sentinel_data(longitude, latitude, season, assests)
30 items.reverse()
31
---> 32 data = stac_load([items[1]],bands=bands_of_interest, patch_url=pc.sign, bbox=bbox_of_interest).isel(time=0)
33
34 for item in items:

~\Anaconda3\lib\site-packages\odc\stac_load.py in load(items, bands, groupby, resampling, dtype, chunks, pool, crs, resolution, anchor, geobox, bbox, lon, lat, x, y, like, geopolygon, progress, fail_on_error, stac_cfg, patch_url, preserve_original_order, **kw)
492
493 if gbox is None:
--> 494 raise ValueError("Failed to auto-guess CRS/resolution.")
495
496 if chunks is not None:

ValueError: Failed to auto-guess CRS/resolution.

`
Script using odc-stac module.docx
Crop_Yield_Data.csv

@SpacemanPaul
Copy link

SpacemanPaul commented Mar 30, 2023

odc-stac is no longer part of the odc-tools repository. Moving this to the odc-stac repo.

@SpacemanPaul SpacemanPaul transferred this issue from opendatacube/odc-tools Mar 30, 2023
@SpacemanPaul SpacemanPaul changed the title Error with not guessing the Resolusion Error with not guessing the Resolution Mar 30, 2023
@Kirill888
Copy link
Member

@ngducphu please provide more information

  1. what version of the odc-stac library you are using and how it was installed (conda/pip)
  2. what data are you trying to access (from what STAC catalog, which collection, sample query)
  3. what versions of other libraries are installed, most likely this is a duplicate of Add work-around for projection extension version bump #106 and is related to mismatch of versions of projection extension between the data and software developed outside of this repository, see Handling STAC extension version upgrades stac-utils/pystac#448

@Kirill888
Copy link
Member

pretty sure this was due to projection extension version mismatch between software and data. This has been fixed upstream in pystac.

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