Title: GE30180 Applying GIS Developing GIS Solutions
1GE30180Applying GISDeveloping GIS Solutions
2New MSc in GISc
- If you are enjoying GIS, consider a further
degree in the area - Its a very employable field worldwide
- Contact me if you are interested
- John.lindsay_at_manchester.ac.uk
3Readings
- Eastman, R. (2001) The Evolution of Modeling
Tools in GIS, available online at - http//www.directionsmag.com/article.php?article_
id114trv1 - Lo CP and Yeung AKW. 2002. Chapter 11 GIS
Implementation and Project Management in Concepts
and techniques of geographic information systems
4- There is a debate about whether GISc is a genuine
sub-discipline of Geography or simply a tool. - This is an academic debate, and has little
relevance for you - Most of you are simply concerned about finding a
job after this degree
5GIS provides a rich opportunity to find
employment after your degree
Increasingly, employers want people that are not
just GIS users, but are GIS developers
6- GIS users are limited to the functionality that
is available through the standard GUI. - GIS developers can enhance GIS functionality.
They get the GIS to do what they want it to!
7Button-pushing, black-box GIS users
- We use GIS to solve spatial problems, but what if
our particular problem cant be solved by
pressing a button? - GIS programming allows you to manipulate/analyse
spatial data at a very basic level. - GIS programmers see the algorithm and the data
white-box GIS! - This is very powerful for spatial analysis.
8Why program GIS?
- Create custom GIS interfaces for special purposes
- Automate repetitive or iterative tasks
- Automate complex spatial modelling
- Add functionality
- For Monte-Carlo simulation (involves random
processes and many iteration)
9Example Tasks
- Reproject 100 shapefiles from Lat/Long to UTM
coordinates. - Build a simplified map interface for use by land
managers with customized features. - Include a map in an EXCEL spreadsheet.
- Model the error involved in extracting stream
networks from DEMs.
10Developments in GIS Programming
- Macro-scripting languages (e.g. Arc/Infos AML,
IDRISIs IML, TASs RCS) - Sequence of command-line statements calling
functions - Some allow variables and control structures (e.g.
loops) - Tend to be system specific
- Can be tedious to construct and debug
11TAS script
Uncertainty in mapped streams
12Developments in GIS Programming
- Calculator Programs
- Immediately familiar and easy to use
- Allow complex equations
- Can usually save expressions and run multi-line
expressions - Some (not all) are limited in functionality
13ArcGIS
TAS GIS
IDRISI
14Developments in GIS Programming
- Graphical Modellers
- Flowchart story of operations
- Allows for rapid sharing of models among users
15ArcGISs ModelBuilder
16IDRISIs Macro Modeller allows dynamic modelling
17Developments in GIS Programming
- A very recent trend in GIS is to adopt the
Component Object Model (COM). - COM describes the way that software components
communicate and it is independent of the
programming language. - COM servers (e.g. ArcGIS) expose some of their
functionality to other applications.
18Developments in GIS Programming
- Thus it is possible to use VB, VBA, VC, Delphi
to write programs to control the GIS like a
puppet. - Examples include ArcObjects and IDRISI32s API.
19(No Transcript)
20GIS and Programming Languages
- ArcView used AVENUE
- Object-oriented
- Used only in ArcView
- ArcGIS uses VB (VBA) and Python
- You could use any Object-Oriented Programming
(OOP) language, e.g. C, C, Java, etc.
21Scale of Development
- (Calculator expression)
- Script or model
- Custom GUI
- Extension
- Stand-alone application
Increasing complexity and investment
22Getting Help
23ArcGIS help function is very useful
24ArcScripts is a useful online resource
25Take a 10 minute breather
26Programming Basics
27Object-oriented Programming
- A way of developing programs that can be more
easily re-used. - Often used for graphical interfaces
- Common object oriented languages include
- JAVA
- C
- Python
- Visual Basic
28Principles of Object-Oriented Programming
- CLASSES include
- PROPERTIES
- The data communicated to and from the class
- METHODS
- Actions that can be taken including
- Getting or setting properties
- Performing actions on data based on the properties
29Principles of Object-Oriented Programming
- The CLASS TVset
- Properties
- Channel
- Methods
- GetChannel reports current channel
- SetChannel sets channel to designated number
- Note the CLASS TVset defines the characteristics
of TV sets in general and not any particular TV
set.
30Principles of Object-Oriented Programming
- Classes
- Lives in code
- Its code to control how objects work
- Objects
- An instance of a Class
- Lives in memory
- The methods and properties defined by the class
are available in an instance of the class (i.e.
an object)
31VB6 vs. VBA vs. VB.NET
- VB6 is and older and much used language
- The VBA language is a sub-set of VB6
- VB.NET and VB2005 are more recent and have been
significantly modified
32Variables start with a letter, can contain
numbers, letters, underscore characters
33Public vegname as String Private area, perimeter
as Double
34(No Transcript)
35Subroutines
. . . Call DoSomething () . .
Public Sub DoSomething() . . . End Sub
36Subroutines vs. Functions
Public Sub square() Dim x As Single x 3
x2 square(x) MsgBox (x2) End Sub
Public Function square(a As Single) As Double
'take input and square it square a a End
Function
37If-Then-Else Decisions
If DoesFileExist(FileName) TRUE then Kill
FileName End If OR If DoesFileExist(FileName)
TRUE then Kill FileName Else MsgBox File
does not exist,vbOKonly End If
38Select Decisions
DIM a as Integer a CInt(textbox1.text) Select
Case a Case 1 Msgbox You typed 1.,
vbOKonly Case 2 Msgbox You typed 2.,
vbOKonly Case 3 Msgbox You typed 3.,
vbOKonly Case Else Msgbox You typed a
high number.,_ vbOKonly End Select
39The For Loop
DIM a, b as Integer For a 1 to 10 Step 1 b
b 1 Next a
Nested For Loops
For Row 1 to TotalRow Step 1 For Col 1 to
TotalCol Step 1 Array1(Col, Row)
Array2(Col, Row) Next Col Next Row
40The Do Loop
Do While Until condition
statements Loop OR Do statements Loop
While Until condition
41The Do Loop
DIM a as Integer a 1 Do While a lt 100 a a
1 Loop Do a a - 1 Loop Until a 50
42Getting help
- Microsoft Developers Network (MSDN)
- Contains a wealth of information on the MS visual
programming languages (VB, VBA, C, C, Java). - Has tutorials and examples.
- Several good books on VB and other programming
languages are available in the library.
43Your GIS Solution
- 25 of your final grade will be based on a GIS
solution. - Must involve one or more of the development
approaches that we have discussed. - Must be more than a simple calculator expression
and likely less than a full extension (unless
youre really ambitious!) - Related to one of the three application areas
- Social Exclusion
- Air Quality Management
- Terrain Analysis
44Your GIS Solution
- 500 words description of your solution including
- What it was intended to achieve
- How you developed it
- What some of the difficulties that you ran into
were - A sample of the results of your solution
45Your GIS Solution
- You need not replicate the entire analysis of the
practical exercise. - It could focus on automating one part of the
analysis, or it could extend the analysis beyond
that directly covered in the practical. - e.g. you could write a script to automatically
evaluate the performance of fire tower heights
and locations.
46Your GIS Solution
- You will be assessed on
- Clarity of objectives
- Appropriateness of your approach to the GIS
solution - Completeness
- Initiative
- Originality
47Thats it for now!
- Ill see you next week in the computer cluster.