Using Python for everyday GIS tasks Bo Castillo Berkeley County GIS PowerPoint PPT Presentation

presentation player overlay
1 / 27
About This Presentation
Transcript and Presenter's Notes

Title: Using Python for everyday GIS tasks Bo Castillo Berkeley County GIS


1
Using Python for everyday GIS tasksBo Castillo
Berkeley County GIS
2
Why doesnt everyone use Python?
  • People assume its beyond their technical ability
  • Steep initial learning curve
  • Time constraints and the question of where to
    even begin
  • Python is still relatively new to users of the
    ESRI suite of products

3
Why should I learn Python?
  • Saves time and makes your workload easier
  • Helps unlock the power of ArcGIS
  • Ability to use ArcGIS with other non-ESRI
    functions
  • Expectation of GIS professionals

4
Pros and Cons of Python
  • Easy to create basic scripts
  • Very flexible language
  • Ability to incorporate other functions
  • Limited only by your imagination
  • Support isnt very robust
  • Steep learning curve
  • GIS users of Python appear somewhat limited

5
Some examples using Python
  • Export data using todays date
  • Calling up DOS commands, etc.
  • Integrate all into one script and set on a timer

6
Part 1Adding todays date to a Python export
script
7
1. Build your model in model builder
8
2. Export to a Python script
1
2
9
3. Name and save the Python script
10
4. Edit the saved Python Script
11
5. View the Python code
12
6. Add code for DATE and SAVE as a different
name !!!
3
1
2
13
7. Run your new script
14
7. Check to see if the script worked
15
Part 2Integrating DOS command line functionality
16
1. Open up the EXAMPLE_1.py script
17
2. Add new DOS command line functions
2
1
3
4
18
3. Run Python script from DOS prompt
1
2
19
4. Check results of Python script
20
Part 3Run Python scripts on a timer
21
1. Start Windows Scheduled Tasks
22
2. Add Scheduled Task
23
3. Click next, then browse, select the Python
script
24
4. Set name, frequency, start time, etc.
25
5. Enter username/password, then finish
26
6. Verify scheduled task
27
Comments and Questions
Write a Comment
User Comments (0)
About PowerShow.com