Getting Started with Python - Basic Understanding
|
Introduction
It is assumed that the learner has the skills and understanding as noted in the introduction. This module will provide a general overview of Python scripting. The Python covered in this module will not be related to geospatial technologies, but instead will be a basic understanding of how Python functions and how scripts are structured. Some of the concepts in this module will be covered in more depth when they deal specifically with geospatial technology in future modules.
Purpose
Often in geospatial technology, the same operation is performed on multiple data sets which requires the user to perform repetitive operations. In general, this is moving the cursor around, clicking on different buttons, selecting specific files and commands. As part of the operation process, manually derived decisions are required based on the data that is to be analyzed; this can produce maps that will lack functionality, creativity and flexibility. It is important to note that throughout these technical skills lessons the use of good naming conventions will be stressed.
- Using Python scripts will provide the learner with the means to explore multiple automating processes using a single script. For example, when creating clips using the same polygon file on multiple features like roads, rivers and landmarks, a single line of script can be used for each clip operation instead of the multiple processes required to manually perform the task. The data content can provide different mapping solutions without the need to review the results.
- Analyses can be automated to determine the best way to utilize data sets.
- The use of decision making routines based on how a field is displayed or calculated can produce mapping results that are more dynamic.
- Creating specialized tools for routine operations that are redundant is an important concept. For example, if sets of counties are merged together and then used as the clipping boundary for statewide data sets, this could be created in a single simple script. Manual input of the counties would be required; the script would merge the counties and make a new polygon, this boundary would clip the information from the statewide data sets. The usefulness of this type of scripting shows when it can be used for another similar type of operation after it has been created.