def intersect(self,icov,feat): self.function = 'intersect' icov.checktopology('polygon') outcov = tempcov() self.outcovexists(outcov) self.checktopology(feat) code = ''' intersect %s %s %s %s 0.00000000001 ''' % (self.name,icov.name,outcov,feat) self.writecode(code) return Cover(outcov,self.file)
def union(self,ucov): self.function = 'union' self.checktopology('polygon') ucov.checktopology('polygon') outcov = tempcov() self.outcovexists(outcov) code = ''' union %s %s %s 0.000000001 ''' % (self.name,ucov.name,outcov) self.writecode(code) return Cover(outcov,self.file)
def erase(self,ercov,feat): self.function = 'erase' ercov.checktopology('polygon') outcov = tempcov() self.outcovexists(outcov) self.checktopology(feat) code = ''' clip %s %s %s %s 0.0000000000001 ''' % (self.name,ercov.name,outcov,feat) self.writecode(code) return Cover(outcov,self.file)
def arcpoint(self,item): self.function = 'arcpoint' outcov = tempcov() self.outcovexists(outcov) self.checktopology('arc') self.checkitem('arc',item) code = ''' arcpoint %s %s line %s ''' % (self.name,outcov,item) self.writecode(code) return Cover(outcov,self.file)
def buffer(self,dist,feat): self.function = 'buffer' if feat == 'arc': feat = 'line' outcov = tempcov() code = ''' &do buffer %s %s # # %s 0.000000000001 %s &end ''' % (self.name,outcov,dist,feat) self.writecode(code) return Cover(outcov,self.file)
def near(self,ncov,feat,rad): self.function = 'near' if feat == 'point': ncov.checktopology('point') elif feat == 'arc': ncov.checktopology('arc') outcov = tempcov() self.outcovexists(outcov) code = ''' near %s %s %s %s %s ''' % (self.name,ncov.name,feat,rad,outcov) self.writecode(code) return Cover(outcov,self.file)
def reselect(self,feat,query): self.function = 'reselect' self.checktopology(feat) outcov = tempcov() self.outcovexists(outcov) code = ''' reselect %s %s %s res %s ~ n n ''' % (self.name,outcov,feat,query) self.writecode(code) return Cover(outcov,self.file)
self.checktopology(feat) code = ''' editfeature %s ''' % feat self.writecode(code) # An example to show how to usr the Cover and Cursor objects # This example takes the junction features out of two covers # buffers them and compares the buffer polygons to check that they # are coincident in both covers. if (__name__ == '__main__'): import sys import EditSession file = string.lower(tempcov()) + '.aml' f = Cover('i5308fm',file) w = Cover('i5308wm',file) fjunc = f.reselect('arc',"feat_code = 'junction'") wjunc = w.reselect('arc',"lpoly# = 1 | rpoly# = 1") wjunc2 = wjunc.reselect('arc',"feat_code = 'junction'") fjbuf = fjunc.buffer(1,'line') wjbuf = wjunc2.buffer(1,'line') wfunion = fjbuf.union(wjbuf) wfunion.addxy() cur = Cursor(wfunion,'polygon','ro','%s-id = 0 & area > 0'% fjbuf.name) proc = ''' &ty &ty Waterbody junction does not have corresponding framework junction