TIGER fixup/Overpass queries

From OpenStreetMap Wiki
Jump to navigation Jump to search

This page collects example Overpass API queries that are useful for TIGER fixup efforts. You can run each example in Overpass turbo to plot the resulting ways on an interactive map. Search for your area of interest before running the query.

Unreviewed ways

These queries return ways that have yet to be reviewed and edited. They serve as an alternative to the defunct TIGER Edited Map but are intended to be run within a limited area such as a county. You may need to increase the timeout for an urban county or a county where little TIGER fixup has taken place.

Unedited ways and nodes

This query returns all the ways last edited by known TIGER import bots during the time periods when they were actively importing TIGER data, as well as the ways first edited by a TIGER import bot, subsequently edited to expand abbreviations in the name, and not edited since. It excludes ways whose nodes have been modified since the import.

try it yourself in overpass-turbo
/*
This query returns ways that have not been manually edited in any way since they were imported from TIGER 2005.
*/
[out:json][timeout:25];

// Ways whose tags or member lists are untouched since the import or a subsequent automated cleanup
(
  // Initial TIGER 2005 import
  way(user:"DaveHansenTiger")({{bbox}})(if: timestamp() > "2007-08-03" && timestamp() < "2008-05-04");
  // Initial TIGER 2005 import in some Pennsylvania counties
  way(user:"Milenko")({{bbox}})(if: timestamp() > "2007-10-29" && timestamp() < "2007-12-12");
  // Abbreviation expansion and UUID removal
  way(user:"balrog-kun")({{bbox}})(if: timestamp() > "2010-03-21" && timestamp() < "2010-04-08" && version() < 3);
  // Abbreviation expansion
  way(user:"bot-mode")({{bbox}})(if: timestamp() > "2012-12-06" && timestamp() < "2013-04-25" && version() < 3);
)->.ways;

foreach .ways->.way {
  // Nodes modified since the import or a subsequent automated cleanup
  node(w.way)
    (if:
     // Initial TIGER 2005 import
     user() != "DaveHansenTiger" &&
     // Initial TIGER 2005 import in some Pennsylvania counties
     !(user() == "Milenko" && timestamp() > "2007-10-29" && timestamp() < "2007-12-12") &&
     // https://wiki.openstreetmap.org/wiki/TIGER_fixup/node_tags
     !(user() == "woodpeck_fixbot" && timestamp() > "2009-09-01" && timestamp() < "2010-01-31" && version() < 3));
  // Filter out ways with modified nodes
  if (count(nodes) == 0) {
    (
      .way;
      .result;
    )->.result;
  }
}

.result out geom;

Unedited ways (MapQuest)

This less thorough query matches the original MapQuest map [1]:

try it yourself in overpass-turbo
[out:json][timeout:25];
(
  way(user:"DaveHansenTiger")({{bbox}})(if: timestamp() > "2007-08-03" && timestamp() < "2008-05-04");
  way(user:"Milenko")({{bbox}})(if: timestamp() > "2007-10-29" && timestamp() < "2007-12-12");
  way(user:"balrog-kun")({{bbox}})(if: timestamp() > "2010-03-21" && timestamp() < "2010-04-08" && version() < 3); // maybe someone else edited between import and name expansion
);
// print results
out body;
>;
out skel qt;

Unedited ways (Potlatch 2)

Here is a simpler query that runs faster and matches Potlatch 2's "Highlight unedited TIGER (US roads)" option [2]:

try it yourself in overpass-turbo
/*
This has been generated by the overpass-turbo wizard.
The original search was:
“(user:DaveHansenTiger or user:Milenko or user:balrog-kun) and type:way”
*/
[out:json][timeout:25];
// gather results
(
  // query part for: “user:DaveHansenTiger”
  way(user:"DaveHansenTiger")({{bbox}});
  // query part for: “user:Milenko”
  way(user:"Milenko")({{bbox}});
  // query part for: “user:"balrog-kun"”
  way(user:"balrog-kun")({{bbox}});
);
// print results
out body;
>;
out skel qt;

tiger:reviewed=no

This query returns ways tagged tiger:reviewed=no. Please note this tag's caveats.

try it yourself in overpass-turbo
/*
This has been generated by the overpass-turbo wizard.
The original search was:
“tiger:reviewed=no and type:way”
*/
[out:json][timeout:25];
// gather results
(
  // query part for: “"tiger:reviewed"=no”
  way["tiger:reviewed"="no"]({{bbox}});
);
// print results
out body;
>;
out skel qt;