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

Cartography 101

Cartography 101

Sumin Byeon

March 21, 2013
Tweet

More Decks by Sumin Byeon

Other Decks in Science

Transcript

  1. 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?)
  2. 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
  3. 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
  4. Projections • Mercator projection • Normal Mercator • Transverse Mercator

    • Miller cylindrical projection • Mollweide projection • Robinson projection
  5. 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
  6. Data Source • OpenStreetMap • XML • Nodes, links, polygons

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

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

    for reliability, data integrity and correctness
  9. 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
  10. 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
  11. Mapnik • A toolkit for developing map applications • Provides

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

    maintainability • Implements cascading stylesheets for Mapnik
  13. Tile Generation • Export to an Mapnik XML • Feed

    this XML to a tile generation script • Run a post processing script • Transfer tiles to servers