Take me to pcigeomatics.com

PCI Geomatics Help Center

How can we help you today?

cutline

PCI Geomatics -

!--------------------------------------------------------------------------------!
!										 !
!	This script is used for creating vector layers of cutlines in 		 !
!       a mosaic project in OrthoEngine.					 !
!      										 !
!       The user is required to enter in the name of the OrthoEngine project     !
!       and the output file name of the cutline.				 !
!  										 !
!--------------------------------------------------------------------------------!


local GeoInfo sGeoInfo

local mstring FileList, Tokens
local string sFilename, sDestinationFile, IOFIleList
local int i, j, fd, fdexp, layer, Shape
local int NameField
local Vertex Vertices[5000]


print "Start generating footprints"

Input "Enter OE project file name (full path) " sFilename
FileList = TEXT$Import(sFilename)

Input "Enter PIX file name for cut line (full path & extension) " sDestinationFile

print "Creating file " + sDestinationFile
fdexp = DBCreate(sDestinationFile, "PIX", 512, 512, 0, "8U", "")
Layer = VECCreatelayer(fdexp, "cutlines")

sGeoInfo.units = "METER"

call VECWriteGeoInfo(fdExp, Layer, sGeoInfo)

NameField = VECAddField(fdExp, Layer, "PhotoName", "String", "%100s")

for i = 1 to F$Len(FileList)

    if FindSubString(FileList(i), "PhotoCutline:") <> -1 then
Rem Read Named Region 
        Tokens = tokenize(FileList(i + 2))
        print "Cutline : " + tokens(2)

	Shape = VECCreateShape(fdExp, Layer)

	call VECSetField(fdexp, Layer, Shape, NameField, tokens(2))

! get vertices
        i = i + 4
	j = 0
        if FindSubString(FileList(i),"BlendWidth:") <> -1 then
             i = i + 1
        endif
        while FindSubString(FileList(i), "Vertex:") <> -1
            Tokens = tokenize(FileList(i))
            j = j + 1
	    Vertices[j].x = F$Value(Tokens(3))
            Vertices[j].y = F$Value(Tokens(4))
 
            i = i + 1

        endwhile
        call VECSetVertices(fdExp,  Layer, Shape, j, Vertices)

    endif

endfor

call DBClose(fdexp)

Have more questions? Submit a request

Comments

Powered by Zendesk