How to slove error in the "SI_LULC_pipeline"?

Hello!
I was running this code by following instructions from here…Now while runing the notebbok, I am getting this error as


AttributeError Traceback (most recent call last)
in
10
11 # Get the country’s shape in polygon format
—> 12 country_shape = country.geometry.values.tolist()[-1]
13
14 # Plot country

AttributeError: ‘GeometryArray’ object has no attribute ‘tolist’

also adding a screenshot of error which I am getting in my notebook


any help will be highly appreciated, Thanks!

Hi @neeraj,

can you try by replacing the problematic line with

country_shape = country.geometry.values[-1]

and run again?

Hi @anze.zupanc
Thanks for the quick reply, I am appricating you, It worked!

while I was running the same code, got error at the time of RGB Image drawing , any help will be highly appreciated!

Many Thanks!


ValueError: Specified path ./eopatches_small//eopatch_0 does not exist

ValueError Traceback (most recent call last)
in
5 pbar = tqdm(total=9)
6 for i in range(9):
----> 7 eopatch = EOPatch.load(‘{}/eopatch_{}’.format(path_out, i), lazy_loading=True)
8 ax = plt.subplot(3, 3, i + 1)
9 plt.imshow(np.clip(eopatch.data[‘BANDS’][0][…, [2, 1, 0]] * 3.5, 0, 1))

~/anaconda3/lib/python3.7/site-packages/eo_learn_core-0.6.0-py3.7.egg/eolearn/core/eodata.py in load(path, features, lazy_loading, mmap)
663 “”"
664 if not os.path.exists(path):
→ 665 raise ValueError(‘Specified path {} does not exist’.format(path))
666
667 entire_content = EOPatch._get_eopatch_content(path, mmap=mmap)
ValueError: Specified path ./eopatches_small//eopatch_0 does not exist

It looks like that execution of workflow that downloads the data and stores it to ./eopatches_small/ folder did not finish successfully. In the same directory as your example notebook a folders with name eoexecution-report-2019_11_27-hh_mm_ss should appear. Take a look at the last one and check report.html. There a clue of what went wrong should be given.

1 Like

Ohh Thank you!
In the same directory > eoexecution-report-2019_11_287-hh_mm_ss, there are 9 execution files and report.html is available, as i see all logs are there but it is difficult to figure out, where i did wrong

i am uploading report file as well so here is report.html

If you open report.html (with any browser) and scroll down a bit you’ll find the following stack trace:

Traceback (most recent call last):
  File "/home/niraj/anaconda3/lib/python3.7/site-packages/urllib3/connection.py", line 159, in _new_conn
    (self._dns_host, self.port), self.timeout, **extra_kw)
  File "/home/niraj/anaconda3/lib/python3.7/site-packages/urllib3/util/connection.py", line 57, in create_connection
    for res in socket.getaddrinfo(host, port, family, socket.SOCK_STREAM):
  File "/home/niraj/anaconda3/lib/python3.7/socket.py", line 748, in getaddrinfo
    for res in _socket.getaddrinfo(host, port, family, type, proto, flags):
socket.gaierror: [Errno -2] Name or service not known

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/home/niraj/anaconda3/lib/python3.7/site-packages/urllib3/connectionpool.py", line 600, in urlopen
    chunked=chunked)
  File "/home/niraj/anaconda3/lib/python3.7/site-packages/urllib3/connectionpool.py", line 343, in _make_request
    self._validate_conn(conn)
  File "/home/niraj/anaconda3/lib/python3.7/site-packages/urllib3/connectionpool.py", line 839, in _validate_conn
    conn.connect()
  File "/home/niraj/anaconda3/lib/python3.7/site-packages/urllib3/connection.py", line 301, in connect
    conn = self._new_conn()
  File "/home/niraj/anaconda3/lib/python3.7/site-packages/urllib3/connection.py", line 168, in _new_conn
    self, "Failed to establish a new connection: %s" % e)
urllib3.exceptions.NewConnectionError: <urllib3.connection.VerifiedHTTPSConnection object at 0x7f9369d2eb50>: Failed to establish a new connection: [Errno -2] Name or service not known

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/home/niraj/anaconda3/lib/python3.7/site-packages/requests/adapters.py", line 449, in send
    timeout=timeout
  File "/home/niraj/anaconda3/lib/python3.7/site-packages/urllib3/connectionpool.py", line 638, in urlopen
    _stacktrace=sys.exc_info()[2])
  File "/home/niraj/anaconda3/lib/python3.7/site-packages/urllib3/util/retry.py", line 399, in increment
    raise MaxRetryError(_pool, url, error or ResponseError(cause))
urllib3.exceptions.MaxRetryError: HTTPSConnectionPool(host='services.sentinel-hub.com', port=443): Max retries exceeded with url: /ogc/wcs/a633ca2c-dc47-4053-9064-a966edcb15b7?SERVICE=wcs&MAXCC=80.0&ShowLogo=False&Transparent=True&EvalScript=cmV0dXJuIFtCMDIsIEIwMywgQjA0LCBCMDgsIEIxMSwgQjEyXTs%3D&BBOX=510157.61722214246%2C5122327.229129893%2C513489.214628833%2C5125693.036780571&FORMAT=image%2Ftiff%3Bdepth%3D32f&CRS=EPSG%3A32633&TIME=2017-01-01T10%3A04%3A07%2F2017-01-01T10%3A04%3A07&RESX=10m&RESY=10m&COVERAGE=BANDS-S2-L1C&REQUEST=GetCoverage&VERSION=1.1.2 (Caused by NewConnectionError('<urllib3.connection.VerifiedHTTPSConnection object at 0x7f9369d2eb50>: Failed to establish a new connection: [Errno -2] Name or service not known'))

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/home/niraj/anaconda3/lib/python3.7/site-packages/sentinelhub-3.0.0b1-py3.7.egg/sentinelhub/download/handlers.py", line 44, in new_download_func
    return download_func(self, request)
  File "/home/niraj/anaconda3/lib/python3.7/site-packages/sentinelhub-3.0.0b1-py3.7.egg/sentinelhub/download/handlers.py", line 22, in new_download_func
    return download_func(self, request)
  File "/home/niraj/anaconda3/lib/python3.7/site-packages/sentinelhub-3.0.0b1-py3.7.egg/sentinelhub/download/sentinelhub_client.py", line 64, in _execute_download
    response = self._do_download(request)
  File "/home/niraj/anaconda3/lib/python3.7/site-packages/sentinelhub-3.0.0b1-py3.7.egg/sentinelhub/download/sentinelhub_client.py", line 101, in _do_download
    timeout=self.config.download_timeout_seconds
  File "/home/niraj/anaconda3/lib/python3.7/site-packages/requests/api.py", line 60, in request
    return session.request(method=method, url=url, **kwargs)
  File "/home/niraj/anaconda3/lib/python3.7/site-packages/requests/sessions.py", line 533, in request
    resp = self.send(prep, **send_kwargs)
  File "/home/niraj/anaconda3/lib/python3.7/site-packages/requests/sessions.py", line 646, in send
    r = adapter.send(request, **kwargs)
  File "/home/niraj/anaconda3/lib/python3.7/site-packages/requests/adapters.py", line 516, in send
    raise ConnectionError(e, request=request)
requests.exceptions.ConnectionError: HTTPSConnectionPool(host='services.sentinel-hub.com', port=443): Max retries exceeded with url: /ogc/wcs/a633ca2c-dc47-4053-9064-a966edcb15b7?SERVICE=wcs&MAXCC=80.0&ShowLogo=False&Transparent=True&EvalScript=cmV0dXJuIFtCMDIsIEIwMywgQjA0LCBCMDgsIEIxMSwgQjEyXTs%3D&BBOX=510157.61722214246%2C5122327.229129893%2C513489.214628833%2C5125693.036780571&FORMAT=image%2Ftiff%3Bdepth%3D32f&CRS=EPSG%3A32633&TIME=2017-01-01T10%3A04%3A07%2F2017-01-01T10%3A04%3A07&RESX=10m&RESY=10m&COVERAGE=BANDS-S2-L1C&REQUEST=GetCoverage&VERSION=1.1.2 (Caused by NewConnectionError('<urllib3.connection.VerifiedHTTPSConnection object at 0x7f9369d2eb50>: Failed to establish a new connection: [Errno -2] Name or service not known'))

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

Traceback (most recent call last):
  File "/home/niraj/anaconda3/lib/python3.7/site-packages/eo_learn_core-0.6.0-py3.7.egg/eolearn/core/eotask.py", line 72, in _execute_handling
    return_value = self.execute(*eopatches, **kwargs)
  File "/home/niraj/anaconda3/lib/python3.7/site-packages/eo_learn_io-0.6.0-py3.7.egg/eolearn/io/sentinelhub_service.py", line 215, in execute
    images = request.get_data(raise_download_errors=self.raise_download_errors, data_filter=download_frames)
  File "/home/niraj/anaconda3/lib/python3.7/site-packages/sentinelhub-3.0.0b1-py3.7.egg/sentinelhub/data_request.py", line 109, in get_data
    data_list = self._execute_data_download(data_filter, redownload, max_threads, raise_download_errors)
  File "/home/niraj/anaconda3/lib/python3.7/site-packages/sentinelhub-3.0.0b1-py3.7.egg/sentinelhub/data_request.py", line 161, in _execute_data_download
    data_list = client.download(filtered_download_list, max_threads=max_threads)
  File "/home/niraj/anaconda3/lib/python3.7/site-packages/sentinelhub-3.0.0b1-py3.7.egg/sentinelhub/download/client.py", line 74, in download
    raise download_exception.with_traceback(traceback)
  File "/home/niraj/anaconda3/lib/python3.7/site-packages/sentinelhub-3.0.0b1-py3.7.egg/sentinelhub/download/client.py", line 70, in download
    data_list.append(future.result())
  File "/home/niraj/anaconda3/lib/python3.7/concurrent/futures/_base.py", line 428, in result
    return self.__get_result()
  File "/home/niraj/anaconda3/lib/python3.7/concurrent/futures/_base.py", line 384, in __get_result
    raise self._exception
  File "/home/niraj/anaconda3/lib/python3.7/concurrent/futures/thread.py", line 57, in run
    result = self.fn(*self.args, **self.kwargs)
  File "/home/niraj/anaconda3/lib/python3.7/site-packages/sentinelhub-3.0.0b1-py3.7.egg/sentinelhub/download/client.py", line 108, in _single_download
    response_content = self._execute_download(request)
  File "/home/niraj/anaconda3/lib/python3.7/site-packages/sentinelhub-3.0.0b1-py3.7.egg/sentinelhub/download/handlers.py", line 54, in new_download_func
    from exception
sentinelhub.exceptions.DownloadFailedException: Failed to download from:
https://services.sentinel-hub.com/ogc/wcs/a633ca2c-dc47-4053-9064-a966edcb15b7?SERVICE=wcs&MAXCC=80.0&ShowLogo=False&Transparent=True&EvalScript=cmV0dXJuIFtCMDIsIEIwMywgQjA0LCBCMDgsIEIxMSwgQjEyXTs%3D&BBOX=510157.61722214246%2C5122327.229129893%2C513489.214628833%2C5125693.036780571&FORMAT=image%2Ftiff%3Bdepth%3D32f&CRS=EPSG%3A32633&TIME=2017-01-01T10%3A04%3A07%2F2017-01-01T10%3A04%3A07&RESX=10m&RESY=10m&COVERAGE=BANDS-S2-L1C&REQUEST=GetCoverage&VERSION=1.1.2
with ConnectionError:
HTTPSConnectionPool(host='services.sentinel-hub.com', port=443): Max retries exceeded with url: /ogc/wcs/a633ca2c-dc47-4053-9064-a966edcb15b7?SERVICE=wcs&MAXCC=80.0&ShowLogo=False&Transparent=True&EvalScript=cmV0dXJuIFtCMDIsIEIwMywgQjA0LCBCMDgsIEIxMSwgQjEyXTs%3D&BBOX=510157.61722214246%2C5122327.229129893%2C513489.214628833%2C5125693.036780571&FORMAT=image%2Ftiff%3Bdepth%3D32f&CRS=EPSG%3A32633&TIME=2017-01-01T10%3A04%3A07%2F2017-01-01T10%3A04%3A07&RESX=10m&RESY=10m&COVERAGE=BANDS-S2-L1C&REQUEST=GetCoverage&VERSION=1.1.2 (Caused by NewConnectionError('<urllib3.connection.VerifiedHTTPSConnection object at 0x7f9369d2eb50>: Failed to establish a new connection: [Errno -2] Name or service not known'))
Please check your internet connection and try again.

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/home/niraj/anaconda3/lib/python3.7/site-packages/eo_learn_core-0.6.0-py3.7.egg/eolearn/core/eoexecution.py", line 161, in _execute_workflow
    results = workflow.execute(input_args, monitor=True)
  File "/home/niraj/anaconda3/lib/python3.7/site-packages/eo_learn_core-0.6.0-py3.7.egg/eolearn/core/eoworkflow.py", line 172, in execute
    results = WorkflowResults(self._execute_tasks(input_args=input_args, out_degs=out_degs, monitor=monitor))
  File "/home/niraj/anaconda3/lib/python3.7/site-packages/eo_learn_core-0.6.0-py3.7.egg/eolearn/core/eoworkflow.py", line 210, in _execute_tasks
    monitor=monitor)
  File "/home/niraj/anaconda3/lib/python3.7/site-packages/eo_learn_core-0.6.0-py3.7.egg/eolearn/core/eoworkflow.py", line 243, in _execute_task
    return task(*inputs, **kw_inputs, monitor=monitor)
  File "/home/niraj/anaconda3/lib/python3.7/site-packages/eo_learn_core-0.6.0-py3.7.egg/eolearn/core/eotask.py", line 59, in __call__
    return self._execute_handling(*eopatches, **kwargs)
  File "/home/niraj/anaconda3/lib/python3.7/site-packages/eo_learn_core-0.6.0-py3.7.egg/eolearn/core/eotask.py", line 85, in _execute_handling
    raise extended_exception.with_traceback(traceback)
  File "/home/niraj/anaconda3/lib/python3.7/site-packages/eo_learn_core-0.6.0-py3.7.egg/eolearn/core/eotask.py", line 72, in _execute_handling
    return_value = self.execute(*eopatches, **kwargs)
  File "/home/niraj/anaconda3/lib/python3.7/site-packages/eo_learn_io-0.6.0-py3.7.egg/eolearn/io/sentinelhub_service.py", line 215, in execute
    images = request.get_data(raise_download_errors=self.raise_download_errors, data_filter=download_frames)
  File "/home/niraj/anaconda3/lib/python3.7/site-packages/sentinelhub-3.0.0b1-py3.7.egg/sentinelhub/data_request.py", line 109, in get_data
    data_list = self._execute_data_download(data_filter, redownload, max_threads, raise_download_errors)
  File "/home/niraj/anaconda3/lib/python3.7/site-packages/sentinelhub-3.0.0b1-py3.7.egg/sentinelhub/data_request.py", line 161, in _execute_data_download
    data_list = client.download(filtered_download_list, max_threads=max_threads)
  File "/home/niraj/anaconda3/lib/python3.7/site-packages/sentinelhub-3.0.0b1-py3.7.egg/sentinelhub/download/client.py", line 74, in download
    raise download_exception.with_traceback(traceback)
  File "/home/niraj/anaconda3/lib/python3.7/site-packages/sentinelhub-3.0.0b1-py3.7.egg/sentinelhub/download/client.py", line 70, in download
    data_list.append(future.result())
  File "/home/niraj/anaconda3/lib/python3.7/concurrent/futures/_base.py", line 428, in result
    return self.__get_result()
  File "/home/niraj/anaconda3/lib/python3.7/concurrent/futures/_base.py", line 384, in __get_result
    raise self._exception
  File "/home/niraj/anaconda3/lib/python3.7/concurrent/futures/thread.py", line 57, in run
    result = self.fn(*self.args, **self.kwargs)
  File "/home/niraj/anaconda3/lib/python3.7/site-packages/sentinelhub-3.0.0b1-py3.7.egg/sentinelhub/download/client.py", line 108, in _single_download
    response_content = self._execute_download(request)
  File "/home/niraj/anaconda3/lib/python3.7/site-packages/sentinelhub-3.0.0b1-py3.7.egg/sentinelhub/download/handlers.py", line 54, in new_download_func
    from exception
sentinelhub.exceptions.DownloadFailedException: During execution of task S2L1CWCSInput: Failed to download from:
https://services.sentinel-hub.com/ogc/wcs/a633ca2c-dc47-4053-9064-a966edcb15b7?SERVICE=wcs&MAXCC=80.0&ShowLogo=False&Transparent=True&EvalScript=cmV0dXJuIFtCMDIsIEIwMywgQjA0LCBCMDgsIEIxMSwgQjEyXTs%3D&BBOX=510157.61722214246%2C5122327.229129893%2C513489.214628833%2C5125693.036780571&FORMAT=image%2Ftiff%3Bdepth%3D32f&CRS=EPSG%3A32633&TIME=2017-01-01T10%3A04%3A07%2F2017-01-01T10%3A04%3A07&RESX=10m&RESY=10m&COVERAGE=BANDS-S2-L1C&REQUEST=GetCoverage&VERSION=1.1.2
with ConnectionError:
HTTPSConnectionPool(host='services.sentinel-hub.com', port=443): Max retries exceeded with url: /ogc/wcs/a633ca2c-dc47-4053-9064-a966edcb15b7?SERVICE=wcs&MAXCC=80.0&ShowLogo=False&Transparent=True&EvalScript=cmV0dXJuIFtCMDIsIEIwMywgQjA0LCBCMDgsIEIxMSwgQjEyXTs%3D&BBOX=510157.61722214246%2C5122327.229129893%2C513489.214628833%2C5125693.036780571&FORMAT=image%2Ftiff%3Bdepth%3D32f&CRS=EPSG%3A32633&TIME=2017-01-01T10%3A04%3A07%2F2017-01-01T10%3A04%3A07&RESX=10m&RESY=10m&COVERAGE=BANDS-S2-L1C&REQUEST=GetCoverage&VERSION=1.1.2 (Caused by NewConnectionError('<urllib3.connection.VerifiedHTTPSConnection object at 0x7f9369d2eb50>: Failed to establish a new connection: [Errno -2] Name or service not known'))
Please check your internet connection and try again.

It looks like you had problems with internet connection. Can you verify that it works properly and try again?

Hey
Thanks but it is not working, I tried with other network also
just asking for curiosity if network is issue then How did it download previous image

Can you try and run the following example from sentinelhub-py: https://github.com/sentinel-hub/sentinelhub-py/blob/master/examples/ogc_request.ipynb? Perhaps it will give you more insight in what is wrong.

If you don’t manage to solve the problem, you can still execute it on binder. Follow instructions here: https://github.com/sentinel-hub/eo-learn-workshop (click the button Binder)

1 Like

Thank you, I am trying it.

Hi @anze.zupanc
I tried it again it worked, Your truly Problem solver,:smiley:
Many Thanks!:pray:

How can i download Pune,(India) image with same notebook. I am facing this issue https://github.com/sentinel-hub/eo-learn/issues/143

Hi @neeraj,

I’m glad to see that it works for you now. In order to adapt the workflow for new area you need a polygon defining your area-of-interest and most importantly reference dataset (which is usually most difficult to get or curate).

1 Like

Hi
I am not able to visualize the patches from custom area, when I load a geojson from another area I cannot display it in true colors, instead, an black image is displayed. I just change geojson region. I am uploading my notebook and Geojson file for quick reference

Hi,

you most probable have a mismatch between coordinates in your geojson (I assume they are in WGS84) and CRS set your notebook (country_crs = CRS.UTM_43N). Change the latter to CRS.WGS84, if the polygon defined in geojson is really in this CRS.

Hey
Thanks but It’s showing wrong area after making changes in the notebook, you can check, i am attaching screenshot for reference

also can you please have look at this issue

It looks to me that the issue with visualization is solved. Obtaining ground truth is something that we can’t help you with. You can check if the local agencies, ministries or any other officials have something that you could use. If not there’s also a possibility to create it by yourself, but this is beyond the scope of this example.

1 Like

thanks, @anze.zupanc apart from Slovenia, do we have other location data, I am interested to run the same code with other locations. so i can create my own area data

1 Like

You can try France or Flanders.

ok, Thanks @anze.zupanc