NewGraphEnvironment / dff-2022

Building digital field forms and processing data collected using R, postgresql, QGIS and other tools
Creative Commons Zero v1.0 Universal
0 stars 3 forks source link

fwa layers with no features present result in `watershed_group_code` error on `background_layers.sh` build #147

Closed NewGraphEnvironment closed 8 months ago

NewGraphEnvironment commented 8 months ago
+ for layer in '$BCGW_SOURCES'
+ [[ whse_basemapping.fwa_manmade_waterbodies_poly == *\.\f\w\a\_* ]]
+ ogr2ogr -f GPKG background_layers.gpkg -update -t_srs EPSG:3005 -nln whse_basemapping.fwa_manmade_waterbodies_poly -dim XY -where 'watershed_group_code in ('\''ADMS'\'')' whse_basemapping.fwa_manmade_waterbodies_poly.geojson
ERROR 1: "watershed_group_code" not recognised as an available field.
ERROR 1: SetAttributeFilter(watershed_group_code in ('ADMS')) on layer 'whse_basemapping.fwa_manmade_waterbodies_poly' failed.

going to pull from bcdata.txt for now as we are not currently even symbolizing but seems weird....

NewGraphEnvironment commented 8 months ago

tested by building LARL watershed group with the call to that layer included. this will pop up again I'm sure so we should watch for it. Could be any whse_basemapping.fwa_* layer with no features in the area defined by the call to background_layers.sh that will throw this area.

Left this layer in the .txt file as it is nice to have. It is not yet symbolized so will add that as a to do in #110

closing but hopefully will be easy to find with search

NewGraphEnvironment commented 6 months ago

will add the following line to bcdata.sh to remove empty tables

find . -maxdepth 1 -type f -name "*.fwa_*" -size -50c -delete

then in background_layers.sh

get the name of the files (except aoi.geojson) that are left after tiny ones are removed BCGW_SOURCES=$(find . -maxdepth 1 -type f -name "*.geojson" -a '!' -name "aoi.geojson" -exec basename {} .geojson \;)

for glacier fail example can test with

time ./bcdata.sh "'CRKD'" && time ./background_layers.sh "'CRKD'" && time ./qgis_create.sh "new_project_directory"