Book review of GIS for Web Developers Adding Where to Your Web Applications by Scott Davis published by The Pragmatic Bookshelf, c. 2007, price $34.95.
Review by Lee
McKusick
GIS for Web Developers is a guide to adding geographic information system data like maps and geographic data to a web site using mainly open source tools and maps available over the internet.
“GIS” means “geographic information systems”. The reason for this book is most of the important kinds of geographic information files do not display in a web browser. At best, a web page presents an image that is the rendered result of a GIS system.
This book is primarily for a web site developer. The book is also quite useful for for any Linux user who wants to work with maps and geographic information system data.
The author, Scott Davis is a website developer and seminar leader who does GIS tutorial classes. The publisher, Pragmatic Bookshelf, was founded by software developers. The strength of this book is if you are a developer or you aspire to be a web site developer, you will have a grasp of GIS and the presentation software you need.
In line with the subtitle “for web developers”, the book culminates with a demo of creating a web map. The demo shows the process of geocoding several hundred text format addresses, storing this local data in a PostGIS database, fetching base maps as needed from a mapserver on the Internet and displaying the local data correctly aligned over the base maps.
Here are the four big “gotcha” problems in using open source software to build a GIS enabled web display :
- 1.How do you make all your layers of GIS data line up properly?
Nearly 1/3 of the book addresses this problem. GIS data either comes with a “projection” or a projection is assumed. This book explains data projection with explanatory text mixed with try this on your computer demonstrations.
- 2.How do you put the blizzard of individual GIS data points into a database?
The open source community has an extension of the Postgresql database called PostGIS. Essentially, the long stringy GIS data structures called shapefiles are good for downloading but too long for rapid sequential access. This book has a walkthrough introduction to using PostGIS.
- 3.How do you access raw GIS data over the internet? How do you make your application fetch it's own basemaps? How do you publish your GIS data as a service?
Typically a web site will combine your local data with a basemap copied from the internet. Your application can run a client process and copy basemap files over the internet only as needed. Reciprocally, you can run a server and publish your GIS data. This is done using a Java based application GeoServer.
- 4.How do you create a slippy map web application?
This is where your application uses published packages of Ajax scripts ( Mapbuilder and OpenLayers) to generate displays using map data fetched with GeoServer and additional data stored on a local PostGIS database.
GIS for Web Developers devotes 4 chapters to explaining map data projection. This is the part of the book that will be useful to any open source software user who seeks to work with GIS data on your own computer.
A very brief summary of the mysteries of “projection” with GIS files
- Some GIS data comes in the very simple WGS84 projection
First, some important public domain GIS data is older than the internet. It's projection is assumed and the data comes in three separate files. This is the crusty but important US Census Bureau TIGER dataset. See:
www.census.gov/geo/www/cob/index.html
A kind of answer about the Census data is the projection is “WGS 84” . In a WGS 84 projection, the location data is given as numeric longitude and latitude. Most GPS data files are also in this “projection” because it is very simple. The mystery happens when you try to display these two kinds of data along with a typical Geotiff map. Most maps are in a different Projection.
- Lots of maps and imagery comes in a different projection. You must reproject some data to make the layers align.
Second, some GIS data files are scanned raster images of paper maps or raster representations of photos or wind speed or wave height or cloud cover. These appear as geotiff files. A geotiff file is an image preceded by a header that describes the geographic location, projection and pixel size of the following tiff image.
Here is an example raster image geotiff. This file is an aerial photograph digitally massaged to line up with a paper topographic map. The file has a projection called Universal Transverse Mercator Zone 10N. The projection is abbreviated as UTM 10 N.
http://archive.casil.ucdavis.edu/casil/remote_sensing/doq/doqq/37122/o37122e4se.tif
You can read the header and see the projection with the gdal utility programs available for linux: gdalinfo o37122e4se.tif
The command line tools are called gdal, as an abbreviation for Geospatial Data Abstraction Library.
UTM means “Universal Transverse Mercator” projection. A paper map or a military map would probably be in this projection. Unfortunately, a UTM map does projection tricks with the location of objects. Instead of using longitude and latitude for locations, UTM maps are dimensioned in meters from an artificial origin to the south and east of the cursor.
When a UTM map is loaded into the open source Qgis browser, all the points on the map are a number between 0 and 500,000. If you load in some GPS data having longitude and latitude numbers like -133, 35 (that is somewhere near where I live) the GPS points show up as little dots several hundred thousand meters out of place.
So the resolution to this problem is you “reproject” one of these maps to the other coordinate system. It turns out there is a table of data originally authored by the European Petroleum Study Group that summarizes many of the coordinate system transformations. To force the most any raster data GeoTiff map into the bare and simple format of latitude and longitude (without any offsets) you use the following incantation:
gdalwarp -t_srs EPSG:4326 o37122e4se.tif output.tif
- Typical mapquest and mapserver-usa.com maps are jpeg images. You trick them to align with other GIS data with a world file
One kind of alignment solution for map images that are received as a jpeg file is to force the jpeg file into alignment by use of a 6 line “world file”.
A source of US map data as jpg files is:
http://terraserver-usa.com/default.aspx
For a description of world file see:
http://en.wikipedia.org/wiki/World_file
Last year I tried to develop a website for mapping the invasive plant Pampas Grass that is a rapidly spreading weed in northern California.
GIS for Web Developers is the book I wish I'd had at the time of that project.
--
LeeMcKusick - 28 Dec 2007
to top