OVERPASS QUERY EXAMPLE / EXEMPLO DE CONSULTA OVERPASS
Posted by raphaelmirc on 30 January 2022 in Brazilian Portuguese (Português do Brasil).EXEMPLO DE CONSULTA OVERPASS / EXEMPLO DE CONSULTA OVERPASS
Consulta de VILAS
[out:json][timeout:25]; // fetch area “Recife” to search in {{geocodeArea:Pernambuco}}->.searchArea; // gather results ( // query part for: “amenity=place_of_worship” node“place”=”village”; way“placeplace”=”village”; relation“place”=”village”; ); // print results out body; >; out skel qt;
Consulta de Abreviação de Nomes de Ruas.
/*
Pesquisa de abreviacoes no OSM. Gera pontos geograficos no mapa.
*/
[out:json][timeout:900];
{{geocodeArea:Pernambuco}}->.searchArea;
(
// Enderecos
way[highway]“name”~”^Av\.”,i;
way[highway]“name”~”^Al\.”,i;
way[highway]“name”~”^R\.”,i;
way[highway]“name”~”Tr\.”,i;
way[highway]“name”~”Tv\.”,i;
way[highway]“name”~”Tra\.”,i;
way[highway]“name”~”Trav\.”,i;
way[highway]“name”~”Pç\.”,i;
way[highway]“name”~”Pça\.”,i;
way[highway]“name”~”Estr\.”,i;
way[highway]“name”~”Serv\.”,i;
way[highway]“name”~”Jd\.”,i;
way[highway]“name”~”Lot\.”,i;
way[highway]“name”~”Bal\.”,i;
way[highway]“name”~”Mun\.”,i;
way[highway]“name”~”Pte\.”,i;
way[highway]“name”~”Rod\.”,i;
// Profissoes
way[highway]“name”~”Dr\.”,i;
way[highway]“name”~”Dra\.”,i;
way[highway]“name”~”Prof\.”,i;
way[highway]“name”~”Profa\.”,i;
way[highway]“name”~”Eng.\.”,i;
way[highway]“name”~”Arq.\.”,i;
way[highway]“name”~”Jorn.\.”,i;
way[highway]“name”~”Med.\.”,i;
// Religiosos
way[highway]“name”~”Pe\.”,i;
way[highway]“name”~”Con\.”,i;
way[highway]“name”~”Ma\.”,i;
way[highway]“name”~”Rev\.”,i;
way[highway]“name”~”Mons\.”,i;
way[highway]“name”~”St\.”,i;
way[highway]“name”~”Sto\.”,i;
way[highway]“name”~”Sta\.”,i;
// Militares
way[highway]“name”~”Mal\.”,i;
way[highway]“name”~”Gen\.”,i;
way[highway]“name”~”Gal\.”,i;
way[highway]“name”~”Cel\.”,i;
way[highway]“name”~”Alm\.”,i;
way[highway]“name”~”Cap\.”,i;
way[highway]“name”~”Capt\.”,i;
way[highway]“name”~”Comte\.”,i;
way[highway]“name”~”Com\.”,i;
way[highway]“name”~”Col\.”,i;
way[highway]“name”~”Cel\.”,i;
way[highway]“name”~”Brig\.”,i;
way[highway]“name”~”Ten\.”,i;
way[highway]“name”~”Sgt\.”,i;
way[highway]“name”~”Sarg\.”,i;
way[highway]“name”~”Exp\.”,i;
// Administrativos
way[highway]“name”~”Pres\.”,i;
way[highway]“name”~”Presid\.”,i;
way[highway]“name”~”Gov\.”,i;
way[highway]“name”~”Pref\.”,i;
way[highway]“name”~”Ver\.”,i;
way[highway]“name”~”Dep\.”,i;
way[highway]“name”~”Min\.”,i;
way[highway]“name”~”Des\.”,i;
way[highway]“name”~”Cons\.”,i;
// Tratamento
way[highway]“name”~”Sr\.”,i;
way[highway]“name”~”Sra\.”,i;
// Diversos
way[highway]“name”~”º”;
way[highway]“name”~”ª”;
way[highway]“name”~”°”;
);
out body;
;
out skel qt;
Consulta Estradas
[out:json][timeout:25];( way“highway”=”motorway”; way“highway”=”trunk”; way“highway”=”primary”; way“highway”=”secondary”; way“highway”=”tertiary”;);out body;>;out skel qt;
CONSULTA OVERPASS DE ESCOLAS
[out:json][timeout:50]; // fetch area “Recife” to search in {{geocodeArea:Recife}}->.searchArea; // gather results ( // query part for: “amenity=school” node“amenity”=”school”; way“amenity”=”school”; relation“amenity”=”school”; ); // print results out body; >; out skel qt;
CONSULTA DE IGREJAS NO OVERPASS
[out:json][timeout:25]; // fetch area “Recife” to search in {{geocodeArea:Recife}}->.searchArea; // gather results ( // query part for: “amenity=place_of_worship” node“amenity”=”place_of_worship”; way“amenity”=”place_of_worship”; relation“amenity”=”place_of_worship”; ); // print results out body; >; out skel qt;
CONSULTA DE PREFEITURA EM UMA DETERMINADA AREA.
/* This has been generated by the overpass-turbo wizard. The original search was: “amenity=school” */ [out:json][timeout:25]; // gather results ( // query part for: “amenity=school” node“amenity”=”townhall”; way“amenity”=”townhall”; relation“amenity”=”townhall”; ); // print results out body; >; out skel qt;
CONSULTA AVENIDA EM UM BAIRRO
[out:xml][timeout:25];
{{geocodeArea:cohab,recife}}->.searchArea;
( way[“highway”=”tertiary”]“avenida”!~”.*”; );
out meta; >; out meta qt;
PESQUISA NO RAIO DE 500 METROS.
[out:json][timeout:25];
{{radius=500}}
(
way[“highway”=”residential”]“postal_code”!~”.”;
);
out body; >; out skel qt;
CONSULTA DE DELEGACIAS EM UMA DETERMINADA AREA
[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/
PESQUISA DE RUA SRESIDENCIAL SEM NOME
[out:xml]/fixed by auto repair/[timeout:250]; ( way[“highway”=”residential”]“name”!~”.”; ); out meta;/fixed by auto repair/ >; out meta qt;/fixed by auto repair/
PESQUISA DE RUA E AVENIDA SEM CEP POR RELAÇÃO
[out:xml][timeout:25];
area(3604271610) ->.searchArea;
( way[“highway”~”unclassified|residential|tertiary|secondary”]“postal_code”!~”.*”; );
out meta; >; out meta qt;
CONSULTA DE LOMBADA ELETRONICA EM UMA DETERMINADA AREA.
/* This query looks for nodes, ways and relations with the given key/value combination. Choose your region and hit the Run button above! */ [out:json][timeout:50]; // gather results ( // query part for: “highway=speed_camera” node“highway”=”speed_camera”; way“highway”=”speed_camera”; relation“highway”=”speed_camera”; ); // print results out body; >; out skel qt;
Consulta de ( Ruas sem Nome ) Usando uma Área de 2000 Metros, pode-se diminuir ou aumentar a Área.
[out:json][timeout:100]; {{radius=2000}} ( way[“name”!~”.”] “highway”;
); out body; >; out skel qt;
Donwload da Consulta: http://overpass-turbo.eu/s/17mq
Consulta de ( Avenida sem Cep – Codígo Postal ).
[out:xml][timeout:50];
{{geocodeArea:cohab, Recife}}->.searchArea;
(way[highway][name~”^Avenida”][postal_code!~”.*”] (area.searchArea); );
out meta; >; out meta qt;
Donwload da Consulta:
https://overpass-turbo.eu/s/17ms
Consulta de ( Igrejas ).
[out:json][timeout:25]; // fetch area “Recife” to search in {{geocodeArea:cohab, Recife}}->.searchArea; // gather results ( // query part for: “amenity=place_of_worship” node“amenity”=”place_of_worship”; way“amenity”=”place_of_worship”; relation“amenity”=”place_of_worship”; ); // print results out body; >; out skel qt;
Donwload da Consulta: https://overpass-turbo.eu/s/17mt
Consulta de ( Ruas e Avenidas por Área ) A relação é ( 4267728 ), acrescenta ( Área + Relação) ( 360 + 4267728) e a Relação da localidade +
[out:xml][timeout:25];
area(3604271610) ->.searchArea;
( way[“highway”~”unclassified|residential|tertiary|secondary”]“postal_code”!~”.*”; );
out meta; >; out meta qt;
Donwload da Consulta: https://overpass-turbo.eu/s/17mu
CONSULTA OVERPASS DE ESCOLAS
[out:json][timeout:50]; // fetch area “Recife” to search in {{geocodeArea:Recife}}->.searchArea; // gather results ( // query part for: “amenity=school” node“amenity”=”school”; way“amenity”=”school”; relation“amenity”=”school”; ); // print results out body; >; out skel qt;
CONSULTA DE IGREJAS NO OVERPASS
[out:json][timeout:25]; // fetch area “Recife” to search in {{geocodeArea:Recife}}->.searchArea; // gather results ( // query part for: “amenity=place_of_worship” node“amenity”=”place_of_worship”; way“amenity”=”place_of_worship”; relation“amenity”=”place_of_worship”; ); // print results out body; >; out skel qt;
CONSULTA DE PREFEITURA EM UMA DETERMINADA AREA.
/* This has been generated by the overpass-turbo wizard. The original search was: “amenity=school” */ [out:json][timeout:25]; // gather results ( // query part for: “amenity=school” node“amenity”=”townhall”; way“amenity”=”townhall”; relation“amenity”=”townhall”; ); // print results out body; >; out skel qt;
CONSULTA AVENIDA EM UM BAIRRO
[out:xml][timeout:25];
{{geocodeArea:cohab,recife}}->.searchArea;
( way[“highway”=”tertiary”]“avenida”!~”.*”; );
out meta; >; out meta qt;
PESQUISA NO RAIO DE 500 METROS.
[out:json][timeout:25];
{{radius=500}}
(
way[“highway”=”residential”]“postal_code”!~”.”;
);
out body; >; out skel qt;
CONSULTA DE DELEGACIAS EM UMA DETERMINADA AREA
[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/
PESQUISA DE RUA SRESIDENCIAL SEM NOME
[out:xml]/fixed by auto repair/[timeout:250]; ( way[“highway”=”residential”]“name”!~”.”; ); out meta;/fixed by auto repair/ >; out meta qt;/fixed by auto repair/
PESQUISA DE RUA E AVENIDA SEM CEP POR RELAÇÃO
[out:xml][timeout:25];
area(3604271610) ->.searchArea;
( way[“highway”~”unclassified|residential|tertiary|secondary”]“postal_code”!~”.*”; );
out meta; >; out meta qt;
CONSULTA DE LOMBADA ELETRONICA EM UMA DETERMINADA AREA.
/* This query looks for nodes, ways and relations with the given key/value combination. Choose your region and hit the Run button above! */ [out:json][timeout:50]; // gather results ( // query part for: “highway=speed_camera” node“highway”=”speed_camera”; way“highway”=”speed_camera”; relation“highway”=”speed_camera”; ); // print results out body; >; out skel qt;
Consulta de ( Ruas sem Nome ) Usando uma Área de 2000 Metros, pode-se diminuir ou aumentar a Área.
[out:json][timeout:100]; {{radius=2000}} ( way[“name”!~”.”] “highway”;
); out body; >; out skel qt;
Donwload da Consulta: http://overpass-turbo.eu/s/17mq
Consulta de ( Avenida sem Cep – Codígo Postal ).
[out:xml][timeout:50];
{{geocodeArea:cohab, Recife}}->.searchArea;
(way[highway][name~”^Avenida”][postal_code!~”.*”] (area.searchArea); );
out meta; >; out meta qt;
Donwload da Consulta: https://overpass-turbo.eu/s/17ms
Consulta de ( Ruas e Avenidas por Área ) A relação é ( 4267728 ), acrescenta ( Área + Relação) ( 360 + 4267728) e a Relação da localidade +
[out:xml][timeout:25];
area(3604271610) ->.searchArea;
( way[“highway”~”unclassified|residential|tertiary|secondary”]“postal_code”!~”.*”; );
out meta; >; out meta qt; Donwload da Consulta: https://overpass-turbo.eu/s/17mu
CONSULTA DE PREFEITURA EM UMA DETERMINADA AREA.
/* This has been generated by the overpass-turbo wizard. The original search was: “amenity=school” */ [out:json][timeout:25]; // gather results ( // query part for: “amenity=school” node“amenity”=”townhall”; way“amenity”=”townhall”; relation“amenity”=”townhall”; ); // print results out body; >; out skel qt;
CONSULTA AVENIDA EM UM BAIRRO
[out:xml][timeout:25];
{{geocodeArea:cohab,recife}}->.searchArea;
( way[“highway”=”tertiary”]“avenida”!~”.*”; );
out meta; >; out meta qt;
PESQUISA NO RAIO DE 500 METROS.
[out:json][timeout:25];
{{radius=500}}
(
way[“highway”=”residential”]“postal_code”!~”.”;
);
out body; >; out skel qt;
CONSULTA DE DELEGACIAS EM UMA DETERMINADA AREA
[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/
PESQUISA DE RUA SRESIDENCIAL SEM NOME
[out:xml]/fixed by auto repair/[timeout:250]; ( way[“highway”=”residential”]“name”!~”.”; ); out meta;/fixed by auto repair/ >; out meta qt;/fixed by auto repair/
PESQUISA DE RUA E AVENIDA SEM CEP POR RELAÇÃO
[out:xml][timeout:25];
area(3604271610) ->.searchArea;
( way[“highway”~”unclassified|residential|tertiary|secondary”]“postal_code”!~”.*”; );
out meta; >; out meta qt;
CONSULTA DE LOMBADA ELETRONICA EM UMA DETERMINADA AREA.
/* This query looks for nodes, ways and relations with the given key/value combination. Choose your region and hit the Run button above! */ [out:json][timeout:50]; // gather results ( // query part for: “highway=speed_camera” node“highway”=”speed_camera”; way“highway”=”speed_camera”; relation“highway”=”speed_camera”; ); // print results out body; >; out skel qt;
Consulta de ( Avenida sem Cep – Codígo Postal ).
[out:xml][timeout:50];
{{geocodeArea:cohab, Recife}}->.searchArea;
(way[highway][name~”^Avenida”][postal_code!~”.*”] (area.searchArea); );
out meta; >; out meta qt;
Donwload da Consulta: https://overpass-turbo.eu/s/17ms
Mais Consulta Overpass – Dados do Mapeador Tomio
https://docs.google.com/document/d/1U6AdN_4KkZW59Q3jR5S50kUulvGT-LrLlv1zbEQNJjM/edit
https://felipesbarros.github.io/Download-OSM-data/
More Examples of Overpass Query, click below link: Mais Exemplos de Consulta Overpass, clique no link Abaixo: https://www.umbraosm.com.br/overpass-turbo.html
Raphaelmirc Recife/PE.
Discussion
Comment from mmd on 30 January 2022 at 18:02
I’d recommend adding four leading space characters in each line to fix the formatting of your queries. Also, putting your queries on the OSM Wiki might be a good idea.
Without 4 leading spaces
( way[“highway”~”unclassified|residential|tertiary|secondary”]“postal_code”!~”.*”; );
With 4 leading spaces