Refactored creation of multiple CartoDB layers.
Demonstrates loading a local data file (encoded in TopoJSON format) and symbolizes using Leaflet functionality. Also loads a data layer form CartoDB database. JQuery detects zoom level to remove or add the hexbin layer and toggle between the relevant legends/layer switcher.
This Python script utilizes the GeoPy geocoding library to batch geocode a number of addresses, using various services until a pair of latitude/longitude values are returned.
This example demonstrates the use of PostGIS to move and scale Alaska and Hawaii to fit SW off the continental US in a traditional map layout, client-side using CartoDB.js.
The continental US is first transformed out of Geo Web Mercator to an USA Contiguous Albers Equal Area Conic projection using the PostGIS function ST_Transform. Inspired by Free Your Maps From Web Mercator.
Alaska and Hawaii are then transformed using their respective projections, and then moved using St_Transform. Alaska's area is also reduced in size using the ST_Scale function.
This map demonstrates the technique of using a SVG icon to encode the relative magnitude of hydroelectric power generation plants in the US. Hello Kitty cares deeply about renewable energy.
WARNING: the use of this icon as a proportional symbol has not been scientifically tested.
Data source: Form EIA-860 http://www.eia.gov/electricity/data/eia860/index.html
This example shows a solution to achieve perceptual (or apparent) scaling of graduated symbols, using the Leaflet library. Data are raw totals of Kenyan girls enrolled in the 8th grade by county.
- see Krygier's Perceptual Scaling of Map Symbols for the full discussion
- equation drawn from ArcGIS Desktop Discussion Forums
Apparently we've never been calculating the area of our circles for graduated symbols?
This technique demonstrates calculating class ranges (i.e. breaks) for dynamically coloring a choropleth requested from data hosted on CartoDB.
The solution requires two requests:
- first for the raw data so the full range of the data can be classified (here using the ckmeans clustering method from Simple Statistics)
- then to request the tiles using the generated cartoCSS rules
Data are percentages of uninsured Americans in 2015. Darker blue indicates higher percentage.
Legend comes next.
Extends Dynamic Classification of CartoDB Choropleth Map to include a legend. Makes use of a custom legend example and the cdb.geo.ui.Legend.Custom()
method. Default CartoDB.css round bullets are overwritten to produce rectangles.
This example queries data from CARTO, uses the geolocation API to get the user's position, and finds the nearest three features.
Note: geolocation appears blocked within bl.ocks.org.