Berwick, Nova Scotia Oblique Airphoto

Script to clip the unnecessary excess portions of an air photo mosaic

Below is a simple EASI script that when used with the MODEL command in PCI will clip the unnecessary excess portions of an air photo mosaic created from Ortho Engine to an irregular buffered shape around a set study area. This was originally created for PCI Geomatica v9.1 but was last tested and working with no problems in PCI Geomatica v10.0 – Just copy the code below into a blank text file and edit as needed.

!——————————————————————————————–

! Irregular_Polygon_Clip [bitmap_clip.eas]

! Ted MacKinnon – tmackinnon.com

! This simple script used with the MODEL command in PCI EASI

! will clip the unnecessary excess portions of an airphoto mosaic

! to an irregular buffered shape around the study area.

!

! The working file ‘working-file.pix’ has the existing

! mosaic image located in the first three channels,

! an existing irregular shaped polygon bitmap and

! three empty 8 bit channels.

!

! %%2 is the bitmap mask of the irregular shape

! %1, %2, %3 are the RGB existing image channels

! %4, %5, %6 will be the new modeled RGB image channels

! the RGB value of 255, 255, 255 will set the background to white

!

! Simply change the file name to use this script with a different

! file and ensure that the channels and segments are setup the same

!——————————————————————————————–

!——————————–

! Set up and run the model

!——————————–

MODEL ON “working-file.pix” OVER dbiw

if %%2 = 1 then

%4 = %1;

%5 = %2;

%6 = %3;

else

%4 = 255;

%5 = 255;

%6 = 255;

endif;

ENDMODEL

!———————————————-

! Export the resultant channels to a new file

!———————————————-

FILI = “working-file.pix

FILO = “mosaic_clipped.tif

DBIW =

DBIC = 4,5,6

DBIB =

DBVS =

DBLUT =

DBPCT =

FTYPE = “TIF

FOPTIONS = “”

RUN FEXPORT

!——————————————————————————————–