View file - Bitbucket

taxidermistplateSoftware and s/w Development

Nov 7, 2013 (3 years and 11 months ago)

68 views

Python Programming
Final

Using code to highlight tropical cyclone areas.

By: Robert Hyde

For:
Zac

Miller

Python Programming Fall 2012

About my code


Take columns or rows from a .
csv

file and pulls out
data.


Then creates a buffer feature and
shapefile

to project
onto other
shapefiles
.



def

data(
output_name
, delimiter = ','):



output_file

= open("{0}".format("data.txt"),'w')






o = open('Cyclone_Landfalls.
csv
','r')



landfall =
o.readlines
()



o.close






for points in landfall:



points =
points.strip
().split(',')



Lat_DD

=
str
(points[12])



Long_DD

=
str
(points[13])



print "Latitude:" +
Lat_DD



print "Longitude:" +
Long_DD






output_file.write
("{0}{2}{1}
\
n".format
(
Lat_DD
,
Long_DD
, delimiter))






output_file.close
()





import
arcpy





input_featureclass

= "K:
\
Shared
\
GIS
\
StuHome
\
924204691
\
GIS_Projects_2012
\
Python
\
XY.shp"





output_featureclass

=
"K:
\
Shared
\
GIS
\
StuHome
\
924204691
\
GIS_Projects_2012
\
Python
\
PythonXY.mxd"





distance = "40 miles"





arcpy.Buffer_analysis
(
input_featureclass
,
output_featureclass
, distance)