GEO 580 - Guest Lecture by Rory Plaire
Introduction
Rory Plaire is a Corvallis-based programmer/analyst who has been working
with GIS since he was hired with the City of Corvallis in 2000 and assisted
with GIS data movement into the permitting system. Later, he was hired as
the GIS Programmer/Analyst for Benton County, Oregon and helped to develop
GIS data publishing and integration mechanisms as well as install and
configure the BentonMaps website. This led him to remember his childhood
love of maps and dig into the actual mathematics, algorithms, data
structures and conventions used in GIS, cartography and geodesy. He took
over the SharpMap open source GIS project from its Netherlands-based founder
a few years ago, and continues to develop and market it.
Contact him at rplaire-at-peak.org or on Twitter.
SharpMap is used around the world to create mapping applications, simulations and analysis and
presentation tools. It was used by the OSU College of Engineering to
build Code3Sim, which is
a fire department tool to conduct simulations of emergencies. Code3Sim was
featured this year at the engineering fest.
Opening Example
Benton and Linn County online maps built with open source Minnesota Mapserver
- Benton County Assessor, includes Javascript too
- application is 6 years old now but still works well, allowing users to zoom, identify features, query
- computer scientiest like to pick apart things and see how they work
- enter SharpMap which is a great application for learning how a GIS works on the back end and trying to build your own customized applications
What can you do with SharpMap beyond just displaying maps?
- coordinate system transformations
- representation of features as objects with properties
- layer scientific models on top of maps to predict variables or make policy decision
In general, the open source world has a lot less available in terms of out-of-the-box GIS analysis functions. You need to build these in yourself.
Tour of SharpMap
- all code is there on site with a Wiki, discussion fora, etc.
- you can download the code and the library
- regarding libraries, 90% of the time an application may come with the tools that you need. If making improvements yourself, you'll need a library, which organizes computer code for you, giving you something that you can program yourself against via scripting or combining of scripts
- objects that implement functions to build a solution is key
- SharpMap contains upwards of 500,000 lines of code which would normally be worth $10,000,000 person hours, but it is available to you free
- another key is to be able to use an Integrated Development Environment (IDE) to build your own applications
Demo of a map browser that references SharpMap
- essentially they have built their own ArcCatalog application. They use SQLServer which now supports spatial data query and operations
- in the map application you can do a spatial search with an irregular shape, rather than just the standard "rubber band" to a square or rectangle
- you can bring in GIS data in many formats (shapefiles, dwg (drawing), PostGIS, DEM, Oracle database, etc.) into one geodatabase; not an ESRI geodatabase, but similar
- connection strings are also key, which allow you to connect to a database so that you can ask it for data. Databases are more complex than just simple files. You must specify an address, not unlike what you do with a web service
- Cost issue: ESRI ArcGIS server costs $50,000 and requires another $100,000/year in equivalent tech support; so for many local and state governments and agencis, it pays more in the long run to go the open source route
- Importance of MS Visual Studio an IDE, and you can get MS Visual Studio Express for free
- essentially about building code w/controls and connectors which wire you to SharpMap objects (not unlike building an analysis model in ArcGIS ModelBuilder which wires your data to GIS analysis functions)
Comments on student interning
- can be interesting to intern for a government agency as sometimes there are different things going on from department to department within the same agency.
Some departments function as their own consultancies and when they bump up against the limitations of a software tool they often try to figure things out for
themselves. This means that they must learn programming somewhat via the back door, without formal computer science training. Hence, tools such as SharpMap are valuable, and free too!
- again open source is weak on analysis functionality and they are working on this in SharpMap where you can indeed do simple analysis:
- find intersections
- buffer
- can't do inverse distance weighted interpolation but they are developing this for a client
Importance of Standards
OGC = Open Geospatial Consortium which develops internationally-recognized standards for geographic and and location-based services, including publicly available "interface" specifications
- interesting thing about OGC is that many companies are members (Microsoft,
Google, ESRI, etc.). These companies want to respond to their user base which
demands that these companies' data formats and functions work together with
other kinds of software. Standards and needed in order for this to be achieved.
Hence a company like ESRI, which produces proprietary soft
ware, does at least release specifications for their formats, such as the shapef
ile.
SharpMap upholds OGC standards
- e.g., a "feature" follows the OGC Simple Feature Specification (SFS)
- SFS can be shown in a UML-type diagram
- things are described in terms of their geometry
-- point --> point2D, point2DM, point3D
-- multipoint
-- curves
-- line string
-- linear right
-- poly
- Important to separate the interface from the implementation
Also important to understand the term "interface"
- here "interface" does not mean "graphical user interface"
- interface involves the boundaries, dimenstions, coordinates or spatial reference system of a feature. The interface involves the actions that can be done TO the feature (verbs) or the properties OF the feature (noun)
- for instance we can do certain things to a feature geometry such as normalize, clone, contains, covered by, overlap, etc.
Interesting that video gamers have driven advancements in the processing speed and visualization capabilities of computers, even in terms of geographic operations
"Cloud Computing" has come to the fore partly because of gaming - the ability for software code to be shppied all over the places; code is divvied up and
something sent to a big powerful server elsewhere instead of running locally
on a weaker server which actually return a result to the user much more quickly
(e.g., result in 20 seconds rather than 20 minutes). Google, Microsoft, Amazon, Oracle, etc. function by way of cloud computing
Discussion
Do most or all of SharpMap applications get deployed as web sites?
- good question because we still must be aware of the latency problem on the Internet. Capacity of the Internet is huge but some requests may still take some time (e.g., huge oil pipeline in Alaska but would still take time to pump oil long distances from Alaska to other parts of U.S.). So even with broadband, not all applications will run as quickly as one would like. Rory uses ASP.net
to build web apps, but could one could any number of other tools.
Use of open source vs. ESRI by some government agencies?
Dawn shares 3 related examples:
- from recent coastal atlas meeting that she attended in Seattle, Washington Department of Ecology, for the Washington Coastal Atlas, uses ESRI ArcGIS server and ESRI GIS portal toolkit for setting up a catalog services for the web or CSW (which by the way, is an OGC standard) so people can find their data more easily. Oregon Coastal Atlas is now all open source with Minnesota Mapserver as the map browser, a host of other open source tools for the back-end database, and open source GeoNetwork as its catalog service for the web. So it depends what the comfort level and goals of a particular agency are.
- We are somewhat spoiled on university campuses because so much software is free for us and we train our students in that software. For example, ESRI ArcGIS server at $50,000 is essentially FREE for OSU faculty, students, and staff because of our site license. And most of our course teach ESRI software. And yet, when a student graduates he or she may end up working for an agency or organization that cannot afford all the ESRI bells and whistles, and may even be going open source. This is why, again, we teach general theory so that a student will know the principles of GIS regardless of the software environment.
- Again, the analogy between SharpMap, where you can build an application, and ArcGIS ModelBuilder, where you can build a spatial analysis, is strong.
Standardization of algorithms? How do you know which ones to use?
- in open source world the best algorithms are chosen by consensus and publicized accordingly via discussion fora and listserves and conferences
- it actually works this way as well in the academic world, where consensus is built as to the rigor of an algorithm via the published literature, and people referencing an important study in their own work, and passing it on that way. Sometimes companies such as ESRI adopt an algorithm in this way, such as the location-allocation algorithm in ArcGIS that comes from the well-known academic research of Paul Densham.
Extras
OGC Standards: www.opengeospatial.org/standards
SharpMap and NTS implement a number of these (which appear to be the most popular in terms of other implementations like GeoTools): Simple Features, Coordinate Transformation, Filter Encoding, Symbology Encoding, Styled Layer Descriptor, Web Feature Service, Web Map Service. More are planned for the future so we can interoperate with many different GIS systems.
SharpMap: sharpmap.codeplex.com
NTS: code.google.com/p/nettopologysuite
JTS (what NTS derived from, but Java): www.vividsolutions.com/jts/jtshome.htm
Free Visual Studio: www.microsoft.com/express/download
- C# or VB for desktop apps, Web Developer for web apps. Mix and match any or all of these.
Free SQL Server 2008 Express (with spatial support): www.microsoft.com/express/sql/default.aspx
PostGIS (spatial enabled PostgreSQL database): postgis.refractions.net
- Unlike free SQL Server Express, which has a 4GB / DB limit, Postgres has no limits, yet is still free.
MapServer: en.wikipedia.org/wiki/MapServer
SAGA: www.saga-gis.org/en/
- Great open source software for modeling
A great regional mapping tool built on SharpMap: www.ultramap.cl
Last updated April 26, 2010
http://dusk.geo.orst.edu/buffgis/sharpmap.html
Return to GEO 580 Lectures