mcuttler / CoastSat.islands

Satellite-derived shorelines and 2D planform measurements for islands, extension of the CoastSat toolbox.
GNU General Public License v3.0
22 stars 3 forks source link

Problem with batch contour detection #5

Open emlPhD opened 2 years ago

emlPhD commented 2 years ago

Hi, I am experiencing problems with the batch contour detection step - I am getting unbound local errors such as these:

image

Is there something I should be changing/doing for this step to avoid the error?

emlPhD commented 2 years ago

Apologies - I just saw the other thread with a similar issue. I think I have correctly updated the joblib import but now receive new errors:

Mapping shorelines: S2: 2%

AttributeError Traceback (most recent call last) File ~\Anaconda3\envs\coastsat.islands\lib\site-packages\shapely\speedups_speedups.pyx:247, in shapely.speedups._speedups.geos_linearring_from_py()

AttributeError: 'list' object has no attribute '__array_interface__'

During handling of the above exception, another exception occurred:

ValueError Traceback (most recent call last) Input In [6], in <cell line: 2>() 1 get_ipython().run_line_magic('matplotlib', 'qt') ----> 2 output = SDS_islands.extract_sand_poly(metadata, settings)

File ~\Downloads\CoastSat.islands-masthead\coastsat\SDS_islands.py:299, in extract_sand_poly(metadata, settings) 296 continue 298 # process water contours into shorelines --> 299 shoreline = SDS_shoreline.process_shoreline(contours_mwi, cloud_mask, georef, image_epsg, settings) 301 if settings['check_detection_sand_poly']: 302 date = filenames[i][:18]

File ~\Downloads\CoastSat.islands-masthead\coastsat\SDS_shoreline.py:435, in process_shoreline(contours, cloud_mask, georef, image_epsg, settings) 433 for l, wl in enumerate(contours_epsg): 434 coords = [(wl[k,0], wl[k,1]) for k in range(len(wl))] --> 435 a = Polygon(coords) # shapely Polygon structure 436 if a.length >= settings['min_length_sl']: 437 contours_long.append(wl)

File ~\Anaconda3\envs\coastsat.islands\lib\site-packages\shapely\geometry\polygon.py:243, in Polygon.init(self, shell, holes) 240 BaseGeometry.init(self) 242 if shell is not None: --> 243 ret = geos_polygon_from_py(shell, holes) 244 if ret is not None: 245 self._geom, self._ndim = ret

File ~\Anaconda3\envs\coastsat.islands\lib\site-packages\shapely\geometry\polygon.py:509, in geos_polygon_from_py(shell, holes) 506 return geos_geom_from_py(shell) 508 if shell is not None: --> 509 ret = geos_linearring_from_py(shell) 510 if ret is None: 511 return None

File ~\Anaconda3\envs\coastsat.islands\lib\site-packages\shapely\speedups_speedups.pyx:341, in shapely.speedups._speedups.geos_linearring_from_py()

ValueError: A LinearRing must have at least 3 coordinate tuples

mcuttler commented 2 years ago

Sorry for the delay @emlPhD, I have been away for fieldwork and juggling other projects. Is the error arising with the default/example site? Or are you trying to run it using your own site of interest?

emlPhD commented 2 years ago

No worries! This problem is happening when I run it for my site of interest.

mcuttler commented 2 years ago

Sounds good --- could you upload a KML of your site of interest and I can try running it this week to see if I reproduce the error?

emlPhD commented 2 years ago

Cheers! Here's the KML. I have also been working in EPSG 4283 as I'm on the east coast.

Masthead.zip

emlPhD commented 2 years ago

Hi @mcuttler , I have been able to resolve the issue I posted about earlier. However, when performing the tidal correction, I have encountered another problem (see screenshot). Could you offer some insight as to what could be causing this? Cheers!

image

Revuanagha commented 10 months ago

when i am trying to digitize the reference shoreline map the points are not coming and shows errors. could you please help with that