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

I am interested in building a database table of as many city parks as I can. Looking through the docs of Open Street Map, it looks like there are lots of big hammers, but the operation I want to accomplish is quite simple: I just want to get the name, city/state, and lat/long of as many city parks as I can.

How can I accomplish this with OSM data? Do I need to download the 40GB world and start filtering from there? I am comfortable working with SQL databases, if I could get it into that format I could perhaps query and trim down the extra data from there.

asked 02 Mar '20, 05:47

broderick99's gravatar image

broderick99
21112
accept rate: 0%

1

This is not an answer to your question because you specified "with OSM data" but... you can query the USGS geonames server for features of class "park" and download the results per state. (I don't know of any way to do a single query for the whole country.)

https://geonames.usgs.gov/apex/f?p=138:1:0:::::

This query will likely only return a fraction of what OSM has, because all of the USGS parks were imported into OSM but many more parks have been manually mapped by OSM users.

Be aware that 1) coordinates are sometimes approximate 2) some info is out of date 3) the definition of "park" is quite inconsistent, as Frederik mentioned.

(02 Mar '20, 19:48) jmapb
1

It's not got all the data for each entry, but there are bulk downloads for GNIS:

https://www.usgs.gov/core-science-systems/ngp/board-on-geographic-names/download-gnis-data

(02 Mar '20, 21:33) maxerickson

You can start with this 7 GB file http://download.geofabrik.de/north-america/us-latest.osm.pbf and then import that into a PostGIS database with the osm2pgsql utility. On import, you can provide a "style file" that says which objects you are interested in; if you use this to limit the import to features of interest - at first guess, probably "boundary" polygons you you can find out which city or state something is in, and "leisure" polygons so get the parks - then you should end up with a relatively slim database. Be sure to use the options --slim and --drop on import to save space, and use --hstore to ensure you have access to all tags you need. An even more surgical option would be pre-filtering the PBF file with the osmosis utility where you can not only specify keys but also key-value combinations that you want to import, yielding a much smaller PBF file to feed to osm2pgsql.

Be aware that the word "park" means many different things - anything between "a patch of green in the city" and "a state-sized highly protected natural reserve", and you might have to invest a little time to get the queries right. See the discussion starting at https://lists.openstreetmap.org/pipermail/talk-us/2018-January/018263.html for some background.

permanent link

answered 02 Mar '20, 08:06

Frederik%20Ramm's gravatar image

Frederik Ramm ♦
82.5k927201273
accept rate: 23%

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:

×118
×18
×17
×15

question asked: 02 Mar '20, 05:47

question was seen: 1,825 times

last updated: 02 Mar '20, 21:33

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