Docs › Examples › U.S. state map

U.S. state map

Difficulty: easy

U.S. States

Steps

  1. Load state/province polygons (source: Natural Earth)
  2. Keep only U.S. states
  3. Project to the "Albers USA" projection
  4. Assign random, non-adjacent colors
  5. Export as SVG

Code

mapshaper \
-i ne_50m_admin_1_states_provinces_lakes.geojson name=states \
-filter 'admin == "United States of America"' \
-proj albersusa \
-classify non-adjacent colors=Tableau10 \
-o us-states.svg height=400 width=600

Notes

  • To see the list of built-in color schemes to use with -classify, run mapshaper -colors. You can also use colors=random.
  • The Albers USA projection (-proj albersusa) is a custom projection used by The New York Times for U.S. maps.

Assets