1.3 Languages

advertisement
NR 621: Design of GIS
Systems
Jim Graham
Spring 2009
What is a GIS System?
• A combination of hardware and software
that allows the user to view, edit,
transform, analyze, collect, distribute,
and/or publish GIS data.
Definitions
• OpenSource: Libraries or applications that
are free and the source code can be
obtained and modified freely (no copyright
or patents).
– Quality and support are spotty.
• Commercial: Must pay in some form
(copyright is maintained and there may be
patents).
– Quality and support are spotty.
Types of Software
•
•
•
•
•
•
Utilities: DNR Garmin
Extensions: Hawth’s Tools
Visualization Applications: GoogleEarth
Full GIS Applications: ArcGIS
Web Sites: MapQuest
Databases: MS-Access
Examples: Applications
• Applications:
– AutoCAD/AutoDesk
– ArcGIS
– ArcExplorer Java Edition for Education
– MapInfo
– ENVI/IDL
– GRASS
– Quantum GIS (QGIS)
– DIVA GIS
Examples: Utilities
• DNR Garmin
• EasyGPS
• FWTools
http://www.maptools.org/
Examples: Extensions
•
•
•
•
•
•
•
Hawth’s tools
MrSID File Support (LizardTech)
ERMapper File Support
ET GeoWizards:
“Spatial Ecology”
V-LATE
XTools
http://www-sul.stanford.edu/depts/gis/tools.html
Examples: Visualization
• Web-Based:
– GoogleMaps
– MapQuest
– ArcIMS
• Internet-Based:
– NASA’s World-Wind
– MS-Virtual World
• Other:
– ArcScene
Web Sites
• MapQuest
• GoogleMaps
• USGS Seamless Server
Databases
• MySQL: Open Source
• PostgreSQL (post-gres) w/PostGIS:
OpenSource
• Microsoft SQL Server 2008: Expensive,
just added Spatial Support
• Oracle Spatial: Expensive, difficult to
support
• ArcSDE: ESRI’s spatial data engine for
Oracle, MS-Access, SQL Server, etc.
GIS Web Servers
• Map Server:
– Free
– Map files, PHP, PostgreSQL/PostGIS
• ArcIMS/ArcSDE
– Expensive
– Broad database support
• GODM
– Custom solution
– MS-SQL Server
GIS Application – Data Flow
Data
Extensions
Manager
Rendering
Data IO
- File
- Internet
- Database
Display
User Events
Mouse
Key Board
Event Driven
• Command Line:
– User types commands to make something
happen, waits for the program to ask for more
input
• Graphical User Interfaces (GUI):
– Program is always ready to respond to the
“events” entered by the user
– Includes: Progress, Cancel, Error messages
Components
• Hardware:
–
–
–
–
–
–
Workstations
Servers
Backup servers
The Internet
Displays
Printers
• Software:
–
–
–
–
–
–
–
–
Applications
Utilities
Databases
Web Servers
GIS Web Servers
Extensions
Drivers (old)
Libraries
Elements of Development
• Features: File formats, transforms,
viewing, editing, printing, etc.
• Schedule: People and time
• Resources: Hardware, software
• Quality: Number and severity of defects
• Performance: Where are the bottlenecks
• Compatibility: File formats, web services,
OGC, Commercial
Key Questions
• What are the features the user requires?
• What is there existing system?
• Do you need and can you extend an
existing GIS application?
• Are the libraries available for what you
need?
Key Decisions
•
•
•
•
•
Which platforms?
What type of software?
Extend existing or build your own?
Which language(s)?
Which libraries?
Developing GIS Systems
• Languages
• Development Environments
• !!!!!! Libraries !!!!!!
Compiled vs. Interpreted
• Compiled (C++, VB, Fortran):
– Slower to program
– Faster to execute
• Interpreted (VBA, VBScript, JavaScript):
– Faster to program
– Slower to execute
Languages
• Compiled:
– C/C++
– Fortran
– Visual Basic
– Java
– C#
Interpreted
•
•
•
•
•
•
•
•
Visual Basic for Applications
Visual Basic Script
Java Script
Python
Perl
PHP
Cold Fusion
“R”
Java
•
•
•
•
•
Partially compiled
Complied when first run on target machine
Original libraries are fast
Later libraries can be very slow (10x)
Best of both worlds or the worst?
Libraries
• Share compiled code across applications
• Component Object Model
– MS-Architecture (replaced by .NET)
– Supported by all MS languages
– Some support in PHP, Java
• Java Native Interface (JNI)
• PHP Libraries
C/C++ Libraries
• Rendering
– GA
• Projections
– Proj4
• Analysis
–?
• Charts
– Gigasoft
• File IO:
–
–
–
–
–
–
–
GDAL
OGR
ShapeLib
LibPNG
GeoTIFF
LibJPEG
AGRIDIO
Command-Line
•
•
•
•
•
•
GSLib? (Kriging)
R (inc. Kriging)
Proj4?
MaxEnt
GRASS?
Others?
Application Scripting
• Excel (all office apps)
– VBA: Easy, COM/NET supported
• ArcMap:
– VBA: Easy, full IDE, COM/NET
– Python: IDE missing, COM/NET
– VBScript: IDE missing, COM/NET
– JavaScript: IDE missing, COM/NET
Web Server Development
• ASP/VBScript: Related to VBA, Easy,
COM/NET supported
• PHP: Easy to program, easy to add C++
libraries
• JSP: Hard to program
Web Client Development
• HTML: Static content
• JavaScript: Error checking, dynamic
updates, dynamic content (maps), can’t
draw complex poly data
• Applets (Java):
• Flash
• Plug-ins (C++):
Client-Side Languages
HTML
JavaScript
Applets
(Java)
Flash
Plug-Ins
Difficulty
Easiest
Easy
(debugging
hard)
Medium
Medium
Hard
Portable
Yes
Yes
Yes
Yes
No
Limitations
Static
No complex
drawing,
transforms
Speed,
permission
to access
client
resources
Features
None
Used For
Static
Error
checking,
dynamic
forms,
maps
Spatial data
editing,
vector
drawing,
transforms
Animations,
tutorials
Never
Server-Side Languages
PHP
ASP/Jscript
ASP/VBScript
Java (JSP)
PERL
Difficulty
Easiest
Easy
Easy
Medium
(have to
recompile)
Hard to
learn
Limitations
Nice
connectio
n to C++
Can access
COM, NET
Can access
COM, NET
Open
Source
Yes
No
No
Great text
parsing, few
libraries
Yes
Yes
GIS Application Development
Java
VB
C++
C#
3d
World Wind
?
No Library
?
Portable
Yes
Windows
only
No
Windows only
GIS
Libraries
GeoTools
No
Yes
No
GUI
Easy
Easy
Hard
Easy
IDE
NetBeans
Yes
Yes
Yes
Speed
Some
problems
Fast
Fastest
Fast
VB-Based Development
Application
Excel
Web Server
VBA
VBScript
VB.NET
Command-Line
PHP, R, GSLIB, MaxEnt,
etc.
BlueSpray
(C++ DLL)
GIS Libraries
Database
PHP-Based Development
Applets
JavaScripts
Web Service
Browsers
Applications
Web Server
Command Line
PHP
Command-Line
R, GSLIB, MaxEnt, etc.
BlueSpray
(C++ DLL)
GIS Libraries
Database
Java-Based Development
Applets
Web Services
Application
PHP Script
Java Libraries
Command-Line
R, GSLIB, MaxEnt, etc.
BlueSpray?
(C++ DLL)
GIS Libraries
GeoTools?
Database
IBIS Projects
• Dynamic Web Site Projects:
– Global Organism Detection and Monitoring
– Math Science Program
– Global Invasive Species Information Network
• GIS Applications:
– BlueSpray
IBIS Programming Languages
•
•
•
•
•
•
•
•
SQL – Database Access
HTML – Web Pages
REST (XML) – Web Services
Java – Applets, application development
JavaScript – Client-Side Scripting
PHP – Server-Side Scripting
C/C++ - GIS Libraries, high-performance
VBA – Excel Programming
IBIS Components
• IIS – Web Serving
• SQL Server? PostGreSQL? MySQL?
• NetBeans – Development
– Java, C/C++, PHP
•
•
•
•
•
•
Dreamweaver – HTML development
R – Statistics
GigaSoft – Charts
Adobe Capture - Tutorials
GIS analysis?
GeoTools?
C/C++ Library
• APIs
– COM
– PHP?
– JNI?
• High-performance
– Rendering?
• GIS Library access
– Projection
• Proj4
– Analysis
• ?
• File IO:
–
–
–
–
–
–
–
GDAL
OGR
ShapeLib
LibPNG
GeoTIFF
LibJPEG
AGRIDIO
Operating System History
•
•
•
•
•
•
•
•
VAX (mini computer)
CPM
DOS
Xerox Star
Mac
Windows
UNIX
LINUX
Computer History
•
•
•
•
•
•
•
•
•
•
IMSIA? 8080
CBM
Atari
TI-99
Amiga
Comadore 64
Sinclair? $99.00
IBM-PC Compatible
Lisa
Mac
Computer Speed
RAM
Hard Disk Size
Internet
Predictions
•
•
•
•
Computer speeds have stablized
More processors (32?) will be added
RAM will increase (100s of Gigs?)
Flash RAM will increase (solid state
drives)
• Internet speed is stable
• GIS will come into it’s own!
File Formats
• Hierarchical, ASCII
– XML
– HTML
• Rasters
– GRID
– TIFF
• Vectors
– Shapefiles
– KML
Approach
• PHP is the focus
– Classes and scripts to access GRASS, R,
and BlueSpray
• Application: Java
– Uses PHP scripts for long processes
– BlueSprayDLL for speed
• Excel: VBA
•
•
•
•
•
•
•
•
•
•
•
•
•
•
•
•
•
•
•
•
•
•
Needs:
- Full feature IDE: source debugger, visual editor, GUI builder
- Extensible libraries (COM, .NET, Java?)
- Embedded Scripting
- Runs under web server
Wants:
- OpenSource
- High performance
- Cross-platform
- Optoins:
- PHP
- VSTA?
- Python
- Java
- VB and C# .NET
- VBScript?
- Jscript
Java
- 3d: Whirlwind
- Free IDE
- Hard to add C++: use message/properties interface
-
Download