Search code examples
bashgisgeographycoordinate-systemsshapefile

How can I convert a shapefile from AGD66 to GDA94 from a script, using open source libraries


How can I convert a shapefile from AGD66 to GDA94 programmatically, using open source libraries? I don't want to use arcgisscripting because I don't have a licence.

This needs to be automatable. A bash or python script would be acceptable.

This is a little more complicated than a normal reprojection, because a different ellipsoid is used between these coordinate reference systems, and thus a distortion grid needs to be used.


Solution

  • Sorry to answer own question, but here goes for posterity. Using the instructions here, first download the distortion grid:

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

    Then use ogr2ogr to reproject:

    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