开发者

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

开发者 https://www.devze.com 2023-01-02 10:29 出处:网络
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.

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开发者_Python百科 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.


Use the OpenSource GDAL libraries.

To convert coordinates on their own us the GGAL transform utility: http://www.gdal.org/gdaltransform.html

To convert a whole shapefile use: http://www.gdal.org/ogr2ogr.html

There is a command line example for a shapefile at the bottom of the page.


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
0

精彩评论

暂无评论...
验证码 换一张
取 消