Forgive me if this question was already asked - I can’t seem to find it via search.
I am trying to find all ways in a certain administrative unit, e.g., U.S. state, Canadian province, etc. It’s not clear to me how to do this with planet_osm_line or planet_osm_roads tables. Any help on how to set up this query would be most appreciated
You can do this with the area query feature in Overpass & Overpass turbo: although entire states or provinces may be a push in terms of both server time & volume of data. Here’s a sample of a query which I use in Overpass-turbo to look for highway=residential which may need changing to unclassified:
/*
This has been generated by the overpass-turbo wizard.
The original search was:
“place=* and population~=“[0-9]{7,}” in “United States of America”” /
[out:json][timeout:2500];
// fetch area “United States of America” to search in
{{geocodeArea:Butler County PA}}->.searchArea;
// gather results
(
// query part for: “place= and population~/[0-9]{7,}/”
way"highway"=“residential”;
);
// print results
out body;
I have my own postgres DB with OSM data from North America, so I’d like to run the query against that…
Will look at running the overpass server locally, but wondering if there is a lighter-weight method to run these queries locally?