All Projects → yaph → geonamescache

yaph / geonamescache

Licence: MIT license
geonamescache - a Python library for quick access to a subset of GeoNames data.

Programming Languages

python
139335 projects - #7 most used programming language
Makefile
30231 projects
javascript
184084 projects - #8 most used programming language

Projects that are alternatives of or similar to geonamescache

usmap
🗺 Create US maps including Alaska and Hawaii in R
Stars: ✭ 52 (-31.58%)
Mutual labels:  geodata, states, fips, counties
world
A Laravel package which provides a list of the countries, states, cities, currencies, timezones and languages.
Stars: ✭ 479 (+530.26%)
Mutual labels:  countries, states
Countries
Laravel countries and currencies
Stars: ✭ 1,564 (+1957.89%)
Mutual labels:  countries, states
geonames-client
GeoNames API Client
Stars: ✭ 32 (-57.89%)
Mutual labels:  geonames, countries
oracle-geo-data
demo.insum.ca/ords/f?p=131
Stars: ✭ 20 (-73.68%)
Mutual labels:  countries, states
fias
Ruby wrapper for the Russian FIAS database (Федеральная Информационная Адресная Система)
Stars: ✭ 82 (+7.89%)
Mutual labels:  geo, geodata
Geostats.jl
An extensible framework for high-performance geostatistics in Julia
Stars: ✭ 222 (+192.11%)
Mutual labels:  geo
geode
🌎 wrapper for www.geonames.org written in javascript as a node module
Stars: ✭ 57 (-25%)
Mutual labels:  geonames
React Geo
A set of geo related modules to use in combination with React, Ant Design and OpenLayers.
Stars: ✭ 220 (+189.47%)
Mutual labels:  geo
City Geo
🌄 中国城市经纬度数据。
Stars: ✭ 196 (+157.89%)
Mutual labels:  geo
Xponents
Geographic Place, Date/time, and Pattern entity extraction toolkit along with text extraction from unstructured data and GIS outputters.
Stars: ✭ 39 (-48.68%)
Mutual labels:  geonames
CLAVIN-rest
A Spring Boot microservice that serves the CLAVIN (https://github.com/novetta/CLAVIN) library for geo rectifying locations mentioned in text.
Stars: ✭ 16 (-78.95%)
Mutual labels:  geonames
Warp10 Platform
The Most Advanced Time Series Platform
Stars: ✭ 227 (+198.68%)
Mutual labels:  geo
lucene-geo-gazetteer
Uses Apache Lucene, OpenNLP and geonames and extracts locations from text and geocodes them.
Stars: ✭ 34 (-55.26%)
Mutual labels:  geonames
Geokit
Geo-Toolkit for PHP.
Stars: ✭ 223 (+193.42%)
Mutual labels:  geo
SiEPIC Photonics Package
A Python (v3.6.5) package that provides a set of basic functions commonly used in integrated photonics.
Stars: ✭ 22 (-71.05%)
Mutual labels:  python-package
All The Cities
All the 138,398 cities of the world with a population of at least 1000 inhabitants, in a big JSON array.
Stars: ✭ 216 (+184.21%)
Mutual labels:  geo
local-reverse-geocoder
Local reverse geocoder for Node.js based on GeoNames data
Stars: ✭ 155 (+103.95%)
Mutual labels:  geonames
WhatsMissingInGeoparsing
The accompanying code and data for the Springer 2017 publication "What's missing in geographical parsing?" in Language Resources and Evaluation.
Stars: ✭ 15 (-80.26%)
Mutual labels:  geonames
Go Staticmaps
A go (golang) library and command line tool to render static map images using OpenStreetMap tiles.
Stars: ✭ 246 (+223.68%)
Mutual labels:  geo

GeonamesCache

image

A Python library that provides functions to retrieve names, ISO and FIPS codes of continents, countries as well as US states and counties as Python dictionaries. The country and city datasets also include population and geographic data.

Geonames data is obtained from GeoNames.

Installation

pip install geonamescache

Usage

A simple usage example:

import geonamescache

gc = geonamescache.GeonamesCache()
countries = gc.get_countries()
# print countries dictionary
print(countries)
# you really wanna do something more useful with the data...

Settings

Cities dataset

When creating a GeonamesCache you can set the min_city_population parameter to either of 500, 1000, 5000 or the default 15000. The smaller the minimum popluation the more cities are included in the cities dataset.

New in version 1.4

Methods

Currently geonamescache provides the following methods, that return dictionaries with the requested data:

  • get_continents()
  • get_countries()
  • get_us_states()
  • get_cities()
  • get_countries_by_names()
  • get_us_states_by_names()
  • get_cities_by_name(name)
  • get_us_counties()

In addition you can search for cities by name.

  • search_cities('NAME', case_sensitive=True)

This function returns a list of city records that match the given NAME.

  • By default the alternatenames attribute is searched for matches.
  • By default the search is case sensitive, it can be made case insensitive by changing case_sensitive to False.

Mappers

The mappers module provides function(s) to map data properties. Currently you can create a mapper that maps country properties, e. g. the name property to the iso3 property, to do so you'd write the following code:

from geonamescache.mappers import country
mapper = country(from_key='name', to_key='iso3')

iso3 = mapper('Spain') # iso3 is assigned ESP

Contributing

Please write test(s) for any new feature. If you wish to build the data from scratch, run make dl and make json.

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].