This is a personal record of my python programming experiences. It will allow me to see how I am progressing as I learn a new language.
Saturday, February 16, 2013
Python Tutorial
I'm taking a tutorial on python. This lesson is showing how to use the sys module. I am enjoying learning new things about python.
Friday, February 1, 2013
Arcmap program
#Written by Steve Atchison Jan 29 2013
def protestacres():
totalacre=0.00
for row in arcpy.SearchCursor("ROW & Protest Acres"):
acres = row.getValue('ClippedAcres')
totalacre=float(totalacre)+float(acres)
print("Area of Protesting Properties = %.2f" % totalacre)
return totalacre
def grossacres(): #1000' Buffer acres
for row in arcpy.SearchCursor("Gross acres including subject & ROW"):
acres = row.getValue('ClippedAcres')
print("Gross acres including Subject Property & ROW = %.2f " %acres)
return acres
def areasubject():
for row in arcpy.SearchCursor("SubjectProperty"):
subjectsqft = row.getValue('Shape_Area')
subjectacres = float(subjectsqft/43560)
print("Area of Subject Property is %.2f " % subjectacres)
return subjectacres
def arearow():
for row in arcpy.SearchCursor("ROW acres"):
rowac = row.getValue('ClippedAcres')
print("Area of Street ROW = %.2f " %rowac)
return rowac
def extent_of_protest():
netacreage = grossacres()-(areasubject()+arearow())
print(protestacres()/float(netacreage))
extent_of_protest()
#SELECT THE PROTESTING PROPERTIES FIRST BEFORE RUNNING THIS PROGRAM!
def protestacres():
totalacre=0.00
for row in arcpy.SearchCursor("ROW & Protest Acres"):
acres = row.getValue('ClippedAcres')
totalacre=float(totalacre)+float(acres)
print("Area of Protesting Properties = %.2f" % totalacre)
return totalacre
def grossacres(): #1000' Buffer acres
for row in arcpy.SearchCursor("Gross acres including subject & ROW"):
acres = row.getValue('ClippedAcres')
print("Gross acres including Subject Property & ROW = %.2f " %acres)
return acres
def areasubject():
for row in arcpy.SearchCursor("SubjectProperty"):
subjectsqft = row.getValue('Shape_Area')
subjectacres = float(subjectsqft/43560)
print("Area of Subject Property is %.2f " % subjectacres)
return subjectacres
def arearow():
for row in arcpy.SearchCursor("ROW acres"):
rowac = row.getValue('ClippedAcres')
print("Area of Street ROW = %.2f " %rowac)
return rowac
def extent_of_protest():
netacreage = grossacres()-(areasubject()+arearow())
print(protestacres()/float(netacreage))
extent_of_protest()
#SELECT THE PROTESTING PROPERTIES FIRST BEFORE RUNNING THIS PROGRAM!
Subscribe to:
Posts (Atom)
Followers
Blog Archive
- June (1)
- March (3)
- February (1)
- July (3)
- May (1)
- April (1)
- March (1)
- January (1)
- December (1)
- November (4)
- July (3)
- May (2)
- April (1)
- March (6)
- February (2)
- December (1)
- November (1)
- September (3)
- August (3)
- July (1)
- March (3)
- January (1)
- December (5)
- November (2)
- October (1)
- September (2)
- August (1)
- July (4)
- May (3)
- February (1)
- January (1)
- December (1)
- November (2)
- October (2)
- September (9)
- August (2)
- May (1)
- April (1)
- March (6)
- February (5)
- January (3)
- August (2)