Filtering & Sorting Maps

Alec Ramsay
Dave’s Redistricting
5 min readSep 20, 2020

With thousands and thousands of published maps, how do you find just the ones that you’re interested in? You filter & sort them.

Published maps for North Carolina sorted in descending order of Proportionality rating

Note: There are some new properties for 2020 maps.

Filtering Maps

The search box above the list of maps lets you filter the maps that you see.

Command-f (on Mac) or Control-F (on Windows) will place the focus in the search box.

General Searches

The simplest filter is just a string of text. If any field for a map contains that string, the map matches and is listed.

All comparisons are case-insensitive. Quoted strings can be used to hide special characters. You can also use quotes around a string to prevent parsing as an expression. Both single or double quotes are allowed.

Filtering on a Specific Field

You can filter on specific fields by specifying the name of the field followed by a colon followed by a value. As with strings above, field names are also case-insensitive.

Fields fall into three categories: general, requirements, and ratings. There are also a few new ones with the 2020 shapes.

General

There are several properties with string values:

  • name — for example ‘name: virginia’ (no quotes) selects maps with “virginia” somewhere in the name (meaning you’ll get maps with both Virginia and West Virginia in the name)
  • state — ‘state: va’ selects maps for Virginia, i.e., this field matches two-character state codes
  • owner — ‘owner: fred’ selects maps where the owner contains ‘fred’
  • labels — ‘labels: fair’ selects maps that have a label that contains ‘fair’
  • modified — contains the full last modified time for the map, in three letter month with explicit day, year, and time format, so ‘modified: 2020’ selects maps modified in 2020 and ‘modified: (aug and 2020)’ selects maps modified in August 2020

This is one integer numeric property:

  • districts — the number of districts in the map, which you use to distinguish the congressional maps for a state from the state legislative maps the same way you filter on the numeric Ratings properties below

These are two true/false boolean properties:

  • official — ‘official: false’ excludes the maps in the Official Maps collection; when in the Published Maps collection, this lets you ignore the official maps
  • published — in your My Maps or Shared With Me collection, ‘published: true’ selects the maps that you have published

Requirements

There are four true/false boolean properties:

  • complete — ‘complete: true’ selects complete maps
  • contiguous — ‘contiguous: false’ selects maps that aren’t contiguous
  • freeofholes — ‘freeofholes: false’ selects maps that have one or more embedded ‘donut hole’ districts
  • equalpopulation —‘equalpopulation: true’ selects maps that have ‘roughly equal’ population

Ratings

There are five [0–100] numeric properties that you filter on using expressions with the >, > =, <, <=, ==, or != operators:

  • proportionality — ‘proportionality: > 75’ selects maps where the Proportionality rating is bigger than 75
  • competitiveness — ‘competitiveness: < 25’ selects maps where the Competitiveness rating is less than 25
  • minorityrights — ‘minorityrights: == 100’ selects maps where the Minority Representation rating is 100
  • compactness — ‘compactness: >= 80’ selects maps where the Compactness rating is 80 or more
  • splitting — ‘splitting: >= 80’ selects maps where the Splitting rating is 80 or more (remember, this has been normalized so bigger is better)

We expose two additional ratings-related numeric properties:

  • disproportionality — this is the raw disproportionality metric represented as a positive or negative [0–1] fraction, e.g., 0.1899, as opposed to the percentages that we report in the Proportionality section, e.g., 18.99% , where, by convention, positive values favor Republicans while negative values favor Democrats
  • populationdeviation — this is the raw population deviation represented as a positive [0–1] fraction, e.g., 0.070, as opposed to the percentages that we report in the Requirements section, e.g., 0.70%

Note: We added population deviation on 9/29/23.

This allows you to find the maps that are the most gerrymandered in favor of one party or the other. For example:

  • ‘(disproportionality: > 0.20)’ selects maps with more than a 20% deviation from proportional in favor of Republicans, and
  • ‘(disproportionality: < -0.20)’ selects maps with more than a 20% deviation from proportional in favor of Democrats

You can filter on population deviation analogously.

Filtering on Multiple Fields

You can filter on more than one field at a time, by combining multiple expressions with and, or and not:

  • For example, ‘name: lower and state: tx’ selects maps for Texas that also have the word ‘lower’ in the name
  • Field names have the highest precedence, so use parentheses to test multiple values for a property. So ‘state: (ma or tx)’ selects maps for Massachusetts and Texas.
  • As with the above example, you can use parentheses to force precedence when specifying expressions with multiple clauses. When in doubt, use parentheses to make your intent clear!

This expression selects all maps that meet the four general requirements for valid maps: ‘complete: true and contiguous: true and freeofholes: true and equalpopulation: true’.

New Properties

So you search for maps that use the new 2020 shapes (or the old 2010 shapes),

  • cycle — ‘cycle: 2020’ selects maps using the 2020 shapes; 2010 selects maps using the 2010 shapes

Maps using the 2020 shapes also have a property that describes what type of map they are:

  • planType — ‘planType: congress’ selects congressional maps; the other possibilities are { upper | lower | other }, which correspond to the upper state house, the lower state house, and some other unspecified type of map (e.g., local).

See “Notable 2020 Maps” below for how you can use these properties to find notable 2020 maps.

Sorting Maps

You can also sort maps, by clicking on the column header:

  • Name — sorts maps in alphanumeric order, using the map names
  • Labels — sorts maps in alphanumeric order, using the labels associated with maps
  • Modified — sorts maps in chronological order, using the date & time that maps was most recently modified
  • Rating or Metric— sorts the maps in numeric order, using the one of the five [0–100] bigger-is-better ratings — Proportionality, Competitiveness, Minority Representation, Competitiveness, and Splitting — or (as of 9/29/23) either the disproportionality or population deviation metrics
  • State — sorts the maps in alphabetical order, using two-character state codes, e.g., ‘NC’ for North Carolina

By default, maps are shown in most recently modified order.

Notable 2020 Maps

On each state page you will find a set of Notable Maps, that help you understand the tradeoffs inherent in a state’s political geography. Right now, the pages show the notable 2010 maps. When a critical mass of 2020 maps have been drawn, we’ll switch over and show the corresponding notable 2020 maps.

In the meantime, you can find the likely candidates by first filtering on the properties to match the Notable Maps logic. For example, this is how you’d find the Notable Map candidates for AZ congressional districts using 2020 shapes:

cycle:2020
and state:az
and planType:congress
and districts:10
and (complete: true and contiguous: true and freeofholes: true and equalpopulation: true)
and (proportionality: >= 20 and competitiveness: >= 10 and compactness: >= 20 and splitting: >= 20)

Then choose a Rating — e.g., Rating - Proportionality — and sort the column in descending order. The highest rated map on that dimension will be at the top.

--

--

Alec Ramsay
Dave’s Redistricting

I synthesize large complex domains into easy-to-understand conceptual frameworks: I create simple maps of complex territories.