Skip to content

Instantly share code, notes, and snippets.

@IReese
Last active October 30, 2019 21:46
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save IReese/a7aee00ff738ada727c810a3221dd37d to your computer and use it in GitHub Desktop.
Save IReese/a7aee00ff738ada727c810a3221dd37d to your computer and use it in GitHub Desktop.
#!/bin/bash
FILE_IN=$1
function gdal_get_proj() {
PROJ4=$(gdalinfo -nomd $1 |\
grep "EXTENSION" |\
sed 's/EXTENSION//g' |\
sed 's/PROJ4//g' |\
tr -d "[],\"" |\
sed 's/ //')
echo -n $PROJ4
}
proj4=$( gdal_get_proj ${FILE_IN} )
echo $proj4
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment