Professional Documents
Culture Documents
Scott Barbacki,
Niagara College
135 Taylor Road
Niagara-on-the-Lake, ON
L0S 1J0
RE: Deliverable 2 Create a Feature Class from XY Data for GISC9317 Advanced Programming for
GIS.
Please accept this letter as my formal submission of Deliverable 2 Create a Feature Class from XY Data
for GISC 9317 Advanced Programming for GIS.
The purpose of the following deliverable is to write a Python script to create point feature class from an XY
text file. Python is an optimal tool for automating process such as creating feature classes from a text file.
Two text files were used to determine the number of wineries present within a specific extent. Using a text
file of farms and wineries, the file was converted into a feature class and then into a shapefile. A single
shapefile entitled “npfarm.shp” was created showing the merging between the farms and wineries text file.
Based on the Python code, it concluded that there are 36 different wineries within the extent.
One challenge with the Python code was setting the environment workspace. Within the code, the
workspace is defined several times. This was to ensure that the right workspace was being used to allow
the code to run optimally. Garbage cleanup was performed at the end of the code to ensure residual data
has been deleted.
Should you have any concerns regarding the enclosed documents or if there are any questions please contact
me at your convenience via e-mail at winona.drouin@gmail.com or phone at (905)932-4534. I look forward
to hearing from you.
Warm Regards,
#Setting workspace
arcpy.env.workspace=r'C:\temp\d2RawData'
#Creation of loop
for txtFile in TextFiles:
arcpy.env.overwriteOutput=True
#Re-defining workspace
arcpy.env.workspace=newFolder
#Re-defining workspace.
arcpy.env.workspace=newFolder
#Garbage Clean-up
del newFolder
del TextFiles
del Split
del shapeFile
del results