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

Missing ogr2ogr in PATH: error in ‘wgs84_extent’ when processing Sentinel-1 products #60

Closed
TK12331 opened this issue Nov 28, 2022 · 6 comments
Labels
installation Installation issues

Comments

@TK12331
Copy link

TK12331 commented Nov 28, 2022

Assigning CRS to a GeoDataFrame without a geometry column is not supported. Use GeoDataFrame.set_geometry to set the active geometry column.
Traceback (most recent call last):
File "d:\SAR_DATA\process\eoreader-main\eoreader\products\sar\s1_product.py", line 187, in wgs84_extent
raise InvalidProductError(
eoreader.exceptions.InvalidProductError: Cannot determine the WGS84 extent of S1A_IW_GRDH_1SDV_20200308T121318_20200308T121343_031584_03A39B_5C41

The above exception was the direct cause of the following exception:

Traceback (most recent call last):
File "C:\Users\10992.conda\envs\DL1\lib\runpy.py", line 197, in _run_module_as_main
return _run_code(code, main_globals, None,
File "C:\Users\10992.conda\envs\DL1\lib\runpy.py", line 87, in run_code
exec(code, run_globals)
File "c:\Users\10992.vscode\extensions\ms-python.python-2022.5.11221002\pythonFiles\lib\python\debugpy_main
.py", line 45, in
cli.main()
File "c:\Users\10992.vscode\extensions\ms-python.python-2022.5.11221002\pythonFiles\lib\python\debugpy/..\debugpy\server\cli.py", line 444, in main
run()
File "c:\Users\10992.vscode\extensions\ms-python.python-2022.5.11221002\pythonFiles\lib\python\debugpy/..\debugpy\server\cli.py", line 285, in run_file
runpy.run_path(target_as_str, run_name=compat.force_str("main"))
File "C:\Users\10992.conda\envs\DL1\lib\runpy.py", line 268, in run_path
return _run_module_code(code, init_globals, run_name,
File "C:\Users\10992.conda\envs\DL1\lib\runpy.py", line 97, in _run_module_code
_run_code(code, mod_globals, init_globals,
File "C:\Users\10992.conda\envs\DL1\lib\runpy.py", line 87, in run_code
exec(code, run_globals)
File "d:\SAR_DATA\process\eoreader-main\K.py", line 15, in
s1_prod.wgs84_extent()
File "C:\Users\10992.conda\envs\DL1\lib\site-packages\methodtools.py", line 72, in call
return self.call(*args, **kwargs)
File "d:\SAR_DATA\process\eoreader-main\eoreader_init
.py", line 31, in wrapper
return func(*args, **kwargs)
File "d:\SAR_DATA\process\eoreader-main\eoreader\products\sar\s1_product.py", line 196, in wgs84_extent
raise InvalidProductError(ex) from ex
eoreader.exceptions.InvalidProductError: Cannot determine the WGS84 extent of S1A_IW_GRDH_1SDV_20200308T121318_20200308T121343_031584_03A39B_5C41

@TK12331 TK12331 added the bug Something isn't working label Nov 28, 2022
@TK12331
Copy link
Author

TK12331 commented Nov 28, 2022

I follow the tutorial and here is my code:

from eoreader.reader import Reader
from eoreader.bands import *
import sys
sys.path.append('D:/Software/SNAP/snap/bin/')

s1_path = "E:\SAR_DATA\Sentinel1\S1A_IW_GRDH_1SDV_20200308T121318_20200308T121343_031584_03A39B_5C41.zip"

reader = Reader()

s1_prod = reader.open(s1_path)

s1_prod.get_band_paths([VV, HH])

An error occured, and I checked into the inner function and found the error is through in function of 'eoreader/products/sar/s1_product.py':
s1_prod.wgs84_extent()

When run the code 'extent_wgs84 = vectors.read(preview_overlay)', it will throw the message:
Assigning CRS to a GeoDataFrame without a geometry column is not supported. Use GeoDataFrame.set_geometry to set the active geometry column.

Finally, the code 'vect.crs = WGS84' throw the error.

How can I solve this problem? Thanks in advance!

@TK12331
Copy link
Author

TK12331 commented Nov 28, 2022

Besides, I read the message that
image

I've installed the SNAP locally, but how can I satisfy the requirement ''Ensure that you have the folder containing your gpt executable in your PATH.''?

In addition, the message shown in SNAP official website
image
, which requires python to be 3.3 or 3.6, while EOReader requires python to >= 3.8, will this cause conflict between the two of them?

@remi-braun
Copy link
Member

remi-braun commented Nov 28, 2022

Hello,

Do you have ogr2ogr accessible as pointed out in the latest FAQ ?
For some reason Sentinel-1 KML files sometimes fails to be read by geopandas (I don't know why) and I need to convert them to geojson thanks to ogr2ogr as a workaround.
To know if you have it available, just type ogr2ogr in a terminal. If the help section is displayed, it will work.
However, you are right, I should better handle this error (at least throw a proper exception).

Concerning your last comment, I don't use snappy as it is slow and buggy. SNAP GPT is ran directly.
If you have properly installed SNAP, this should work. Once again, to check if gpt is available, just type it in a terminal. If the help section is displayed, it will work.

@remi-braun remi-braun changed the title The error of ‘wgs84_extent’ when process the product of Sentinel-1 Missing ogr2ogr in PATH: error in ‘wgs84_extent’ when processing Sentinel-1 products Nov 28, 2022
@remi-braun
Copy link
Member

remi-braun commented Nov 28, 2022

Using sertit 1.19.6 may correct your issue (pip install sertit[full]>=1.19.6)

@remi-braun remi-braun added installation Installation issues and removed bug Something isn't working labels Nov 28, 2022
@TK12331
Copy link
Author

TK12331 commented Nov 29, 2022

I installed GDAL and that worked for me. Thank you for the quick response!

Do you have ogr2ogr accessible as pointed out in the latest FAQ ? For some reason Sentinel-1 KML files sometimes fails to be read by geopandas (I don't know why) and I need to convert them to geojson thanks to ogr2ogr as a workaround. To know if you have it available, just type ogr2ogr in a terminal. If the help section is displayed, it will work. However, you are right, I should better handle this error (at least throw a proper exception).

@remi-braun
Copy link
Member

🙏

bastiencyr pushed a commit to bastiencyr/eoreader that referenced this issue May 30, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
installation Installation issues
Projects
None yet
Development

No branches or pull requests

2 participants