OGR2OGR is a hugely useful GIS utility. Today I was using it to copy data between an Amazon Web Services (AWS) based PostGIS database and a local PostGIS database. This is a slightly weird use case, but I wanted to pull down some data locally for editing via Quantum GIS (QGIS).

Here’s the command I used:

ogr2ogr -f PostgreSQL --config PG_USE_COPY YES  PG:"dbname='localDb' host='localhost' port='5432' user='postgres' password='postgres'" PG:"dbname='remoteDb' host='ec2.xx.xxx.xxx.xxx.compute-1.amazonaws.com' port='5432' user='yourUser' password='yourPassword'" layer1 layer2

This command will pull down 2 layers (layer1 and layer2) into your ‘localDB’ database. You should create the database first. Note also the ” –config PG_USE_COPY YES ” config option which in most cases makes things go WAY faster!

Sharing options

Observations • Dustin Sampson

From Many to One: A Map Creation Story

A journey of creating a vessel tracking web map from a series of static vessel map images.

Observations • James Banting

COG—Huh! What is it good for?

Cloud Optimized GeoTIFF (COG) are geotiff files, like satellite imagery, that have been processed in a manner that makes it easy to consume for internet processing applications (read cloud). It…

Observations • Will Cadell

Update With CartoDB via PostGIS

I had made the assumption that CartoDB was all about data delivery. Much like the deprecated Google Maps Engine, I had assumed CartoDB’s value was really in fast data rendering…

Need a geospatial partner?

Our team complements organizations like yours—by providing on-tap access to geospatial, analytics, and mapping expertise.

Let’s talk

Join our team?

We’re always looking for skilled technologists to help us build the future of geospatial. Got a minute to find out more about us?

Working Here

Sharing options