Skip to main content

Geographical location data

Project description

This package contains geospatial data and associated facilities to resolve administrative areas.

To use the fuzzy-search capabilities (GeoData.resolve_name_fuzzy()), you will need to install datamart-geo[fuzzy].

Example usage:

>>> geo_data = datamart_geo.GeoData.download()  # Download data if needed

>>> france = geo_data.resolve_name('France')
>>> france
<datamart_geo.Area "Republic of France" (3017382) type=Type.ADMIN_0>
>>> france.latitude, france.longitude
(46.0, 2.0)
>>> france.bounds
(-61.797841, 55.854503, -21.370782, 51.087541)
>>> assert france.type == datamart_geo.Type.ADMIN_0
>>> assert france.type == datamart_geo.Type.COUNTRY

>>> cuers = geo_data.resolve_name('Cuers')
>>> cuers
<datamart_geo.Area "Cuers" (6451482) type=Type.ADMIN_4>
>>> cuers.latitude, cuers.longitude
(43.2375, 6.07083)
>>> cuers.get_parent_area()
<datamart_geo.Area "Arrondissement de Toulon" (2972326) type=Type.ADMIN_3>

>>> [
...     # Show multiple results with their parent ADMIN_1
...     (a, a.get_parent_area(datamart_geo.Type.ADMIN_1))
...     for a in geo_data.resolve_name_all('Var')
... ]
[(<datamart_geo.Area "Var" (2970749) type=Type.ADMIN_2>,
  <datamart_geo.Area "Provence-Alpes-Côte d'Azur" (2985244) type=Type.ADMIN_1>),
 (<datamart_geo.Area "Vars" (6427887) type=Type.ADMIN_4>,
  <datamart_geo.Area "Nouvelle-Aquitaine" (11071620) type=Type.ADMIN_1>),
 (<datamart_geo.Area "Vars" (6442138) type=Type.ADMIN_4>,
  <datamart_geo.Area "Bourgogne-Franche-Comté" (11071619) type=Type.ADMIN_1>)]

This package was built for Auctus, the dataset search engine from NYU, to resolve named areas during profiling.

See also:

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

datamart-geo-0.2.1.tar.gz (5.9 kB view details)

Uploaded Source

Built Distribution

datamart_geo-0.2.1-py3-none-any.whl (6.2 kB view details)

Uploaded Python 3

File details

Details for the file datamart-geo-0.2.1.tar.gz.

File metadata

  • Download URL: datamart-geo-0.2.1.tar.gz
  • Upload date:
  • Size: 5.9 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.1.1 pkginfo/1.4.2 requests/2.22.0 setuptools/45.2.0 requests-toolbelt/0.8.0 tqdm/4.30.0 CPython/3.8.5

File hashes

Hashes for datamart-geo-0.2.1.tar.gz
Algorithm Hash digest
SHA256 d1a4790355cf37f510e6123639288c095197f6ec1ca7822478c76c2a9cbdfcaa
MD5 d9490ce20e54aa63267788932cb28389
BLAKE2b-256 dbc04399906efa37e8d8cf758bbee0d29827d208871553aa53feb250f3c3d1bd

See more details on using hashes here.

File details

Details for the file datamart_geo-0.2.1-py3-none-any.whl.

File metadata

  • Download URL: datamart_geo-0.2.1-py3-none-any.whl
  • Upload date:
  • Size: 6.2 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.1.1 pkginfo/1.4.2 requests/2.22.0 setuptools/45.2.0 requests-toolbelt/0.8.0 tqdm/4.30.0 CPython/3.8.5

File hashes

Hashes for datamart_geo-0.2.1-py3-none-any.whl
Algorithm Hash digest
SHA256 1788fceb23f99069a1d1d32b23acf165339b13378234d0994bc16ec29bfdb9de
MD5 e2c0cda09659086d59c58ce09b288f39
BLAKE2b-256 ec1c7ae14cc1a1a1960fad0ba818b64c4eb93d48a771cae971a37b82bed996fe

See more details on using hashes here.

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page