Riverscapes / riverscapes-tools

Open-source Python 3.0 tools for the Riverscapes organization
https://tools.riverscapes.net/
GNU General Public License v3.0
11 stars 11 forks source link

Vbet centerline fail on HUC 10090102 #311

Closed MattReimer closed 2 years ago

MattReimer commented 3 years ago

This one's a bit hard to debug because it failed after 27 hours.

This was VBET using an RSContext project from the net_att program on the staging server as an input

https://northarrowresearchlabs.github.io/riverscapes-staging/#/net_att/56efcf40-7f51-4c56-81b0-60a650514f37

Full logfile here:

FAILED-10090102.log

Here's the snippet with the problem:

2021-05-21 12:11:54:: [debug] [vbet_centerline] Unioning...
2021-05-21 12:11:54:: [debug] [vbet_centerline] Unioning complete
2021-05-21 12:11:54:: [info] [build_centerline] Building centerline
2021-05-21 12:11:54:: [error] [VBET] Multi-part geometries do not provide a coordinate sequence
2021-05-21 12:11:54:: Traceback (most recent call last):
2021-05-21 12:11:54::   File "/usr/local/src/riverscapes-tools/packages/vbet/vbet/vbet.py", line 519, in main
2021-05-21 12:11:54::     vbet(args.huc, args.scenario_code, inputs, args.output_dir, args.vaa_table, reach_codes, args.create_centerline, meta)
2021-05-21 12:11:54::   File "/usr/local/src/riverscapes-tools/packages/vbet/vbet/vbet.py", line 390, in vbet
2021-05-21 12:11:54::     vbet_centerline(flowlines_vaa_path, os.path.join(vbet_path, 'vbet_50'), centerline)
2021-05-21 12:11:54::   File "/usr/local/src/riverscapes-tools/packages/vbet/vbet/vbet_centerline.py", line 110, in vbet_centerline
2021-05-21 12:11:54::     centerlines, merged_centerline = build_centerline(line, poly_union, 20, dist_factor=degree_factor, existing_centerlines=merged_centerline, up_reach=reaches[HydroSeq]['geom'])
2021-05-21 12:11:54::   File "/usr/local/src/riverscapes-tools/packages/vbet/vbet/vbet_centerline.py", line 151, in build_centerline
2021-05-21 12:11:54::     for coord in g_thalweg_init.coords:
2021-05-21 12:11:54::   File "/usr/local/venv/lib/python3.8/site-packages/shapely/geometry/base.py", line 867, in coords
2021-05-21 12:11:54::     raise NotImplementedError(
2021-05-21 12:11:54:: NotImplementedError: Multi-part geometries do not provide a coordinate sequence
2021-05-21 12:11:57:: <<RS CONTEXT PROCESS ENDED WITH AN ERROR>>

I could be wrong but I think the problem comes with something to do with THESE LINES

Hopefully it's as easy as doing a null or validity check and bypassing irrelevant geometries but I can't say that just by looking

KellyMWhitehead commented 2 years ago

Old method of vbet centerline. No longer relevant.