• Stars
    star
    211
  • Rank 180,838 (Top 4 %)
  • Language
  • Created almost 8 years ago
  • Updated almost 6 years ago

Reviews

There are no reviews yet. Be the first to send feedback to the community and the maintainers!

Repository Details

working with spatial data - workshop materials

Working with spatial data for the web

Working with spatial data

Introduction

This workshop is designed to be very hands-on, with many examples that can be extended as exercises. It would be impossible to touch everything that we could find interesting in web mapping, so the hope is that after going through these three acts you will feel empowered to swap in your own data and leverage hundreds of examples in your own data visualization projects!

Tools

This workshop will cover a collection of Javascript mapping libraries. By the end, you will gain hands-on experience with each library. We will see first-hand which tool is best for the job in a variety of different situations.

Act I: fundamentals

I've got the whole world, in my hands

This first part of the workshop will focus on understanding the data and quickly getting something on the screen.

Data

First things first: we will play with basic GeoJSON on geojson.io to develop intuition for spatial data. We can look at this example to get a relative sense of the "size" of one degree of longitude or latitude.

We will use a collection of datasets curated to cover a variety of locations and scales (world-wide down to city-level) in the workshop. This way, you won't feel confined to one geographic area while practicing your new web-mapping skills. Each data folder contains a README that describes where the data comes from and how it was processed:

World data files
UK (London) data files
USA (SF) data files

We will explore the three basic GeoJSON data types with these files:

  • Polygons - Administrative boundaries like countries, states, and counties
  • Lines - Roads, Routes and Rivers
  • Points - Cities, Subway stations

You can find the commands used to process and convert the data in each folder. If you want to convert your own spatial data from one file type to another, you may want to start with Mapshaper before diving into the world of command line tools like ogr2ogr.

I recommend reading More than you ever wanted to know about GeoJSON before the workshop. It's a concise overview and a great reference.

Leaflet

1) Getting started with Leaflet

2) Basic styling & interaction

Mapbox-gl

3) Getting started with Mapbox-gl

4) Basic styling & interaction

Act II: d3.js

Data driven

This second part of the workshop will focus on understanding projections and using them with d3 to render custom data-driven maps.

Projections

Map projections are an important concept, and we need at least a basic grasp of how they work to make the kinds of custom maps we'd like to with d3.

One point we need to emphasize is that projections introduce distortion, to get a sense for how different projections distort the geometry of the earth play with this example:

A fun modification using images to show distortion:

And a gratuitous animation with a particularly interesting projection.

If you want to understand projections from a fundamental level, checkout this thorough presentation on where projections come from.

Rendering with d3.js

5) SVG Paths

6) Rendering a map with d3 projections

7) Mouse interactions with d3 + SVG

8) Data lookups

Advanced d3.js usage

9) Zooming with d3

10) Leaflet SVG Overlay

11) Mapbox-gl SVG Overlay

Act III: performance

Hella data

This part of the workshop will focus on how we can render our maps with better performance. We can utilize an extension of GeoJSON called TopoJSON as well as other rendering techniques like using the Canvas API.

TopoJSON

TopoJSON is an extension of GeoJSON that encodes topology. One of the biggest benefits of this is that file sizes can be significantly smaller.

A couple tools that can be used to orient yourself with TopoJSON files:
Inspect TopoJSON
Preview TopoJSON

12) Rendering a map with d3 + TopoJSON + SVG

Canvas

Canvas is an HTML5 API for drawing pixel based images in the browser with Javascript. It is possible to render lots of data quicker with canvas than SVG, but it is less convenient for interaction.

13) Rendering with d3 + Canvas

14) Zooming with Canvas

15) Mapbox-gl Canvas Overlay

turf.js

TurfJS is a Javascript library for geospatial calculations and analysis. It provides many features which can come in handy when dealing with spatial data.

16) Measuring areas and lengths

17) Buffering and contracting features

Encore: advanced techniques

We may not have time to explore these examples in depth, but they should provide inspiration and exercises for those who wish to venture deeper into the technical possibilities of the tools covered in this workshop.

It's a map, sort of
Using geospatial properties or locations to add context:
For example Circle counties, Try doing this with the world populations.
You can calculate the centroids of each country using d3 or turf.
Example answer

Advanced canvas interaction
Selecting countries on a canvas globe

Clipping
Clipping geometry data
Clipping raster tiles

Voronoi

More examples

Quadtrees
Features near mouse in canvas
Circular selection area:

Animated paths
Timer & Mapbox-gl
Transitions & Canvas
Point-along-path & SVG

More Repositories

1

algovis

collection of projects and links about algorithm visualization
1,593
star
2

tributary

rapid prototyping with d3.js
JavaScript
597
star
3

latent-scope

A scientific instrument for investigating latent spaces
JavaScript
350
star
4

blockbuilder

Create, fork and edit d3.js code snippets for use with bl.ocks.org right in the browser, no terminal required.
JavaScript
319
star
5

adventures_in_opencl

A tutorial series for learning OpenCL
C++
283
star
6

cmdrslog

chrome extension that takes automatic screenshots for a given url
JavaScript
110
star
7

bart

data pertaining to BART
JavaScript
79
star
8

Inlet

Bret Victor inspired slider & color picker plugin for CodeMirror
JavaScript
74
star
9

EnjaParticles

Particle System expirementation Sandbox: OpenCL/OpenGL on PC and Android OpenGL in C with JNI
C++
66
star
10

adventures_in_d3

tutorials and code samples for the d3.js library
JavaScript
55
star
11

intro-d3

workshop materials for introduction to d3.js
JavaScript
44
star
12

served

Create simple HTTP servers for any directory, no command line necessary
JavaScript
34
star
13

visxai-pattern-language

Towards a pattern language for visualizing AI
25
star
14

blockbuilder-search-index

download and process d3.js blocks for further indexing and visualization
CoffeeScript
24
star
15

blockbuilder-search

API endpoint and UI for blockbuilder search page
JavaScript
20
star
16

Bay-Area-d3

A collection of resources for learning d3.js
JavaScript
16
star
17

transit-datathon

notes and resources from the transit datathon 10/11+10/28 in SF
Python
11
star
18

d3mixtapes

collection of enjalot's d3 mixtape tutorials
9
star
19

dot-enter

d3.js mixtape of freestyle tributary performances
JavaScript
9
star
20

hwr

Handwriting recognition tools for CJK Languages
Python
9
star
21

BGERTPS

Blender modified to put the Real-Time Particle System library in the Game Engine
C
8
star
22

migrants

data from themigrantsfiles.com in a d3 friendly format
HTML
7
star
23

block-similarity

experimenting with searching blocks by similarity
CoffeeScript
7
star
24

pinyin

a visual explanation of the pinyin typing system
JavaScript
7
star
25

EnjaCL

C++ Wrappers for OpenCL with a focus on Particles
C++
7
star
26

dipsy

pure svg tooltips with d3.js
JavaScript
7
star
27

d34github

d3 talk @ github
6
star
28

tributary.io

real-time app powered by tributary and derby
CSS
6
star
29

d3.flow

making it easy to visualize velocity
JavaScript
5
star
30

enja.org

my personal website
JavaScript
5
star
31

tremor

data collection app for manuscripts
CoffeeScript
5
star
32

checkin

simple checkin app for meetup rsvps
JavaScript
5
star
33

dotfiles

bash, vim
Vim Script
4
star
34

clynect

PyOpenCL + libfreenect + PyOpenGL playground
Python
4
star
35

SlickTable

Tabletop + SlickGrid
JavaScript
4
star
36

purpleair-history

scripts for downloading and collating historical data from PurpleAir
JavaScript
4
star
37

earthquake

data for the swissnexSF earthquake resilience hackathon
4
star
38

pys3d

python stereo3d toolkit
Python
4
star
39

cypher

real-time code hip-hop
CoffeeScript
4
star
40

datacanvas

Data Canvas API explorer
JavaScript
4
star
41

homunculus

connect multiple Leap Motions with WebSockets
JavaScript
4
star
42

lildata

a browser based tool for exploring lil' data
3
star
43

awsapp

Amazon Web Services backend for Django
Python
3
star
44

sparcscraps

scraper for sparcsf.org menu
Python
3
star
45

latent-drafting

fetching reddit data and embedding it
Jupyter Notebook
3
star
46

enjalot.github.com

HTML
3
star
47

traffic

visualization exploring traffic on the Bay Bridge during July 2013 BART strike
JavaScript
2
star
48

blocksonblocks

an exploration of all d3.js blocks
HTML
2
star
49

mongo

An interactive explanation of the MongoDB Aggregation Pipeine
JavaScript
2
star
50

sparse-matrix-zoo

zoo of spare matrices
CoffeeScript
2
star
51

racer-animate

easily transition values that change in a Racer model
JavaScript
2
star
52

datainsightsf

JavaScript
2
star
53

police-departments

a machine-readable list of state and local police departments in the U.S.
2
star
54

derby-demo

simple demo app using derby
CoffeeScript
2
star
55

pyfers

python cyphers, i.e. examples of wrapping in python
Python
2
star
56

nodecsv

simple examples using node-csv
JavaScript
2
star
57

onair

tributary on air
JavaScript
2
star
58

tribulations

no pain no gain. removing the friction from prototyping
2
star
59

d3surveys

surveys about and for the d3.js community
CoffeeScript
2
star
60

enjapen

WiiMote python cocoa framework. Basic functionality
Python
2
star
61

derby-barchart

simple deom of using a d3 reusable chart with derby
JavaScript
1
star
62

taxitrips

playing around with taxi data
JavaScript
1
star
63

kijani

kijani backend
JavaScript
1
star
64

guttmacher-scrape

scraping tables from Guttmacher Institute
HTML
1
star
65

buzzdata_client

BuzzData Ruby Client Library
Ruby
1
star
66

d3-charts-book

Cookbook about building charts with D3.js using the reusable API
1
star
67

bitcatcher

node server + scripts for collecting and sharing bitcoin market data
1
star
68

playditt

Simple Blender based game based on reddit.com
1
star
69

masters-thesis

FSU DSC
Python
1
star
70

ofp

oakland food pantry registration app
JavaScript
1
star
71

gifclick

browser-based gif editing
JavaScript
1
star
72

talks

slides for talks
JavaScript
1
star
73

archon

interactive video tutorial system
JavaScript
1
star
74

react-hilbert-genome

A zoomable 2D map of the human genome
1
star