Reprojecting shapefiles from AGD66 to GDA94 without ESRI ArcGIS

In a previous installment I demonstrated how to use ogr2ogr to reproject shapefiles. It turns out that its a bit trickier when you are reprojecting from AGD66 to GDA94 (and vice versa). This is because the ellipsoids they use to model the earth are different, and it turns out the be quite difficult to calculate the exact equivalent locations between them.

Difference between AGD66 and GDA94 at the ANU

Difference between AGD66 and GDA94 at the ANU

The most accurate way to convert between the two coordinate reference systems is to use a pre-calculated distortion grid. Fortunately, some clever surveyors have made one for us, available here (Webcite archive).

To download the distortion grid and put it in the right place for us to use, you can paste the following into your bash shell:

wget http://www.icsm.gov.au/gda/gdatm/national66.zip
unzip national66.zip
mkdir -p ~/bin
mv "A66 National (13.09.01).gsb" ~/bin/a66_national.gsb
rm national66.zip

I’ve also archived the grid files using Webcite, if the ICSM link is dead replace please see the archive.

Please note that if you change the filenames to something that contains spaces or funky punctuation ogr2ogr might not find it, and will not perform the grid transformation, leaving you with incorrect coordinates. So I would recommend just running the above code verbatim.

Then, to transform a shapefile from AGD66 to GDA94 type the following:

ogr2ogr -f "ESRI Shapefile" -s_srs "+proj=longlat +ellps=aust_SA +nadgrids=~/bin/a66_national.gsb +wktext" -t_srs EPSG:4283 outputgda94.shp inputagd66.shp

You will need to change the filenames outputgda94.shp and inputagd66.shp to whatever suits you.

Advertisements

  1. Thanks Ivan. ICSM had updated their website which broke the old links. I’ve updated this blog to point to the correct page, and added Webcite links for posterity.




Leave a Reply

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

WordPress.com Logo

You are commenting using your WordPress.com 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



%d bloggers like this: