[ Tributary.io ] 041e951ff1407ed667f7 by tonyfast
Adding a short index.html
file allows bl.ocks.org to present the visualization as a stand-alone webpage.
# Install fastparquet and pytables | |
# conda install pytables | |
# conda install -c conda-forge fastparquet | |
# conda install python-snappy | |
import pandas as pd | |
import fastparquet as fp | |
# Write file | |
df = pd.read_hdf(data_path, base) |
import json | |
from bokeh.io import output_file | |
from bokeh.plotting import figure, show | |
from bokeh.models import GeoJSONDataSource | |
from shapely import affinity | |
from shapely.geometry import mapping, shape | |
def get_geojson(): |
from __future__ import division | |
from functools import partial | |
import pyproj | |
from shapely.ops import transform | |
import numpy as np | |
from rasterio import features | |
from affine import Affine | |
import fiona |
from bokeh.plotting import figure, output_file, show | |
from bokeh.models.renderers import TileRenderer | |
from bokeh.tile_providers import STAMEN_TONER | |
from bokeh.models import Range1d | |
output_file('snap_tiles.html') | |
class SnappingTileRenderer(TileRenderer): | |
__implementation__ = """ | |
_ = require "underscore" |
from bokeh.models import Range1d | |
from bokeh.models import WMTSTileSource | |
from bokeh.models import ImageSource | |
from bokeh.plotting import figure | |
from bokeh.plotting import show | |
from bokeh.plotting import output_file | |
output_file('datashader_example.html') |
function initializeMap() { | |
var data, i, options, r, scatter, val, x, xaxis, y, yaxis; | |
r = new Bokeh.Random(123456789); | |
var esri_natgeo_map_service = 'http://server.arcgisonline.com/ArcGIS/rest/services/NatGeo_World_Map/MapServer/tile/{Z}/{Y}/{X}'; | |
var esri_imagery_label = 'http://server.arcgisonline.com/ArcGIS/rest/services/Reference/World_Boundaries_and_Places/MapServer/tile/{Z}/{Y}/{X}'; | |
var osm_service = 'http://c.tile.openstreetmap.org/{Z}/{X}/{Y}.png'; | |
var bing_service = 'http://t0.tiles.virtualearth.net/tiles/a{Q}.jpeg?g=854&mkt=en-US&token=Anz84uRE1RULeLwuJ0qKu5amcu5rugRXy1vKc27wUaKVyIv1SVZrUjqaOfXJJoI0' |
git clone [email protected]:bokeh/bokeh.git | |
cd bokeh | |
git fetch --all | |
git checkout feature/add-tiled-basemap-renderer | |
python setup.py develop | |
python bokeh_tile_layer_example.py |
from bokeh.plotting import figure, show, output_file | |
output_file("tile_layer_example.html", title="Tile Layer Example") | |
osm_service = 'http://c.tile.openstreetmap.org/{Z}/{X}/{Y}.png' | |
p = figure() | |
p.plot_width = 800 | |
p.plot_height = 800 | |
p.tile_layer(url=osm_service, tile_provider="WMTSTileProvider", tile_size=256) | |
show(p) |
[ Tributary.io ] 041e951ff1407ed667f7 by tonyfast
Adding a short index.html
file allows bl.ocks.org to present the visualization as a stand-alone webpage.
from __future__ import print_function | |
import os | |
import sys | |
import pandas | |
from pysal.weights.Distance import DistanceBand | |
import numpy | |
numpy.random.seed(10) |