sael (Structure dAtabase Editing pLatform) is intended to be a sysadmin tool to upload a set of shp files to the new NSI database. PostGIS database instance must be accessible by the upload environment. The tool requires ogr2ogr, folder assets/dem/, and assets/metaTemplate.xlsx.
Database setup and cleanup SQL scripts are stored in scripts/sql/. All tables must be created inside a specified database schema (changeable in internal/global/vars.go). Field X, and Y must exist for each inventory row. Set PG_USE_COPY=YES as env var to massively boost upload speed.
0.Tobuildgobuild-osael .
1.Generatemetadatatemplate
./saelprepare--shpPath/workspaces/shape-sql-loader/test/nsi/NSI_V2_Archives/V2022/15001.shp2.Fillinmetadataxlsfileandupload
./saelmodinventory--shpPath/workspaces/shape-sql-loader/test/nsi/NSI_V2_Archives/V2022/15003.shp--xlsPath/workspaces/shape-sql-loader/metadatatest.xlsx--sqlConn"host=host.docker.internal port=25432 user=admin password=notPassword database=gis"Optional-Touploadmultipleshpfilessynchronously, usetheincludeduploadbashscriptuploadDir-xmetadatatest.xlsx-dtest/nsi/NSI_V2_Archives/V2022/-s"host=host.docker.internal port=25432 user=admin password=notPassword database=gis"3.Addusertogroup
./saelmoduser--groupnsidev--roleadmin--useruser_id--sqlConn"host=host.docker.internal port=25432 user=admin password=notPassword database=gis"4.Toaddelevationtoadataset
./saelmodelevation--datasettestDataset--version0.0.2--qualityhigh--sqlConn"host=host.docker.internal port=25432 user=admin password=notPassword database=gis"Bonus VIM config: Delve can be used to start a headless debug server inside a container and connected from the local environment using vimspector. The attached .vimspector config can "docker exec" into a container and start the delve server automatically. Alternatively, the debugger can be start and attached manually via the "remoteConnect" option:
dlv debug --listen=0.0.0.0:2345 --api-version=2 --log --log-output=dap --headless -- --mode prep --shpPath /workspaces/shape-sql-loader/test/nsi/NSI_V2_Archives/V2022/15001.shp