1 / 16

Geo 580 – Python Short Course

Geo 580 – Python Short Course. Dr. Jim Graham. ArcGIS Python Short Course. This is a short course in using Python in ArcGIS based on Geo 599: Introduction to GIS Programming Website: Ibis.colostate.edu/jim The focus is on quickly learning to create scripts for “batch” operations in ArcGIS

aminia
Download Presentation

Geo 580 – Python Short Course

An Image/Link below is provided (as is) to download presentation Download Policy: Content on the Website is provided to you AS IS for your information and personal use and may not be sold / licensed / shared on other websites without getting consent from its author. Content is provided to you AS IS for your information and personal use only. Download presentation by click this link. While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server. During download, if you can't get a presentation, the file might be deleted by the publisher.

E N D

Presentation Transcript


  1. Geo 580 – Python Short Course Dr. Jim Graham

  2. ArcGIS Python Short Course • This is a short course in using Python in ArcGIS based on Geo 599: Introduction to GIS Programming • Website: Ibis.colostate.edu/jim • The focus is on quickly learning to create scripts for “batch” operations in ArcGIS • Batch operations repeat the same processing over and over, typically on a large set of files

  3. We are not learning… • Everything about Python • It’s a huge language that is growing all the time! • You only need a fraction of what is out there • The challenge is to find that fraction and get good at it! • Everything about programming ArcGIS • You will learn how to find anything available in programming ArcGIS

  4. Why Program? • Automate tasks • Repeated over and over again • Speed up tasks • Computers can run 24/7 • Allows for “exact” replication of processes • Except that the libraries you call will change! • “Encapsulate” functionality and expertise • You and everyone else can use it

  5. Definitions • Code – Instructions for a computer • Programming/Coding – writing, documenting, and testing code • Program – A file with instructions for a computer to execute to complete a task • Application – A program with a graphic user interface (as opposed to a command line interface) • Library – A file with code for a computer to be used by other programs

  6. Why Python? • ESRI’s primary scripting language (for now) • Very popular in GIS (Arc and OpenSource) • Very flexible (can solve lots of problems) • Well supported (with Wing IDE) • Easy to learn (relative to complied languages) • Portable • But it is not the fastest language • Compiled (C/C++, Java, C#) are faster

  7. GIS Library/Package • A library with code to complete GIS tasks • Spatially referenced data • Tasks specific to GIS • Union, intersect, mosaic, project, and lots more! • Options • ArcGIS – arcpy, etc. • GeoTools – Open source • GDAL, ORG, Proj – Open source • BlueSpray – SchoonerTurtles

  8. Big Picture ArcGIS Desktop Wing IDE Other Programs Model Builder Python Scripts ArcGIS Libraries Other Libraries Data Data includes GIS (spatially referenced) and non-spatially reference

  9. Installing • Install ArcGIS with appropriate license • Install Python from • Install Wingware IDE from Wingware.com • Latest version of “Wing IDE Personal” • Note: • ArcGIS installs their own version of Python! • Set the “Python Executable” to ArcGIS’s

  10. Open Project Properties…

  11. Set the “Custom” Path

  12. 1. Python Short Course • 2.3 Introduction to Programming in Python • 2.5 Arithmetic in Python • 2.6 Generating Random Numbers • 3.1 How Computers Work • 3.2 Boolean Logic and "If" Statements • 3.5 Lists, Ranges, and "For" Loops • 3.6 Strings are Made Up of Characters • 3.7 Writing to Text Files • 3.8 Grid ASCII File Format • 3.9 Creating ASCII Grid Files

  13. New Titanic Wreck Map • http://ngm.nationalgeographic.com/2012/04/titanic/titanic-interactive • http://ngm.nationalgeographic.com/ngm/0412/feature5/images/mp_download.5.pdf

  14. 2. Python Short Course • 4.2 Parsing (chopping up) Strings • 4.3 Reading Text Files • 6.1 Handling Exceptions • 6.2 An Overview of ArcGIS Functions • 6.3 Calling ArcGIS From Python • 7.1 More on Calling ArcGIS • 8.5 Batch Processing in Python

  15. Where to Go From Here • GIS @ OSU Links to Free ArcGIS Tutorials • An Informal Introduction to Python • Beginners Guide • Python for Non-Programmers

  16. Get code snippet from results • ArcGIS desktop help (website) • ArcGIS built-in help (not always correct) • Function definitiones in wing

More Related