Describe the bug
I run the code provided below (which is derived from the code provided by the website given below) with the attached config file in Pycharm on Linux OS and everything works fine when I use the shapefile provided by the website (iho.shp) or a similar shapefile I made (Trieste_test.shp). But when I try to use a different shapefile, I get an error which suggests that the shapefile does not exist when in fact it does. Can you tell me if this is something I am doing wrong or if there is a bug in the source code? This issue was originally reported on the EODAG Github website (also provided below) and they recommended reporting the issue here
Attached is a txt copy of the .yml config file and zip folders containing the shapefiles and the xml files
eodag.txt (5.1 KB)
xmls.zip (1.5 KB)
shps.zip (3.9 MB)
Thank you in advance
Kind regards
Craig Pearce
https://eodag.readthedocs.io/en/stable/notebooks/tutos/tuto_ship_detection.html
Code To Reproduce
import os
from eodag.api.core import EODataAccessGateway
from eodag import setup_logging
Set working directory
base_wd = â/home/craig/PycharmProjects/S1_image_processing/â
os.chdir(base_wd)
Make output verbose
setup_logging(verbose=3)
Create the workspace folder.
workspace = âeodag_workspace_shipdetectionâ
if not os.path.isdir(workspace):
os.mkdir(workspace)
Add absolute path to SNAP bin folder to make the gpt command available
os.environ[âPATHâ] = â/home/craig/snap/binâ + â:â + os.environ[âPATHâ]
Start EODAG using config file
dag = EODataAccessGateway(os.path.join(workspace, âeodag.ymlâ))
Set product type and extent
product_type = âS1_SAR_GRDâ
extent = {
âlonminâ: 13.054504,
âlonmaxâ: 13.808441,
âlatminâ: 45.475540,
âlatmaxâ: 45.762733
}
Set dates and get list of products
products, estimated_nbr_of_results = dag.search(
productType=product_type,
start=â2021-05-01â,
end=â2021-05-03â,
geom=extent
)
products
product = products[1]
product_path = product.download()
product_path
Set up xml files
Set up then run gpt
Set the environment - variable LD_LIBRARY_PATH to the current directory
os.environ[âLD_LIBRARY_PATHâ] = â.â
Set names for vector file
vector_file = os.path.join(workspace, âne_10m_oceanâ, âne_10m_ocean.shpâ)
vector_file_short = âne_10m_oceanâ
Run gpt
!gpt âeodag_workspace_shipdetection/Subset.xmlâ -Pvectorfile={vector_file}
!gpt {graph_process} -Pinputproduct={os.path.join(workspace, âS1A_IW_GRDH_1SDV_20170501T165831_9CD1_Orb.dimâ)} -Pvectorfileshort={vector_file_short} -Poutputproduct1={os.path.join(workspace, âS1A_IW_GRDH_1SDV_20170501T165831_9CD1_processedâ)} -Poutputproduct2={os.path.join(workspace, âS1A_IW_GRDH_1SDV_20170501T165831_9CD1_processedâ)}
Test whether shapefile exists
os.path.isfile(â/home/craig/PycharmProjects/S1_image_processing/eodag_workspace_shipdetection/ne_10m_ocean/ne_10m_ocean.shpâ)
Output
Backend TkAgg is interactive backend. Turning interactive mode on.
2022-01-31 13:11:39,761-15s eodag.config [INFO ] (config ) Loading user configuration from: /home/craig/PycharmProjects/S1_image_processing/eodag_workspace_shipdetection/eodag.yml
2022-01-31 13:11:39,827-15s eodag.core [DEBUG ] (core ) Opening product types index in /home/craig/.config/eodag/.index
2022-01-31 13:11:39,832-15s eodag.core [INFO ] (core ) Locations configuration loaded from /home/craig/.config/eodag/locations.yml
2022-01-31 13:11:40,333-15s eodag.core [INFO ] (core ) Searching product type 'S1_SAR_GRD' on provider: peps
2022-01-31 13:11:40,333-15s eodag.core [DEBUG ] (core ) Using plugin class for search: QueryStringSearch
2022-01-31 13:11:40,333-15s eodag.plugins.search.qssearch [DEBUG ] (qssearch ) Mapping eodag product type to provider product type
2022-01-31 13:11:40,333-15s eodag.plugins.search.qssearch [DEBUG ] (qssearch ) Getting provider product type definition parameters for S1_SAR_GRD
2022-01-31 13:11:40,333-15s eodag.plugins.search.qssearch [DEBUG ] (qssearch ) Getting provider product type definition parameters for S1_SAR_GRD
2022-01-31 13:11:40,333-15s eodag.plugins.search.qssearch [DEBUG ] (qssearch ) Building the query string that will be used for search
2022-01-31 13:11:40,333-15s eodag.plugins.search.qssearch [DEBUG ] (qssearch ) Retrieving queryable metadata from metadata_mapping
2022-01-31 13:11:40,334-15s eodag.plugins.search.qssearch [INFO ] (qssearch ) Sending count request: https://peps.cnes.fr/resto/api/collections/S1/search.json?startDate=2017-05-01&completionDate=2017-05-02&geometry=POLYGON ((13.0545 45.4755, 13.0545 45.7627, 13.8084 45.7627, 13.8084 45.4755, 13.0545 45.4755))&productType=GRD&maxRecords=1&page=1
2022-01-31 13:11:41,471-15s eodag.plugins.search.qssearch [INFO ] (qssearch ) Sending search request: https://peps.cnes.fr/resto/api/collections/S1/search.json?startDate=2017-05-01&completionDate=2017-05-02&geometry=POLYGON ((13.0545 45.4755, 13.0545 45.7627, 13.8084 45.7627, 13.8084 45.4755, 13.0545 45.4755))&productType=GRD&maxRecords=20&page=1
2022-01-31 13:11:42,331-15s eodag.plugins.search.qssearch [DEBUG ] (qssearch ) Adapting 2 plugin results to eodag product representation
2022-01-31 13:11:42,361-15s eodag.core [INFO ] (core ) Found 2 result(s) on provider 'peps'
0.00B [00:00, ?B/s]
S1A_IW_GRDH_1SDV_20170501T165806_20170501T165831_016391_01B235_9CD1: 0.00B [00:00, ?B/s]2022-01-31 13:11:42,363-15s eodag.plugins.download.base [INFO ] (base ) Download url: https://peps.cnes.fr/resto/collections/S1/46d48388-c2c0-5fdb-b3c9-aadafeeedf76/download
2022-01-31 13:11:42,363-15s eodag.plugins.download.base [INFO ] (base ) Product already downloaded: /home/craig/Downloads/S1A_IW_GRDH_1SDV_20170501T165806_20170501T165831_016391_01B235_9CD1.zip
S1A_IW_GRDH_1SDV_20170501T165806_20170501T165831_016391_01B235_9CD1: 0file [00:00, ?file/s]2022-01-31 13:11:42,363-15s eodag.plugins.download.base [INFO ] (base ) Extraction cancelled, destination directory already exists and is not empty: /home/craig/Downloads/S1A_IW_GRDH_1SDV_20170501T165806_20170501T165831_016391_01B235_9CD1
S1A_IW_GRDH_1SDV_20170501T165806_20170501T165831_016391_01B235_9CD1: 0%| | 0/1 [00:00<?, ?file/s]
S1A_IW_GRDH_1SDV_20170501T165806_20170501T165831_016391_01B235_9CD1: 100%|ââââââââââ| 1/1 [00:00<00:00, 4777.11file/s]
2022-01-31 13:11:42,364-15s eodag.api.product [DEBUG ] (_product ) Product location updated from 'https://peps.cnes.fr/resto/collections/S1/46d48388-c2c0-5fdb-b3c9-aadafeeedf76/download' to 'file:///home/craig/Downloads/S1A_IW_GRDH_1SDV_20170501T165806_20170501T165831_016391_01B235_9CD1/S1A_IW_GRDH_1SDV_20170501T165806_20170501T165831_016391_01B235_9CD1.SAFE'
2022-01-31 13:11:42,364-15s eodag.api.product [INFO ] (_product ) Remote location of the product is still available through its 'remote_location' property: https://peps.cnes.fr/resto/collections/S1/46d48388-c2c0-5fdb-b3c9-aadafeeedf76/download
S1A_IW_GRDH_1SDV_20170501T165831_20170501T165856_016391_01B235_1399
S1A_IW_GRDH_1SDV_20170501T165806_20170501T165831_016391_01B235_9CD1
INFO: org.esa.snap.core.gpf.operators.tooladapter.ToolAdapterIO: Initializing external tool adapters
INFO: org.esa.s2tbx.dataio.gdal.GDALVersion: Incompatible GDAL 3.3.2 found on system. Internal GDAL 3.0.0 from distribution will be used.
INFO: org.esa.s2tbx.dataio.gdal.GDALVersion: Internal GDAL 3.0.0 set to be used by SNAP.
INFO: org.esa.snap.core.util.EngineVersionCheckActivator: Please check regularly for new updates for the best SNAP experience.
INFO: org.esa.s2tbx.dataio.gdal.GDALVersion: Internal GDAL 3.0.0 set to be used by SNAP.
Executing processing graph
INFO: org.hsqldb.persist.Logger: dataFileCache open start
....10%....20%....30%....40%....50%....60%....70%....80%....90% done.
INFO: org.esa.snap.core.gpf.operators.tooladapter.ToolAdapterIO: Initializing external tool adapters
INFO: org.esa.s2tbx.dataio.gdal.GDALVersion: Incompatible GDAL 3.3.2 found on system. Internal GDAL 3.0.0 from distribution will be used.
INFO: org.esa.s2tbx.dataio.gdal.GDALVersion: Internal GDAL 3.0.0 set to be used by SNAP.
INFO: org.esa.snap.core.util.EngineVersionCheckActivator: Please check regularly for new updates for the best SNAP experience.
INFO: org.esa.s2tbx.dataio.gdal.GDALVersion: Internal GDAL 3.0.0 set to be used by SNAP.
Executing processing graph
INFO: org.hsqldb.persist.Logger: dataFileCache open start
expression: Undefined symbol 'ne_10m_ocean'. due to Undefined symbol 'ne_10m_ocean'.
done.
Error: [NodeId: Land-Sea-Mask] expression: Undefined symbol 'ne_10m_ocean'. due to Undefined symbol 'ne_10m_ocean'.
Out[2]: True
Environment:
- Python version:
3.8.10 (default, Nov 26 2021, 20:14:08) \n[GCC 9.3.0]
- EODAG version:
version 2.3.4
- PyCharm 2021.3.2 (Community Edition)
Build #PC-213.6777.52, built on January 28, 2022
Runtime version: 11.0.13+7-b1751.25 amd64
VM: OpenJDK 64-Bit Server VM by JetBrains s.r.o.
Linux 5.13.0-27-generic
GC: G1 Young Generation, G1 Old Generation
Memory: 2048M
Cores: 12
Non-Bundled Plugins:
R4Intellij (213.5744.6)
Current Desktop: ubuntu:GNOME