Riverscapes/riverscapes-tools

ANTHRO project FOREIGN KEY constraint failed

Closed this issue · 2 comments

HUC(S): 1710030105, 1710030801, 1804001211

2024-03-22 19:57:47:: [info] [Copy Features] Copying features from igo with specified attributes into project
2024-03-22 19:57:47::         PROGRESS: 1 / 30,756  (0%)  Processing points     (Ellapsed: 0.0 seconds)
2024-03-22 19:57:57:: [warning] [GDALError] ERR# 1 -- A geometry of type POINT is inserted into layer IGOGeometry of geometry type MULTIPOINT, which is not normally allowed by the GeoPackage specification, but the driver will however do it. To create a conformant GeoPackage, if using ogr2ogr, the -nlt option can be used to override the layer geometry type. This warning will no longer be emitted for this combination of layer and feature geometry type.
2024-03-22 19:57:57:: [info] [Processing points] Completed 30,756 operations.  Total Time: 9.0 seconds     
2024-03-22 19:57:57:: [info] [Copy Features] Copying features from flowlines with specified attributes into project
2024-03-22 19:57:57::         PROGRESS: 1 / 18,525  (0%)  Processing points     (Ellapsed: 0.0 seconds)
2024-03-22 19:58:05:: [warning] [GDALError] ERR# 1 -- A geometry of type LINESTRING is inserted into layer ReachGeometry of geometry type MULTILINESTRING, which is not normally allowed by the GeoPackage specification, but the driver will however do it. To create a conformant GeoPackage, if using ogr2ogr, the -nlt option can be used to override the layer geometry type. This warning will no longer be emitted for this combination of layer and feature geometry type.
2024-03-22 19:58:05:: [info] [Processing points] Completed 18,525 operations.  Total Time: 7.0 seconds     
2024-03-22 19:58:05:: [info] [Copy Features] Copying features from dgo with specified attributes into project
2024-03-22 19:58:05::         PROGRESS: 1 / 31,376  (0%)  Processing points     (Ellapsed: 0.0 seconds)
2024-03-22 19:58:14:: [info] [Processing points] Completed 31,376 operations.  Total Time: 8.0 seconds     
2024-03-22 19:58:14:: [error] [Anthropogenic Context] FOREIGN KEY constraint failed
2024-03-22 19:58:14:: Traceback (most recent call last):
2024-03-22 19:58:14::   File "/usr/local/src/riverscapes-tools/packages/anthro/anthro/anthro.py", line 327, in main
2024-03-22 19:58:14::     anthro_context(
2024-03-22 19:58:14::   File "/usr/local/src/riverscapes-tools/packages/anthro/anthro/anthro.py", line 182, in anthro_context
2024-03-22 19:58:14::     database.curs.execute('INSERT INTO ReachAttributes (ReachID, TotDASqKm, DivDASqKm, ReachCode, FCode, StreamName, NHDPlusID, level_path, ownership) SELECT ReachID, TotDASqKm, DivDASqKm, ReachCode, FCode, GNIS_NAME, NHDPlusID, level_path, ownership FROM ReachGeometry')
2024-03-22 19:58:14:: sqlite3.IntegrityError: FOREIGN KEY constraint failed
2024-03-22 19:58:14:: <<ANTHRO PROCESS ENDED WITH AN ERROR>>

@jtgilbert New error
HUC: 1604020110
Missing fcode: 46800 (drainageway?)

I was in rs tools and went ahead and added this fcode as a generic stream to get this huc to run. I think this is a fairly new and rare fcode, so we change the behavior if the future if needed.

https://www.usgs.gov/ngp-standards-and-specifications/elevation-derived-hydrography-read-rules-drainageway