Skip to content

Instantly share code, notes, and snippets.

View pdbartsch's full-sized avatar

Paul Bartsch pdbartsch

  • UC Santa Barbara
  • 93455
View GitHub Profile
@pdbartsch
pdbartsch / process_landsat.sh
Last active March 23, 2017 20:13 — forked from andymason/Landsat 8 gdal processing
Landsat 8 gdal processing
#! /bin/bash
# Forked from: Andy Mason https://gist.github.com/andymason/6780828
# Convert Landsat 8 GeoTIFF images into RGB pan-sharpened JPEGs.
#
# Requirements:
# * gdal http://www.mapbox.com/tilemill/docs/guides/gdal/
# * convert (image-magick)
# * dans-gdal-scripts https://github.com/gina-alaska/dans-gdal-scripts
--#lowecase table and field names scripts:
--(generates the sql needed; best to do in psql command line)
SELECT 'ALTER TABLE ' || quote_ident(c.table_schema) || '.'
|| quote_ident(c.table_name) || ' RENAME "' || c.column_name || '" TO ' || quote_ident(lower(c.column_name)) || ';' As ddlsql
FROM information_schema.columns As c
WHERE c.table_schema NOT IN('information_schema', 'pg_catalog')
AND c.column_name <> lower(c.column_name)
ORDER BY c.table_schema, c.table_name, c.column_name;