Skip to content

gdal cheatsheet

Alexander Rolek edited this page Jun 24, 2016 · 8 revisions

Reproject a shapefile

ogr2ogr -t_srs EPSG:4326 /data/out.shp /data/in.shp

Pipe shapefile into PostGIS

shp2pgsql -I -s 4326 in.shp schema.table_name | /usr/bin/psql "host={host} port={port} dbname={db_name} user={user}"
  • encoding can be adjusted from shp2pgsql command by using the -W flag. i.e. -W "latin1"

Clone this wiki locally