Exercise Seven: Network Analysis- Selecting Wisconsin Mines with certain parameters
The following python script shows the process of selecting mines based on these criteria:
- The mine must be active
- The mine cannot have its own loading station
- The mine has to be at least 1.5 kilometers away from a railroad terminal
Starting the script it was necessary to define the variables for the feature classes. For example, the variable set for the active_mines feature class was "act". Setting the variables ahead of time organizes the inputs and outputs while simplifying the script.
The next step in python was to add field delimiters which provide the correct field information when creating an SQL statement. Field delimiters tell the program what field to search in. In this case "field1" dictated that when "field1" is coded in the script the field "SITE_STATU" in the attribute table is where the information will be found.
Then, SQL statements were built to select active mines and only mines that did not have on-site loading stations.
The SelectLayerByLocation tool was used to query out the mines that were within a distance of 1.5 kilometers of a rail station.
Finally, the CopyFeatures tool was scripted to make a feature class for the mines that met all the criteria above.
Exercise Five: Working with Projections in Python
No comments:
Post a Comment