GIS & Map Stack - Link review: take control of your maps

Beat's Notes link review

These are my personal notes on the dated but still relevant link:


The Map Stack: This is what its all about.

    • ... the layer in the stack where the Google Maps API sits.
    • OpenLayers is one example of a browser mapping UI library written in JavaScript, open source & under heavy development. OpenLayers is a mature library that supports multiple projections and map server backends, geospatial data format reading and writing, event handling, and vector drawing.
    • A tile cache is a server that sits between the browser and the map server.
    • If the map tile is not already generated, the tile cache gets it from the map server and saves it locally.
    • Instead of pointing the client to the map server, point it at the tile cache, and point the tile cache at the map server.
    • The aptly-named TileCache is an open source tile caching server that’s simple to set up. It can store tiles on local disks, in memcached, or on Amazon’s S3 storage service.
    • A map server takes geospatial data as input and renders graphical output. Specifically, it spits out a series of map tiles, uniformly sized graphic files (256×256 PNGs, for example) that are ultimately served to browser as the displayed map as a map via the browser UI.
    • servers are usually hidden from direct access by the tile cache layer in the stack.
    • Mapnik is an open source map server that renders beautifully and has a developer-friendly interface.
    • The databases that define the points, lines, and polygons that represent real-world places, roads, and areas. Geospatial data connects geometric shapes with a coordinate system (latitude and longitude, most commonly) and with attribute data such as school names, interstate designations, or congressional district numbers and representatives.
    • "The" geospatial data we are all most familiar w/ is a “streets” database.
    • Geospatial data is stored and transmitted in many formats. The Shapefile is the most important, and you’ll find many (GIS) organizations use this  format. Shapefiles are bundles of files: generally three of them, extensions: .shp, .shx, and .dbf.
    • An increasingly popular format is KML, which is an XML-based format first used in Google Earth. Google Earth and Maps can both produce and consume KML files. Since it’s XML-based it’s easy to open in a text editor.
    • If you use a relational database management system (RDBMS) in your application, you should consider using its built-in geometric data type. PostGIS is a library for PostgreSQL which provides a geometry type and functions to operate on it. You then add an additional columns to your tables and associate geospatial data with your existing rows. This gives you the ability to make SQL queries that include “spatial predicates.” Spatial predicates are statements like “within five miles of this latitude and longitude,” or “this line intersects with this line.”


Other notes:

  • A GIS desktop application is a great tool for getting a quick look at a new Shapefile. QGIS is a cross-platform, open source app. QGIS is the kind of application that web-based maps are emulating: click-and-drag and zoom, with layering. You can mock-up your custom map application and see how the various layers hang together. You can test labeling and color palettes, or even edit the underlying data.
  • Recommendation: add the OGR library to your toolbox. A Swiss Army knife for geospatial data; translate between formats, change projections, filter and combine datasets. OGR smooths out the differences between the various geospatial data serializations. You don’t have to care about what format, or in what projection, you’ve got your data layer—translate it into the format that makes sense for the rest of your application and move on. There’s a command-line utility, ogr2ogr, that provides this functionality, as well as OGR bindings for your favorite programming language.
  • An alternative to a commercial streets databases in the United States is the TIGER/Line dataset, produced by the U.S. Census Bureau. TIGER/Line is periodically updated and is free to download and use for your own applications.
  • Many municipalities have GIS departments that publish Shapefiles of their streets. 
  • Scale” is a key concept in maps: it’s the correspondence between a unit of measurement on the map and the thing being mapped. In the web map stack, it‘s helpful to determine the scales at which your maps will appear upfront. Because the browser UI, the map server, and the tile cache work together best when they work with the same set of scales. Layer data on tiles will be rendered differently at different scales.
  • Browser mapping UI libraries such as OpenLayers are ready to use out of the box: just link up the requisite resource in your site’s <head> and start coding. EX. w/in article.
  • Additional links: