Download GIS Programming with Python

Survey
yes no Was this document useful for you?
   Thank you for your participation!

* Your assessment is very important for improving the workof artificial intelligence, which forms the content of this project

Document related concepts

Programming language wikipedia , lookup

Go (programming language) wikipedia , lookup

Functional programming wikipedia , lookup

Falcon (programming language) wikipedia , lookup

C Sharp (programming language) wikipedia , lookup

Python syntax and semantics wikipedia , lookup

Abstraction (computer science) wikipedia , lookup

Corecursion wikipedia , lookup

Object-oriented programming wikipedia , lookup

Reactive programming wikipedia , lookup

Structured programming wikipedia , lookup

Python (programming language) wikipedia , lookup

Transcript
GIS Programming with Python
Video Transcript
Slide 1
In this last video in the Week 5 series,
we will discuss GIS programming using
Python.
Introduction
to GIS
GIS PROGRAMMING - PYTHON
Slide 2
If you’re performing the same tasks
repeatedly, or you find yourself
performing manual fixes, you likely
can reduce your effort through custom
code. Programming in GIS allows you
the flexibility to perform specific tasks
to your job, enhancing the basic GIS
functions to fit your needs. You can
also use it to perform quality control
audits and updates of data without
the need of the dreaded manual data
entry. ModelBuilder can actually
export to Python and is a great
starting point for many programming
projects.
Why Program in GIS?

Perform industry/company
specific tasks

Enhance basic GIS functions
to perform common tasks
automatically and quickly

Perform QAQC
audits/updates on data

Modelbuilder can export to
Python
UWF GIS Online
Copyright, 2016
Page 1
Geographic Information Systems
GIS Programming with Python
Slide 3
Python is a programming language
that lets you work more quickly and
integrate your systems more
effectively If you are going to script in
GIS, then python is the language for
you! Easy to learn and excellent for
beginners, yet superb for experts
Highly scalable, suitable for large
projects or small one-off programs
known as scripts Portable, crossplatform Embeddable (making GIS
scriptable) Stable and mature A large
user community Python extends
across GIS and becomes the language
for data analysis, data conversion, data
management, and map automation,
helping increase productivity Python is
the scripting language of choice for
ArcGIS users because it is: Simple and
easy to learn Free and open source
Cross-platform compatible
Interpreted, not compiled Object
oriented
Why Python?

Easy to learn and excellent for beginners, yet
superb for experts

Highly scalable, suitable for large projects or
small one-off programs known as scripts

Portable, cross-platform

Embeddable (making GIS scriptable)

Stable and mature

A large user community

Python extends across GIS and becomes the
language for data analysis, data conversion,
data management, and map automation,
helping increase productivity
Slide 4
When PythonWin opens, you’ll see
what’s known as the Interactive
Window.
You can type a line of Python at the
>>> prompt and it will immediately
execute and print the result, if there is
a printable result.
The Interactive Window can be a good
place to practice with Python. the
Interactive Window is very similar to
the Python window in ArcGIS. To
actually write a new script, click File >
New and choose Python Script. Notice
a blank page opens that looks a whole
lot like Notepad. However, the nice
thing about this interface is that the
UWF GIS Online
Copyright, 2016
Page 2
Geographic Information Systems
GIS Programming with Python
code is color-coded and the default
font, Courier, is one typically used by
programmers. Spacing and
indentation, which are important in
Python, are also easy to keep track of
in this interface.
The Standard toolbar contains tools
for loading, running, and saving
scripts. This toolbar is visible by
default. Notice the Undo / Redo
buttons , which can be useful to you as
a programmer if you start coding
something and realize you’ve gone
down the wrong path, or if you delete
a line of code and want to get it back.
Also notice the Run button , which
looks like a little running person. This
is a good way to test your scripts
without having to double-click the file
in Windows Explorer.
The Debugging toolbar contains tools
for carefully reviewing your code lineby-line to help you detect errors. This
toolbar is visible by clicking View >
Toolbars > Debugging. The Debugging
toolbar is extremely valuable to you as
a programmer. This toolbar is one of
the main reasons to use an Integrated
Development Environment (IDE)
instead of writing your code in a
simple text editor like Notepad.
UWF GIS Online
Copyright, 2016
Page 3
Geographic Information Systems
GIS Programming with Python
Slide 5
While you will get a little programming
experience in the UWF lab this week,
we obviously can’t teach you
everything there is to know about
programming for GIS in one short
lesson. There are a variety of online
resources that can teach you how to
program for GIS. If you have a basic
knowledge of computer programming,
you are well on your way to being able
to program for GIS. Programming for
GIS just adds the spatial element to
the programming logic.
Learn GIS Programming

Variety of online sources

Knowledge of basic programming

Add the “spatial” to the programming
This concludes the lectures for Week
5. The UWF lab “2011 Tohuku Tsunami
Evacuation,” was developed as a
guided "real-world" GIS project. Using
a disaster scenario, you will practice
skills for the preparation,
maintenance, and organization of
spatial data. We introduce some new,
more advanced spatial analysis and
geoprocessing tools as well as
introducing ModelBuilder and Python
to automate workflows. This lab takes
a different approach by building on
what you have learned so far and
preparing you for working with GIS in
a variety of different situations. I hope
you are enjoying the class so far and
look forward to seeing you online!
UWF GIS Online
Copyright, 2016
Page 4
Geographic Information Systems
GIS Programming with Python