Skip to content

Instantly share code, notes, and snippets.

@hampelm
Created April 27, 2012 15:10
Show Gist options
  • Save hampelm/2510030 to your computer and use it in GitHub Desktop.
Save hampelm/2510030 to your computer and use it in GitHub Desktop.
PostGIS Recipes
echo "CREATE USER project_name WITH PASSWORD \'password\';" | psql postgres
createdb -O project_name project_name -T template_postgis
ogr2ogr -f PostgreSQL PG:dbname=databasename infile.shp
SELECT parcels FROM detroit where ST_Touches(current_parcel, detroit.geometry_column)
where current_parcel is a polygon geometry object in PostGIS
and detroit.geometry_column is the name of the column in the database with the polygon objects
and that will use the index
Copy the data from localhost to remote:
$ scp -r foo [email protected]:/some/remote/directory/bar
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment