API Reference

class geogotchi.Geogotchi(username='demo')
find_nearby_place(latlon, **kwargs)

Find nearby populated place (reverse geocoding).

Does a “findNearbyPlaceNameJSON” API call behind the scenes.

Parameters:
  • latlon – A latitude/longitude two-tuple.
  • radius – Radius in km.
  • max_rows – Max number of rows.
  • style – Verbosity (SHORT, MEDIUM, LONG or FULL).
find_nearby_toponym(latlon, **kwargs)

Find nearby toponym (reverse geocoding).

Does a “findNearbyJSON” API call behind the scenes.

Parameters:
  • latlon – A latitude/longitude two-tuple.
  • radius – Radius in km.
  • max_rows – Max number of rows.
  • style – Verbosity (SHORT, MEDIUM, LONG or FULL).
find_nearby_wikipedia(latlon, rank_weight=1.0, distance_weight=1.0, **kwargs)

Find nearby Wikipedia entries (reverse geocoding).

Does a “findNearbyWikipediaJSON” API call behind the scenes. Results are sorted in descending order.

Parameters:
  • latlon – A latitude/longitude two-tuple.
  • radius – Radius in km.
  • max_rows – Max number of rows.
  • rank_weight – Weight of rank in sorting, between 0.0 and 1.0.
  • distance_weight – Weight of distance in sorting, between 0.0 and 1.0.
  • lang – Language code.
get_hierarchy(geoname)

Returns all GeoNames higher up in the hierarchy of a place name.

Parameters:geoname – A dict with a “geonameId” key or an integer.
search(**kwargs)

Perform a search.

One of q, name and name_equals must be given. Non-unicode string arguments are assumed to be UTF-8 encoded.

Parameters:
  • q – Query over all attributes of a place.
  • name – Query place name only.
  • name_equals – Query exact place name.
  • max_rows – Max number of rows.
  • start_row – Used for paging results. If you want to get results 30 to 40, use start_row=30 and max_rows=10.
  • country – ISO-3166 country code.
  • country_bias – Records from the country bias are listed first.
  • continent_code – Restricts the search for a toponym of the given continent (AF, AS, EU, NA, OC, SA, AN).
  • feature_classGeoNames feature class
  • feature_codeGeoNames feature code
  • lang – ISO-636 2-letter language code (en, de, fr, se...)
  • style – Verbosity (SHORT, MEDIUM, LONG, FULL)
  • operator – AND (default) or OR.
  • fuzzy – Defines the fuzzyness of the search terms. Float between 0.0 and 1.0 (default 1.0).

Related Topics

This Page