Skip to content

Instantly share code, notes, and snippets.

View wrobstory's full-sized avatar

Rob Story wrobstory

View GitHub Profile
@wrobstory
wrobstory / README.md
Last active December 17, 2015 12:29
Folium Lat/Lng Popover

A Leaflet.js map created with Folium- click on the map to see Lat/Lng popovers. This map was generated with the following Python code:

map_3 = folium.Map(location=[46.1991, -122.1889], tiles='Stamen Terrain',
                   zoom_start=13)
map_3.lat_lng_popover()
map_3.create_map(path='sthelens.html')
@wrobstory
wrobstory / README.md
Last active December 23, 2017 10:41
Folium Circle Markers

A Leaflet.js map created with Folium- click on the marker to see the popup text. This map was generated with the following Python code:

map_2 = folium.Map(location=[45.5236, -122.6750], tiles='Stamen Toner',
                   zoom_start=13)
map_2.simple_marker(location=[45.5244, -122.6699], popup='The Waterfront')
map_2.circle_marker(location=[45.5215, -122.6261], radius=500,
                    popup='Laurelhurst Park', line_color='#3186cc',
                    fill_color='#3186cc')
map_2.create_map(path='portland.html')
@wrobstory
wrobstory / README.md
Last active February 10, 2020 00:57
Folium Simple Markers

A Leaflet.js map created with Folium. This map was generated with the following Python code:

import folium

map_1 = folium.Map(location=[45.372, -121.6972], zoom_start=12,
                   tiles='Stamen Terrain')
map_1.simple_marker([45.3288, -121.6625], popup='Mt. Hood Meadows')
map_1.simple_marker([45.3311, -121.7113], popup='Timberline Lodge')
map_1.create_map(path='mthood.html')
@wrobstory
wrobstory / README.md
Last active November 4, 2018 14:21
Folium Choropleth

A choropleth map created with Folium and Pandas. Pull data into a dataframe, bind to a feature of the GeoJSON, map it. Folium allows you to specify any of the color brewer sequential color groups, and also allows you to specify the d3 quantize scale range:

import folium
import json
import pandas as pd
import vincent

county_data = r'us_county_data.csv'
county_geo = r'us-counties.json'
@wrobstory
wrobstory / README.md
Last active December 17, 2015 05:49
Bearcart Complex Bars

Bearcart bar plot with large number of data columns.

@wrobstory
wrobstory / README.md
Last active December 17, 2015 05:49
Bearcart Negative Y-axis

Bearcart with negative data on the y-axis.

@wrobstory
wrobstory / README.md
Last active December 17, 2015 05:38
Folium Markers with Lat/Lng Popovers

A custom Mapbox map generated by Folium. One fixed marker, one fixed circle marker. Click on the map to place a new marker, click the marker to see Lat/Lng, double-click the marker to remove it. This map was generated with the following Python code:

import folium

#Custom Mapbox Tiles
tileset = r'http://a.tiles.mapbox.com/v3/[...]/{z}/{x}/{y}.png'
attribution = (r'Map data © <a href="http://openstreetmap.org">OpenStreetMap</a>'
                ' contributors, Imagery © <a href="http://mapbox.com">MapBox</a>')
#Create Map
mapbox = folium.Map(location=[45.5236, -122.6750], tiles=tileset, zoom_start=13,
@wrobstory
wrobstory / README.md
Last active December 17, 2015 04:39
Folium Simple Markers

A terrain map with two markers generated by Folium. Click on the markers for popover information. This map was generated with the following Python code:

#Mt Hood, with Mapbox custom tiles
tileset = r'http://a.tiles.mapbox.com/v3/wrobstory.map-ze418b98/{z}/{x}/{y}.png'
map = folium.Map(location=[45.372, -121.6972], zoom_start=12, 
                 tiles=tileset)
map.simple_marker([45.3288, -121.6625], popup_txt='Mt. Hood Meadows')
map.simple_marker([45.3311, -121.7113], popup_txt='Timberline Lodge')
map.create_map()
@wrobstory
wrobstory / folium_mapbox.py
Last active December 17, 2015 03:48
Folium MapBox Control Room Base
# -*- coding: utf-8 -*-
'''Test of Folium MapBox Control Room'''
import folium
#Standard MapBox Control Room (Dark)
map = folium.Map(location=[45.5236, -122.6750], tiles='MapBox Dark',
zoom_start=4, max_zoom=8)
map.create_map()
@wrobstory
wrobstory / folium_OSM.py
Last active December 17, 2015 03:48
Folium OpenStreetMap Base
# -*- coding: utf-8 -*-
'''Test of Folium basic OSM map'''
import folium
#Standard OSM
map = folium.Map(location=[45.5236, -122.6750])
map.create_map()