Overpass Turbo Query

Posted by raphaelmirc on 3/27/2024

Overpass Turbo Query

10 examples of overpass queries to be used in Openstreetmap

Exemplos OVERPASS

• PTo query objects in another municipality, use this part of the query in red to change the name of the Municipality and state and you will have a search for objects in your location. • for a search by neighborhood, enter the name of the neighborhood and the city of the search

“Exemplo”

[out:json][timeout:25]; // fetch area “Terceira” to search in {{geocodeArea:campos dos goytacazes,rj}}->.searchArea; // gather results


Consulta de Ilha

[out:json][timeout:180]; area [‘ISO3166-2’ = ‘BR-PA’][admin_level=4] (area.a) -> .uf; nwr [place~”islet|island|archipelago”][name] (area.uf); out geom;


Consulta de Escolas em Município

[out:json][timeout:25]; // fetch area “Terceira” to search in {{geocodeArea:campos dos goytacazes,rj}}->.searchArea; // gather results ( // query part for: “amenity=school” node“amenity”=”school”; way“amenity”=”school”; relation“amenity”=”school”; ); // print results out body; >; out skel qt;

https://overpass-turbo.eu/s/1J8l


Consulta de Posto de Saúde em Município;

[out:json][timeout:25]; // fetch area “Terceira” to search in {{geocodeArea:campos dos goytacazes,rj}}->.searchArea; // gather results ( // query part for: “amenity=clinic” node“amenity”=”clinic”; way“amenity”=”clinic”; relation“amenity”=”clinic”; ); // print results out body; >; out skel qt;

https://overpass-turbo.eu/s/1J8L


Consulta de Nomes de Rua Residencial sem nome por Bairro;

[out:xml][timeout:25];
{{geocodeArea:Parque Doutor Beda,Campos dos Goytacazes}}->.searchArea; ( way[“highway”=”residential”]“name”!~”.*”; ); out meta; >; out meta qt;

https://overpass-turbo.eu/s/1J8n


Consulta de Rua sem nome em toda a cidade – “Essa pesquisa consulta todos os tipos de de Estradas” “Rua, Avenida Primaria, secundaria e terciaria”

[out:xml][timeout:25]; {{geocodeArea:Campos dos Goytacazes,RJ}}->.searchArea; ( way[“highway”~”unclassified|residential|tertiary|secondary|primary”]“name”!~”.*”; ); out meta; >; out meta qt;

https://overpass-turbo.eu/s/1J8v


Consulta de Igreja

[out:json][timeout:25]; // fetch area “Terceira” to search in {{geocodeArea:campos dos goytacazes,rj}}->.searchArea; // gather results ( // query part for: “amenity=clinic” node“building”=”church”; way“building”=”church”; relation“building”=”church”; ); // print results out body; >; out skel qt;

https://overpass-turbo.eu/s/1J8O


Consulta de CEP em Ruas de um Bairro

[out:xml]/fixed by auto repair/[timeout:50]; {{geocodeArea:Cohab,Recife}}->.searchArea; ( way“postal_code”; ); out meta; >; out meta qt;

https://overpass-turbo.eu/s/1J8R


Consulta de Ruas sem CEP em Cidade

[out:xml][timeout:25]; {{geocodeArea:cavaleiro,jaboatão}}->.searchArea; ( way[“highway”=”residential”]“postal_code”!~”.*”; ); out meta; >; out meta qt;

https://overpass-turbo.eu/s/1J8S


Consulta de CEP fora do Padrão Brasileiro “XXXX-XXX” para Correção

[out:xml][timeout:900]; {{geocodeArea:Jaboatão}}->.searchArea; ( nwr [“addr:postcode”!~”^[0-9]{5}-[0-9]{3}$”] “addr:postcode”!; nwr [“postal_code”!~”^[0-9]{5}-[0-9]{3}$”] “postal_code”!; nwr [“postal_code:side:even”!~”^[0-9]{5}-[0-9]{3}$”] “postal_code:side:even”!; nwr [“postal_code:side:odd”!~”^[0-9]{5}-[0-9]{3}$”] “postal_code:side:odd”!; ); out meta; >; out meta qt;

https://overpass-turbo.eu/s/1J8T


Consulta de Delegacias em uma área do mapa overpass “ consulta pesquisa qualquer área do mapa”

[out:xml]/fixed by auto repair/[bbox:{{bbox}}][timeout:800];
// determine set of police stations ( node[amenity=police]; way[amenity=police]; rel[amenity=police]; )->.polices; // put them into the set “polices” (._;>;); out meta;/fixed by auto repair/

https://overpass-turbo.eu/s/1J8U


Consulta em formato csv para Rua sem nome por Área.

[out:csv(::type,::id,name,::count)]; ( way[“highway”=”residential”]“name”!~”.”; ); out meta;/fixed by auto repair/ >; out meta qt;/fixed by auto repair/

https://overpass-turbo.eu/s/1J8j


some examples of overpass query https://overpass-turbo.eu/