#Preparation (unfortunately the Spearfish aerial images are published in the # proprietary MrSID format: Conversion to GeoTIFF using the # non-free 'mrsiddecode' for Linux from www.lizardtech.com: #mrsiddecode -tif -input i44103d7_a.sid -output i44103d7_a.tif #Display raster file info: gdalinfo i44103d6_b.tif #which formats are supported: gdalinfo --formats
Assigning a Spatial Reference System (a_srs) to fix the missing raster map projection info (UTM/NAD83):
#EPSG file: /usr/local/share/proj/epsg gdal_translate -of GTIFF -a_srs '+init=epsg:26913' \ i44103d6_b.tif i44103d6_b_NAD83.tif gdalinfo i44103d6_b_NAD83.tif
Reprojecting maps ("warping") to different projection/geodetic datum (UTM/NAD27) to make ready for Spearfish location:
gdalwarp -t_srs '+init=epsg:26713' i44103d6_b_NAD83.tif \ i44103d6_b_NAD27.tif gdalinfo i44103d6_b_NAD27.tif
Spatial subsetting (cut out region):
# W N E S gdal_translate -of GTiff -projwin 636861 5152686 745617 5054047.5 \ p192r28_5t19920809_nn1.tif p192r28_subset1.tif
ogrinfo buek50.shp INFO: Open of 'buek50.shp' using driver 'ESRI Shapefile' successful. 1: buek50 (Polygon) #To get layer metadata, also specify layer name and '-summary': ogrinfo -summary buek50.shp buek50 #which formats are supported: ogrinfo --formats
Assigning a Spatial Reference System (a_srs) to fix the vector map:
ogr2ogr -a_srs '+init=epsg:31463' buek50_GKzone3.shp \ buek50.shp ogrinfo -summary buek50_GKzone3.shp buek50_GKzone3
Reprojecting maps to different projection/geodetic datum:
#reprojecting vector maps with 'ogr2ogr' from Gauss-Krüger to UTM/ED50: # from EPSG file: # ED50 / UTM zone 32N # <23032> +proj=utm +zone=32 +ellps=intl +units=m +no_defs no_defs <> ogr2ogr -t_srs '+init=epsg:23032' buek50_UTM_ED50.shp \ buek50_GKzone3.shp ogrinfo -summary buek50_UTM_ED50.shp buek50_UTM_ED50