Created
October 4, 2014 17:25
-
-
Save mpetroff/5fa4c374426daa6be476 to your computer and use it in GitHub Desktop.
Convert marine gravity anomaly map to GeoTIFF
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Convert to NetCDF | |
img2grd grav.img.23.1 -Ggrav.nc -Rg | |
# Reencode since gdal didn't like NetCDF file | |
cdo -f nc4c -k lines copy grav.nc grav2.nc | |
# Create GeoTIFF | |
gdal_translate -a_srs EPSG:4326 grav2.nc grav.tif | |
# Reproject as EPSG:3857 | |
gdalwarp -multi -wo SOURCE_EXTRA=100 -r cubic -t_srs EPSG:3857 grav.tif grav2.tif | |
# Convert from floating point to integer and compress | |
gdal_translate -scale -647 729 -ot byte -co COMPRESS=DEFLATE grav2.tif gravity.tif |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment