Skip to content

Latest commit

 

History

History
63 lines (44 loc) · 2.72 KB

week10.md

File metadata and controls

63 lines (44 loc) · 2.72 KB

Week 10

Geospatial data-viz with OpenStreetMap

Project check in

  • Review project status with each group

In-class Exercise -- D3 + Leaflet + Tooltip

Review the solution in class...??? (It was an exercise, but we didn't finish)

Add a tooltip to D3 + Leaflet

In-class Exercise -- D3 + Leaflet + Legend

Raster tiles

Tile providers

  • Raster Tiles
    • Uses d3-tile
    • Includes a list of map tile providers
    • It's worth understanding how this works, because you can use it to modify the URLs for Leaflet
  • Stamen maps
    • Has example maps and instructions for using tile URLs, including attribution
    • Be careful about violating licenses and usage policies when using tile sources.
  • TileLayer reference docs -- leafletjs.com
    • It's worth looking at this documentation
    • Describes configurable parameters in the URL

In-class Exercise -- D3 + Leaflet + Stamen

Leaflet & OSM

  • OpenStreetMap export GUI
    • Introduction to OpenStreetMap
  • OSM Data Viz
    • This notebook performs several pre-packaged queries.
    • Queryies the Overpass API using a library that returns GeoJSON
    • If you return everything (i.e., if you don't filter your query), then make sure to use a very small domain
    • You can filter your query using the Overpass query language
    • Overpass API by example

In-class Exercise -- Investigate OSM data

  • Show (on the map) only those features that have a name (i.e., non-zero d.properties.tags.name)
    • To get this, you have to find the code that determines what is shown in the tooltip
    • It's the callback: onEachFeature -- see GeoJSON on Leaflet