#!/bin/bash # # tigerimport.sh - (c) 2005 Schuyler Erle # Last updated Fri Mar 4 08:13:28 PST 2005 # # tigerimport.sh imports the CompleteChain, Landmarks, AreaLandMarks, and # Polygon layers from a TIGER/Line .ZIP file into a PostGIS database. You # must have ogr2ogr from GDAL (http://gdal.org), as well as the GDAL # Python extensions. # # This program is free software; you can redistribute it and/or # modify it under the terms of the GNU General Public License # as published by the Free Software Foundation; either version 2 # of the License, or (at your option) any later version. # # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU General Public License for more details. # # You can download a copy of the GPL from http://www.gnu.org/copyleft/gpl.html, # or write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330, # Boston, MA 02111-1307, USA. MODE=$1 DATABASE=$2 ZIP=$3 APPEND=$4 TIGERPOLY=tigerpoly2.py case $MODE in append) PRE="-append"; POST="" ;; update) PRE="-update"; POST="" ;; create) PRE=""; POST="-lco OVERWRITE=YES" ;; *) echo "Usage: $0 [append|update|create] "; exit -1;; esac FILE=$(basename $ZIP) FILE=${FILE#TGR} FILE=${FILE%.ZIP} TIGER=TGR$FILE.RT1 SRID=4269 #cat > nad83_srs.txt <