Skip to Knowledge Center content

Problem guide

How to Build an Interactive Map From Geographic Data

Use a map when location is part of the answer, not just because the data has place names. Join on stable geographic IDs, pick a map type and projection that fit the question, keep zero separate from no data, and give people an easy way to search or select a place.

Written for: Public-sector analysts, journalists, researchers, and geographic data teams

Direct answer

Use a map when location is part of the answer, not just because the data has place names. Join on stable geographic IDs, pick a map type and projection that fit the question, keep zero separate from no data, and give people an easy way to search or select a place.

Decide whether geography is explanatory

A map is useful when location, proximity, boundary, or regional pattern is part of the question. It is not automatically the best display for any dataset containing state or country names. If the goal is simply ranking places, a sorted bar chart is usually easier to compare.

Use an interactive map when readers need to find a place, recognize a spatial cluster, compare neighboring areas, or explore local detail. State the geographic level and time period clearly. Boundaries change, and a county, district, postal area, or market region may refer to a specific vintage.

Before building, write the map’s purpose: “Readers should see where the rate is highest, locate their county, and compare its value with the statewide distribution.” That statement guides the projection, classification, controls, and companion views.

Join geography with stable IDs

A lot of broken maps are really broken joins. Place names vary in capitalization, punctuation, abbreviations, and language, so join on stable IDs whenever you can: FIPS or GEOID values, ISO codes, official district IDs, or another documented key.

Store identifiers as text so leading zeros survive. Keep separate fields for the ID, display name, parent geography, and boundary vintage. For example:

geoidcounty_namestateyearvalue
13089DeKalb CountyGA20240.614

Validate that every data row joins to at most one geometry and every expected geometry has a defined data state. Produce lists of unmatched IDs on both sides. Do not silently drop them.

Choose the right geographic representation

A choropleth fills areas according to a rate or normalized measure. It should rarely map raw counts because large-population areas will dominate. Use per-capita rates, percentages, densities, or another defensible denominator.

A proportional symbol map is often better for counts. A locator map emphasizes places or routes. A dot-density map can show distribution within areas, but the dots are usually representative rather than exact locations and must be explained. A cartogram intentionally distorts area to reflect another quantity.

For small geographies, a map may need a companion ranked chart because tiny areas are difficult to select. For Alaska, Hawaii, territories, or noncontiguous regions, use deliberate insets and disclose repositioning.

Choose a projection and only as much boundary detail as you need

Web maps often default to Web Mercator because it works well with tiled basemaps, but it distorts area—especially near the poles. If the size of places affects how people read the map, use an equal-area or region-specific projection instead.

Simplify geometry to the resolution the viewport needs. Sending full-resolution administrative boundaries can make the page slow without improving understanding. Preserve topology so shared borders remain aligned, and maintain a higher-resolution source for large-screen or zoomed views if necessary.

Test islands, multipart polygons, holes, and antimeridian crossings. Avoid simplifying so aggressively that small geographies disappear or boundaries self-intersect.

Classify values honestly

Color classes determine the story. Equal intervals are easy to explain but may waste colors when values are clustered. Quantiles place similar numbers of areas in each class but can exaggerate small differences. Natural breaks follow the observed distribution but may change across updates, making time comparisons difficult.

Use a continuous scale when readers need precise relative position and the distribution supports it. Use discrete classes when thresholds have real meaning or the legend needs a small set of categories. For recurring reports, consider fixed breaks so the same color means the same value over time.

Always separate “no data,” “not applicable,” “suppressed,” and true zero. A neutral no-data pattern or color should not look like the lowest measured class. Show the unit and classification method in the legend or methodology.

Build a legend that explains the encoding

A legend is part of the analytical argument. Include readable break labels, units, and any special categories. When the map is filtered, decide whether the scale remains fixed or recalculates. A changing scale can make every filtered view look equally varied even when absolute levels differ.

For a diverging measure, center the scale on a meaningful reference such as zero, a target, or the national average. Do not center it merely at the midpoint of the observed minimum and maximum.

Color should remain interpretable for color-blind readers and in print. Avoid red-green as the sole contrast. Provide direct values on selection and a table or ranked list for exact comparison.

Add search, selection, and linked views

Useful map interactions answer location-specific questions:

  • search by place name or ID;
  • click or keyboard-select an area;
  • show a persistent detail panel;
  • highlight neighbors or a comparison region;
  • switch metrics while retaining the selected place;
  • filter time with a clearly labeled control;
  • link the map selection to a ranked bar or trend.

A tooltip alone is insufficient on touch devices. Clicking should lock selection, and a visible reset should return to the national or regional overview. Keep zoom under control; accidental scroll zoom can make an article page difficult to navigate.

When a filter changes the metric or period, update the title, legend, source note, and detail panel together. A stale legend is a serious error.

Design for small screens and keyboard use

On a phone, prioritize finding and reading a place over seeing every polygon. Place search and metric controls above the map, make the selected-place panel easy to close, and consider a ranked list directly below. Keep tap targets large enough and do not require precise selection of tiny shapes.

Provide a logical tab order for controls and a nonpointer method to choose geographies, such as a searchable select. Announce the selected place and value in text. If the SVG contains thousands of focusable paths, do not put every one in the default tab sequence; provide a more manageable control.

Prepare and publish the map in Rhubarb

Start with the geographic question. In Rhubarb you can ask, “Where did this rate change the most?”, “Show me counties above the statewide average,” or “Map the result and let me click a county to compare its trend.” The assistant can help identify the needed fields, join them to geography, and build a first map rather than making you manually assemble each visual step.

For the final version, keep the geography and measure logic explicit: stable IDs, boundary vintage, denominator, period, classes, no-data rules, search, tooltip, and mobile behavior. Review the generated join and inspect known places. Exploration can be conversational; geographic correctness cannot be.

Connected data can refresh without rebuilding the map, but fixed classification breaks and stable IDs are essential for comparability. Version any methodology or boundary-vintage change separately from routine data updates.

Validate with geographic fixtures

Check a large area, a tiny area, an island or multipart geometry, a place with no data, a place with zero, a suppressed value, and at least three known source values. Count unmatched data rows and unmatched geometries. Test the widest and narrowest viewports.

Finally, compare the map with a sorted nonspatial view. If the map suggests a dramatic pattern that disappears in the ranked chart, investigate whether area size, classification, or projection is driving perception. A trustworthy map makes geography informative without allowing geography to substitute for analysis.

Frequently asked questions

Should raw counts be mapped with a choropleth?

Usually not. Choropleths should generally encode rates, percentages, density, or another normalized measure because area and population size otherwise dominate perception.

Why do geographic data joins fail?

Place names vary. Use stable IDs such as GEOID, FIPS, ISO, or official district codes stored as text, and inspect unmatched records on both sides.

Should a map scale change when filters change?

Only when local detail outweighs comparability. Fixed breaks are often better for recurring or cross-filter comparison; a changing scale must update the legend and be made clear.

Bring the data. Ask the question.

Get from a question to a useful visual answer without building every step by hand.

Ask what you want to know. Rhubarb can inspect the fields, write the query, try a useful visual form, and keep revising as you ask follow-up questions. If you want to see or change what it did, the SQL and visualization code are right there.

Start building in Rhubarb