Hi All,
I have written some Python code for the RasterProcessing.Clip function and wondered if you could help with getting the Clip Region to take the form Region Polygon Selection, as currently I have only been able to get the Clip Region as Region All Polygons within the tab file. Any ideas
@Anshul Goel?
#Raster Clip Operation using Tab File Input
import string
import clr
import os
import sys
from os.path import abspath, join, dirname, exists
sys.path.insert(0,"C:\\Program Files\\MapInfo\\Professional19\\Raster")
clr.AddReference("MapInfo.RasterEngine.IO")
clr.AddReference("MapInfo.RasterEngine.Common")
clr.AddReference("MapInfo.RasterEngine.Operations")
from MapInfo.RasterEngine.Operations import RasterProcessing
from MapInfo.RasterEngine.Common import RasterInputDetails, RasterApiOptions, RasterClipExtent
from MapInfo.RasterEngine.IO import DriverIDExtensions, DriverID
#Input and output file path
rasterInput = r"raster_filepath_in"
rasterOutput = r"raster_filepath_out"
outputRasterDriverID = DriverIDExtensions.GetString(DriverID.ASC)
tabInput = r"tab_filepath"
retainInsideRegion = True
apiOptions = RasterApiOptions(RasterClipExtent())
RasterProcessing.Clip(rasterInput, tabInput, rasterOutput, outputRasterDriverID, retainInsideRegion, apiOptions)
Any help would be much appreciated,
Thanks,
Luke
------------------------------
Luke Lynx
Knowledge Community Shared Account
------------------------------