Upgrade to Pro — share decks privately, control downloads, hide ads and more …

Cartography 101

Cartography 101


Sumin Byeon

March 21, 2013

More Decks by Sumin Byeon

Other Decks in Science


  1. Cartography 101 Sumin Byeon University of Arizona

  2. The Ultimate Plan • Fully customizable map tiles • Serve

    these map tiles on our own servers
  3. Rationale • Google does not allow their map to be

    used in any navigation software • OSM does not allow anyone to use their map servers for production purposes • CloudMade map servers are slow (perhaps it’s because we don’t pay?)
  4. Cartography • Study and practice of making maps[1] • Projection

    of a 3D world onto a 2D plane • Simplified view of the real world, selectively displaying different features depending on the purpose of the map
  5. Slippy Maps • Interactive maps that can be zoomed and

    panned around • Consists of tiles - generally 256x256 pixels • Dynamic loading • e.g., Google Maps, Bing Maps, Mapquest
  6. Projections • Mercator projection • Normal Mercator • Transverse Mercator

    • Miller cylindrical projection • Mollweide projection • Robinson projection
  7. Mercator Projection

  8. Prerequisites • Geospatial data • Software to process the data

    • Map style definition • Tile generator • Storage (i.e., a database and a file system) • Servers to host tiles
  9. Data Source • OpenStreetMap • XML • Nodes, links, polygons

    • PBF • Binary format • ~30% smaller than compressed XML • Significantly faster to process
  10. PostGIS • A spatial database extender for PostgreSQL • Enables

    geospatial queries to be run in SQL • Supports for various features for manipulating geospatial objects
  11. PostgreSQL • A very powerful relational database system • Known

    for reliability, data integrity and correctness
  12. Layer • Generally, a map is consist of multiple layers

    • A layer is a subset of geospatial data that can be fetched by a single query
  13. Layer SELECT  name,  place,  population,  way FROM  planet_osm_point WHERE  place='city'

      ANDCAST(REPLACE(population,  ',',  '')  AS   INT)  >=  25000 AND  CAST(REPLACE(population,  ',',  '')  AS   INT)  <  500000
  14. Mapnik • A toolkit for developing map applications • Provides

    sub-pixel accuracy (by using highly sophisticated anti-aliasing techniques) • https://github.com/mapnik/mapnik
  15. Cascadenik • Mapnik style definitions in XML - low readability,

    maintainability • Implements cascading stylesheets for Mapnik
  16. Cascadenik • (Demo)

  17. TileMill

  18. Tile Generation • Export to an Mapnik XML • Feed

    this XML to a tile generation script • Run a post processing script • Transfer tiles to servers
  19. Questions?