NOTICE: help.openstreetmap.org is no longer in use from 1st March 2024. Please use the OpenStreetMap Community Forum

I'm trying to run an Overpass turbo query of OpenStreetMaps Cities that will return the cities as CSV data with several fields (columns).

I'm currently able to get these fields:

Latitude, Longitude, Name, Population (plus any other simple tags of the nodes)

By running this query:

[out:csv(::lat,::lon,name,population)][timeout:300];
// fetch area to search in
{{geocodeArea:united states}}->.searchArea;
// gather results
(
  node[place="city"](area.searchArea)(if:count_tags() > 0);
);
// print results
out body;
>;
out skel qt;

But, I would like to also get these fields, and I have been unable to do so:

  1. Total number of tags associated with the node
  2. Name of the Country in which the node is located
  3. Name of the State in which the node is located

I know that data is there, because I can use both the country and tag count to filter the data, but I can't seem to get those as data in my CSV output.

Any help would be greatly appreciated!

asked 06 Jun '22, 22:35

salb1845's gravatar image

salb1845
11112
accept rate: 0%

Follow this question

By Email:

Once you sign in you will be able to subscribe for any updates here

By RSS:

Answers

Answers and Comments

Markdown Basics

  • *italic* or _italic_
  • **bold** or __bold__
  • link:[text](http://url.com/ "title")
  • image?![alt text](/path/img.jpg "title")
  • numbered list: 1. Foo 2. Bar
  • to add a line break simply add two spaces to where you would like the new line to be.
  • basic HTML tags are also supported

Question tags:

×228
×42

question asked: 06 Jun '22, 22:35

question was seen: 1,209 times

last updated: 06 Jun '22, 22:35

NOTICE: help.openstreetmap.org is no longer in use from 1st March 2024. Please use the OpenStreetMap Community Forum