GIS for Web Developers: a 3-day class
Google Maps revolutionized web mapping. "Slippy maps" (Ajax-based web maps) are now commonplace. So what if you want to create a "Google Maps"-like website without using Google Maps, like TriMet did for the public transportation system in Portland, Oregon? (See http://maps.trimet.org.) What if you want to create a standards-based solution using only free data and an open source technology stack? This class -- based on the book of the same name -- walks you through the process step-by-step. Even if you've never created a map before in your life, you'll learn the buzzwords and explore ways to geographically-enable your own applications. You'll even learn what GIS stands for -- Geographic Information Systems, of course!
Objective
To build an Ajax "slippy map" using free data and a standards-based, open source technology stack. This is a hands-on, fast-paced, lab-intensive class where you'll learn the concepts behind GIS as well as the technology.
Goals
You will find free sources of GIS data on the web. You'll download desktop viewers and command-line tools. You'll learn how to reproject the data and store it in a spatially-enabled database. You'll publish and consume web services using the Open Geospatial Consortium (OGC) WMS and WFS interfaces. Finally, you'll create Ajax-based slippy maps in a web page.
Course Outline
Introduction
"Location is everywhere." That may sound funny, but the point is your data is chock full of location-based information that is dying to be mapped. You'll see many examples of things that you never thought were mappable. Along the way, we'll demystify geographic information systems (GIS) and teach you a bit of the lingo.
Vectors
This section offers you your first taste of assembling maps from the freely available geodata out there. Vector maps are line maps (as opposed to maps that use satellite or aerial imagery). You'll learn about vector primitives like points, lines, and polygons. You'll pull down free vector data from a variety of different sources on the web. You'll learn some basic file formats, including ESRI shapefiles and the XML dialect of Geography Markup Language (GML). And finally, you'll pull them all together in free viewers like QGIS and uDig.
Projections
Sometimes map data gathered from disparate sources just snaps together; other times it doesn't. The main culprit for "snap-together failure" is when the base layers are in different projections. This section explains what projections are, covers why data ends up in different projections in the first place, and shows you how to reproject your data layers to restore the "snap-together" magic that you were promised in the previous section. Command-line tools like GDAL and OGR make reprojecting your data a snap. Understanding the basics of spheroids, ellipsoids, datum, and EPSG codes gives you a fighting chance of reading those pesky projection files.
Geocoding
What do you do if your data doesn't already have the points, lines, or polygons needed to place it on a map? You geocode it, of course! Geocoding translates human-readable locations like street addresses, zip codes, and TCP/IP addresses into map-friendly latitude/longitude points. In this section, we explore several free geocoding web services.
Rasters
Once you get comfortable with vector data, you might be interested in adding some photographic data layers to your map as well. In this chapter, you see the ins and outs of dealing with raster (photographic) data, including where to find it, how to view it, and, most important, how to get at the hidden metadata that moves it from being simply pretty pixels to true geographic data.
We'll explore http://terraserver-usa.com and USGS DOQs. We'll discuss tessellation and use ImageMagick for command-line image manipulation. You'll understand the differences between panchromatic and multispectral rasters. You'll see how scale, resolution, and GSD all relate to each other. Orthographic rectification won't sound nearly as scary as it does now. And finally, creating GeoTIFFs and dealing with world files will become second nature to you.
Spatial Databases
You're probably going to want to store your geodata in a database for all of the same reasons you typically store your plain old nonmapping data in a database: speed, security, queries, and remote users. In some cases, your database supports geodata natively. Other times you have to spatially enable it. This chapter shows you how to take PostgreSQL -- a popular open source database -- and spatially enable it using PostGIS so that you can centralize the storage of all of your newfound vector data.
OGC Web Services
This section introduces two of the more popular standard interfaces provided by the Open Geospatial Consortium (OGC) -- Web Map Service (WMS) and Web Feature Service (WFS). WMS services allow you to create viewable maps suitable for a web browser from disparate sources across the Web. WFS services give you access to the raw data as Geographic Markup Language (GML).
You'll install and configure GeoServer, a Java servlet-based OGC server. GeoServer allows you to share your shapefiles and PostGIS data sets via the Web in a standardized way.
Slippy Maps
Now that GeoServer is fully installed and configured, you'll start reaping the benefits of your standards-based infrastructure. You'll combine data from your local GeoServer installation with remote OGC services from NASA and others. These remote services aren't running GeoServer, but you (and your users) won't be able to tell the difference.
You'll explore OpenLayers, a Javascript library that allows you to mix in OGC map layers with others. We'll contrast the speed of the Google Maps tessellated strategy with the flexibility of the OGC strategy, and talk about the role of a WMS-C caching service.