This project was completed for my Programming GIS course. The purpose of the code is to automate processing of new GPS data by merging the imported shapefile to a specific basefile.
The code is useful when the collection of new data is being undergone. From my experience as GIS Intern at the City of Edina collecting new GPS data could have been more efficient and less time consuming if we would have automated the process of processing trimble data after the data had be collected.
The project was a cure for mundane tasks I performed while working for the city. Now if I'm ever an intern again I can quickly slide past the task of processing data manually. :)
|
File Structure Python Code is Based Off
New trimble data gets dump to this file
Base File is where active files are used
Backup fold is to add a copy of data collected |
|
Python Code to Automate Workflow for Newly Imported Trimble Data
|
|
Variables used:
in_data = "base shapefile located in the Base File folder"
temp = "this is a temporary shapefile created in order for the merge to run"
in_new = "newly imported GPS data from trimble"
output_copy = "this becomes an the output path/name to back up the trimble data to a backup folder"
out_data = "this is the merged shapefile of the trimble data with the base shapefile"
|
|
The rename management is necessary because a merge can't have the same input and output. The rename of the basefile becomes a work abound that the user will never see.
The merge tool merges the imported GPS data file (chosen by user) and the temporary shapefile (actually basefile) together outputing an updated Basefile.shp
|
|
The copy management tool moves the imported GPS shapefile to a backup folder for safe keeping.
The delete management tool deletes the imported GPS shapefile once it has been merged and copied to backup folder and it also deletes the temp.shp that was created for the purpose of running the merge tool.
|
No comments:
Post a Comment