GE30180 Applying GIS Developing GIS Solutions - PowerPoint PPT Presentation

1 / 47
About This Presentation
Title:

GE30180 Applying GIS Developing GIS Solutions

Description:

Immediately familiar and easy to use. Allow complex equations ... Take a 10 minute breather. Programming Basics. 27. Object-oriented Programming ... – PowerPoint PPT presentation

Number of Views:77
Avg rating:3.0/5.0
Slides: 48
Provided by: johnli7
Category:

less

Transcript and Presenter's Notes

Title: GE30180 Applying GIS Developing GIS Solutions


1
GE30180Applying GISDeveloping GIS Solutions
2
New 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

3
Readings
  • 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

5
GIS 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!

7
Button-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.

8
Why 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)

9
Example 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.

10
Developments 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

11
TAS script
Uncertainty in mapped streams
12
Developments 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

13
ArcGIS
TAS GIS
IDRISI
14
Developments in GIS Programming
  • Graphical Modellers
  • Flowchart story of operations
  • Allows for rapid sharing of models among users

15
ArcGISs ModelBuilder
16
IDRISIs Macro Modeller allows dynamic modelling
17
Developments 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.

18
Developments 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)
20
GIS 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.

21
Scale of Development
  • (Calculator expression)
  • Script or model
  • Custom GUI
  • Extension
  • Stand-alone application

Increasing complexity and investment
22
Getting Help
23
ArcGIS help function is very useful
24
ArcScripts is a useful online resource
25
Take a 10 minute breather
26
Programming Basics
27
Object-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

28
Principles 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

29
Principles 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.

30
Principles 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)

31
VB6 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

32
Variables start with a letter, can contain
numbers, letters, underscore characters
33
Public vegname as String Private area, perimeter
as Double
34
(No Transcript)
35
Subroutines
. . . Call DoSomething () . .
Public Sub DoSomething() . . . End Sub
36
Subroutines 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
37
If-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
38
Select 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
39
The 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
40
The Do Loop
Do While Until condition
statements Loop OR Do statements Loop
While Until condition
41
The 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
42
Getting 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.

43
Your 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

44
Your 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

45
Your 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.

46
Your GIS Solution
  • You will be assessed on
  • Clarity of objectives
  • Appropriateness of your approach to the GIS
    solution
  • Completeness
  • Initiative
  • Originality

47
Thats it for now!
  • Ill see you next week in the computer cluster.
Write a Comment
User Comments (0)
About PowerShow.com