Smathermather's Weblog

Remote Sensing, GIS, Ecology, and Oddball Techniques

Custom projections using and gdal

Posted by smathermather on March 17, 2014

Every now and then I get the urge to define my own projection. Usually, I sit down for a while, hit my head on the wall, and the urge passes. For a few years I have worked with the Lake Erie and Allegheny Partnership for Biodiversity on various projects. Now we are getting deep into region-wide data collection, and so I decided to define an Albers Equal Area projection for the task. Specifically, I sought to refine an existing projection to match the bounds and center of the LEAP region. Yes, I know. I will be cursed one day for this decision, but it sure beats the alternatives at the moment.

Map of LEAP Region

Beyond defining the projection, I wanted it as an ESRI WKT and in Proj4 format. Here are the steps I took. I used to help me do the format translation. needs the projection input in a form called Well Known Text (WKT)– specifically the Open Geospatial Consortium’s for of WKT. First, I uploaded the description in ESRI’s WKT: this doesn’t work. So here’s ESRI’s WKT for the LEAP boundary as I created a few days ago:


I changed 4 things from the North America version of this:


OGC WKT has different names for these, specifically:


So, we can take USA Contiguous Albers Equal Area Conic from

Go to it’s OGC WKT page:

And thus extract the OGC WKT we want to modify:


Modifying those parameters thusly:


Resulting in the following:


Which I have uploaded to a custom LEAP projection.

Ok. Final step. gdalwarp was the original tool I wanted to use. It requires that we define our projection in a format called Proj4 or using an EPSG code. Since we invented this projection, it’s has no EPSG code. Now that we have a definition for it loaded into, we can use the web site to give us the proj4 definition:

This site now gives us the following:

+proj=aea +lat_1=39 +lat_2=43 +lat_0=41 +lon_0=-80.75 +x_0=0 +y_0=0 +ellps=GRS80 +datum=NAD83 +units=m +no_defs

The sample reprojection code from the gdalwarp website is as follows:

gdalwarp -t_srs '+proj=utm +zone=11 +datum=WGS84' raw_spot.tif utm11.tif

To use it for our own data, we’ll do something like this:

gdalwarp -t_srs '+proj=aea +lat_1=39 +lat_2=43 +lat_0=41 +lon_0=-80.75 +x_0=0 +y_0=0 +ellps=GRS80 +datum=NAD83 +units=m +no_defs ' input.tif output.tif

Boom! Data reprojected. And so another projection is born. Oops.

postscript– Yes I know about— as far as I can tell, it does not yet have the ability to receive uploads.

Edit from Howard Butler:


gdalwarp -t_srs "" input.tif output.tif


3 Responses to “Custom projections using and gdal”

  1. Nyall said

    I’m quite taken by that little map… did you create that? Do you know if a higher resolution version is available?

    • I am not the creator, and don’t know if there’s a higher resolution available. I’ll check.

      • Nyall said

        Thanks – my main reason is that I’ve just added support for a “shapeburst”/buffered gradient fill style to QGIS, and this map looks to be a great example of this style type. I’d love to view a larger copy so I can check whether it’s now possible to completely recreate this directly in QGIS, or whether there’s further tweaks I can do to make this possible.

Leave a Reply

Fill in your details below or click an icon to log in: Logo

You are commenting using your account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s


Get every new post delivered to your Inbox.

Join 1,575 other followers

%d bloggers like this: