Projections¶
This section provides some basic recipes for reprojecting rasters and vectors, as well as, resampling imagery from the native resolution to a new user-defined resolution (ground sampling distance (GSD)).
Reproject an image from one coordinate system to a different coordinate system¶
This recipe uses a single Geomatica function to reproject an image from a UTM NAD83 projected coordinate system to a Latitude and Longitude WGS84 geographic coordinate system
from pci.reproj import reproj input_file = r"D:\Data\irvine.pix" #UTM WGS84 projection reproj_file = r"D:\Data\irvine_reroj.pix" resolution = [10, 10] map_units = "UTM 11 D000" #output will be longitude and latitude with NAD83 Ellipse reproj(fili=input_file, dbic=[1], filo=reproj_file, repmeth="BR", pxsz=resolution, mapunits=map_units)
Resample Image channels¶
This recipe demonstrates how to change the ground sampling distance (GSD) or image resolution from the input resolution to 4m resolution, using a cubic convolution resampling method.
from pci.resamp import resamp input_file = r"D:\Data\irvine.pix" # 2m resolution data resampled_file = r"D:\Data\irvine_resamp.pix" resamp(fili=input_file, dbic=[1], filo=resampled_file, pxszout=[10.0, 10.0], resample="cubic")