3

I'm trying to do some geocoding in Python with the library geocoder and OpenStreetMap:

import geocoder
g = geocoder.osm('11 Wall Street, New York')
print(g.json)

Where can I get information about the different elements of the json-Dictionary?

The json-Dictionary:

{
   'accuracy': 0.511,
   'address': 'New York Stock Exchange, 11, Wall Street, Financial District, Manhattan, New York County, New York, 10005, United States',
   'bbox': {
       'northeast': [40.7073927, -74.0108331],
       'southwest': [40.7066568, -74.0115875]
   },
   'city': 'New York',
   'confidence': 10,
   'country': 'United States',
   'country_code': 'us',
   'county': 'New York County',
   'housenumber': '11',
   'icon': 'https://nominatim.openstreetmap.org/ui/mapicons//poi_point_of_interest.p.20.png',
   'importance': 0.511,
   'lat': 40.7070653,
   'lng': -74.01117438284459,
   'neighborhood': 'Financial District',
   'ok': True,
   'osm_id': 278053530,
   'osm_type': 'way',
   'place_id': 158065100,
   'place_rank': 30,
   'postal': '10005',
   'quality': 'attraction',
   'raw': {
       'place_id': 158065100,
       'licence': 'Data © OpenStreetMap contributors, ODbL 1.0. https://osm.org/copyright',
       'osm_type': 'way',
       'osm_id': 278053530,
       'boundingbox': ['40.7066568', '40.7073927', '-74.0115875', '-74.0108331'],
       'lat': '40.7070653',
       'lon': '-74.01117438284459',
       'display_name': 'New York Stock Exchange, 11, Wall Street, Financial District, Manhattan, New York County, New York, 10005, United States',
       'place_rank': 30,
       'category': 'tourism',
       'type': 'attraction',
       'importance': 0.511,
       'icon': 'https://nominatim.openstreetmap.org/ui/mapicons//poi_point_of_interest.p.20.png',
       'address': {
           'tourism': 'New York Stock Exchange',
           'house_number': '11',
           'road': 'Wall Street',
           'neighbourhood': 'Financial District',
           'suburb': 'Manhattan',
           'county': 'New York County',
           'city': 'New York',
           'state': 'New York',
           'postcode': '10005',
           'country': 'United States',
           'country_code': 'us'
       }
   },
   'region': 'New York',
   'state': 'New York',
   'status': 'OK',
   'street': 'Wall Street',
   'suburb': 'Manhattan',
   'type': 'attraction'

}

Some elements are of course obviously clear like lat and lng. What does a value of 0.511 for accuracy mean? What's the meaning of ok? What does a value of 10 for confidence mean? So for short: where can I get more info on this?

5

Unfortunately, these aren't all documented.

  • accuracy is an alias for "importance". There is some commentary on how importance is calculated in the osm-search/wikipedia-wikidata readme

Nominatim can use the page ranking of Wikipedia pages to help indicate the relative importance of osm features. This is done by calculating an importance score between 0 and 1 based on the number of inlinks to an article for a location. If two places have the same name and one is more important than the other, the wikipedia score often points to the correct place.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.