Why not ask your question on the new OpenStreetMap Community Forum?


I have been trying to find the basketball courts in the State of California. I downloaded the osm file for the state, then I imported the data into my database using osm2pgsql. I am able to select data using the following query but for some reason the address columns are empty. The only populated columns are osm_id, leisure, sport, and way. How can I go about finding the associated addresses for these records?

select * from planet_osm_polygon where sport = 'basketball'

asked 06 Oct '13, 22:35

reza215r's gravatar image

accept rate: 0%

Are you sure that OSM has these addresses at all? Remember, OSM data doesn't magically appear - it's only there if the person who added the baseball court added the address (or someone else added it later). It is entirely possible that a baseball court can be seen on aerial imagery and therefore mapped, but the address might not even be known to the person adding it in!

permanent link

answered 06 Oct '13, 22:51

Frederik%20Ramm's gravatar image

Frederik Ramm ♦
accept rate: 23%


Thanks for the answer. So if I go to www.openstreetmap.org and search with keywords "basketball California", it returns courts with their addresses. Do you happen to know where are those addresses coming from?

Here is an exmple of it: Sports Pitch Basketball Courts, Concha Street, Los Angeles, California, 91001, United States of America

(06 Oct '13, 23:04) reza215r

It is taking the location of the object in OSM and doing a reverse geocode to get a street name. If you click on the "view details" link in the search results you will see the actual OSM object that your search found and you can see that it indeed does not have an address mapped on it.

Also I should note that the search is finding that object because of the name=Basketball tag, not because it is tagged with sport=basketball.

(07 Oct '13, 00:53) ToeBee

ok, that makes sense, thanks! One quick question though, which column/field should I run the reverse geocode against to in order to extract the address?

(07 Oct '13, 15:20) reza215r

Reverse geocoding takes a lat/lon and returns an address. So you need the location, not any of the tags. I think Nominatim (which drives the search on osm.org) takes the centroid of the area. You could get this from the linestring column in your database.

(07 Oct '13, 16:44) ToeBee

Keep in mind that Nominatim limits usage of the public instance. See http://wiki.openstreetmap.org/wiki/Nominatim_usage_policy#Bulk_Geocoding

(07 Oct '13, 17:53) gormo
Your answer
toggle preview

Follow this question

By Email:

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



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:


question asked: 06 Oct '13, 22:35

question was seen: 1,959 times

last updated: 07 Oct '13, 17:53

powered by OSQA