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

No shoreline available? #69

Closed
pwernette opened this issue Sep 1, 2022 · 3 comments
Closed

No shoreline available? #69

pwernette opened this issue Sep 1, 2022 · 3 comments

Comments

@pwernette
Copy link

We're trying to use this for a large-scale coastal analysis project in the Great Lakes but it doesn't appear that the reference shoreline from 2014 has any information in the Great Lakes. When trying to Generate ROI for any part of the Lake Michigan coast, for example, I am receiving the following error:

Generating ROIs please wait.

 Loading the file province1244_ref_shoreline.geojson now.

---------------------------------------------------------------------------
CPLE_OpenFailedError                      Traceback (most recent call last)
File fiona\_shim.pyx:83, in fiona._shim.gdal_open_vector()

File fiona\_err.pyx:291, in fiona._err.exc_wrap_pointer()

CPLE_OpenFailedError: Failed to read GeoJSON data

During handling of the above exception, another exception occurred:

DriverError                               Traceback (most recent call last)
File C:\ProgramData\Anaconda3\envs\coastseg\lib\site-packages\ipywidgets\widgets\widget_output.py:103, in Output.capture.<locals>.capture_decorator.<locals>.inner(*args, **kwargs)
    101     self.clear_output(*clear_args, **clear_kwargs)
    102 with self:
--> 103     return func(*args, **kwargs)

Input In [6], in on_gen_button_clicked(b)
     41 print("Generating ROIs please wait.") 
     42 # Generate ROIs along the coastline within the bounding box
---> 43 coastseg_map.generate_ROIS_fishnet()
     44 debug_view.clear_output(wait=True)
     45 # Add the Clickable ROIs to the map

File ~\GitHub\CoastSeg\CoastSeg\coastseg_map_class.py:959, in CoastSeg_Map.generate_ROIS_fishnet(self, large_fishnet, small_fishnet)
    957 # save bbox 
    958 if self.shorelines_gdf.empty:
--> 959     self.load_shoreline_on_map()
    960 # Large fishnet cannot be 0. Throw an error
    961 if large_fishnet == 0:

File ~\GitHub\CoastSeg\CoastSeg\coastseg_map_class.py:873, in CoastSeg_Map.load_shoreline_on_map(self)
    871 if  os.path.exists(shoreline_path):
    872     print(f"\n Loading the file {os.path.basename(shoreline_path)} now.")
--> 873     shoreline=bbox.read_gpd_file(shoreline_path)
    874 else:
    875     print("\n The geojson shoreline file does not exist. Downloading it now.")

File ~\GitHub\CoastSeg\CoastSeg\bbox.py:24, in read_gpd_file(filename)
     22 if os.path.exists(filename):
     23     with open(filename, 'r') as f:
---> 24         gpd_data = gpd.read_file(f)
     25 else:
     26     print('File does not exist. Please download the coastline_vector necessary here: https://geodata.lib.berkeley.edu/catalog/stanford-xv279yj9196 ')

File C:\ProgramData\Anaconda3\envs\coastseg\lib\site-packages\geopandas\io\file.py:253, in _read_file(filename, bbox, mask, rows, engine, **kwargs)
    250     path_or_bytes = filename
    252 if engine == "fiona":
--> 253     return _read_file_fiona(
    254         path_or_bytes, from_bytes, bbox=bbox, mask=mask, rows=rows, **kwargs
    255     )
    256 elif engine == "pyogrio":
    257     return _read_file_pyogrio(
    258         path_or_bytes, bbox=bbox, mask=mask, rows=rows, **kwargs
    259     )

File C:\ProgramData\Anaconda3\envs\coastseg\lib\site-packages\geopandas\io\file.py:294, in _read_file_fiona(path_or_bytes, from_bytes, bbox, mask, rows, **kwargs)
    291     reader = fiona.open
    293 with fiona_env():
--> 294     with reader(path_or_bytes, **kwargs) as features:
    295 
    296         # In a future Fiona release the crs attribute of features will
    297         # no longer be a dict, but will behave like a dict. So this should
    298         # be forwards compatible
    299         crs = (
    300             features.crs["init"]
    301             if features.crs and "init" in features.crs
    302             else features.crs_wkt
    303         )
    305         # handle loading the bounding box

File C:\ProgramData\Anaconda3\envs\coastseg\lib\site-packages\fiona\collection.py:555, in BytesCollection.__init__(self, bytesbuf, **kwds)
    552 self.virtual_file = buffer_to_virtual_file(self.bytesbuf, ext=ext)
    554 # Instantiate the parent class.
--> 555 super(BytesCollection, self).__init__(self.virtual_file, vsi=filetype, **kwds)

File C:\ProgramData\Anaconda3\envs\coastseg\lib\site-packages\fiona\collection.py:162, in Collection.__init__(self, path, mode, driver, schema, crs, encoding, layer, vsi, archive, enabled_drivers, crs_wkt, ignore_fields, ignore_geometry, **kwargs)
    160 if self.mode == 'r':
    161     self.session = Session()
--> 162     self.session.start(self, **kwargs)
    163 elif self.mode in ('a', 'w'):
    164     self.session = WritingSession()

File fiona\ogrext.pyx:540, in fiona.ogrext.Session.start()

File fiona\_shim.pyx:90, in fiona._shim.gdal_open_vector()

DriverError: Failed to read GeoJSON data

Is there any idea of whether support for this large freshwater system might be included in the future? ArcGIS has some reference shorelines that include the Great Lakes and may be of use (just a thought).

@pwernette pwernette changed the title No shoreline for Great Lakes No shoreline for Great Lakes? Sep 1, 2022
@pwernette pwernette changed the title No shoreline for Great Lakes? No shoreline available? Sep 1, 2022
@dbuscombe-usgs
Copy link
Member

Thanks for the note

CoastSeg is not ready for use. To repeat from the first line of the README, "Please note that we're in the planning stages only - please check back later"

these are known issues with the zenodo release of shorelines. See, for example, #53

I'll update here when the shorelines are fixed, but for now, please use CoastSat for downloading imagery

@dbuscombe-usgs
Copy link
Member

I'm reopening this because I realized that the Great Lakes shoreline may not be covered by the Sayre dataset. I will look into this

@dbuscombe-usgs
Copy link
Member

I can confirm that Great Lakes or other inland seas and lakes are not included in the new US counties Zenodo release that we are trying to now incorporate into CoastSeg, which only includes salty coasts

map-shorelines

As mentioned in #70, we'll eventually provide guidance on how to upload shorelines for use in freshwater regions

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

2 participants