HHG

Document with LOTS of stuff: https://docs.google.com/document/d/1ni96ZBKWpT9bhGBaX1pzeMhtlpC9bFHPrBR08B_eiNY

Exporting to a Shapefile:

This is the command line utility to export a PostGIS table/view to a Shapefile. The table/view must have a "geometry" field - not just lat/lon fields, but as long as that is the case, this is all it takes to generate a Shapefile from it (there are some permissions details too - if you want to do this, or thing it should be incorporated into a dashboard button or something, let me know):

ogr2ogr -f "ESRI Shapefile" /var/www/html/mapfile/cuwcd_wells_full.shp PG:"user=import_data dbname=up" -sql "SELECT * FROM client_clearwater.export_wells_to_shapefile" -lco ENCODING=UTF-8