r _ map - dwisianto/dwisianto GitHub Wiki
Plotly
- https://plotly.com/python
- https://plotly.com/python/maps/
- https://plotly.com/python/choropleth-maps/
- https://plotly.com/python/county-choropleth/
Zip Code to State
PUMAs
ZCTA
- zip-code tabulated area
- https://www.census.gov/programs-surveys/geography/guidance/geo-areas/zctas.html
- https://catalog.data.gov/dataset/zip-code-tabulation-areas-census-2000
Zip-Code County
-
https://opendata.stackexchange.com/questions/4335/mapping-counties-to-zip-codes
-
Summary: The Geospatial Data Abstraction Library (GDAL)
-
https://opensourceoptions.com/blog/how-to-install-gdal-with-anaconda/
import json
from urllib.request import urlopen
geojson_counties_fips='https://raw.githubusercontent.com/plotly/datasets/master/geojson-counties-fips.json'
with urlopen(geojson_counties_fips) as response:
counties = json.load(response)
import pandas as pd
df = pd.read_csv("https://raw.githubusercontent.com/plotly/datasets/master/fips-unemp-16.csv",
dtype={"fips": str})
import plotly.express as px
fig = px.choropleth_mapbox(df,
geojson=counties,
locations='fips',
color='unemp',
color_continuous_scale="Viridis",
range_color=(0, 12),
mapbox_style="carto-positron",
zoom=3,
center = {"lat": 37.0902, "lon": -95.7129},
opacity=0.5,
labels={'unemp':'unemployment rate'}
)
fig.update_layout(margin={"r":0,"t":0,"l":0,"b":0})
fig.show()