Spatial data examples
Project description
geodatasets
Fetch links or download and cache spatial data example files.
The geodatasets
contains an API on top of a JSON with metadata of externally hosted
datasets containing geospatial information useful for illustrative and educational
purposes.
Install
From PyPI:
pip install geodatasets
or using conda
or mamba
from conda-forge:
conda install geodatasets -c conda-forge
The development version can be installed using pip
from GitHub.
pip install git+https://github.com/geopandas/geodatasets.git
How to use
The package comes with a database of datasets. To see all:
In [1]: import geodatasets
In [2]: geodatasets.data
Out[2]:
{'geoda': {'airbnb': {'url': 'https://geodacenter.github.io/data-and-lab//data/airbnb.zip',
'license': 'NA',
'attribution': 'Center for Spatial Data Science, University of Chicago',
'name': 'geoda.airbnb',
'description': 'Airbnb rentals, socioeconomics, and crime in Chicago',
'geometry_type': 'Polygon',
'nrows': 77,
'ncols': 21,
'details': 'https://geodacenter.github.io/data-and-lab//airbnb/',
'hash': 'a2ab1e3f938226d287dd76cde18c00e2d3a260640dd826da7131827d9e76c824',
'filename': 'airbnb.zip'},
'atlanta': {'url': 'https://geodacenter.github.io/data-and-lab//data/atlanta_hom.zip',
'license': 'NA',
'attribution': 'Center for Spatial Data Science, University of Chicago',
'name': 'geoda.atlanta',
'description': 'Atlanta, GA region homicide counts and rates',
'geometry_type': 'Polygon',
'nrows': 90,
'ncols': 24,
'details': 'https://geodacenter.github.io/data-and-lab//atlanta_old/',
'hash': 'a33a76e12168fe84361e60c88a9df4856730487305846c559715c89b1a2b5e09',
'filename': 'atlanta_hom.zip',
'members': ['atlanta_hom/atl_hom.geojson']},
...
There is also convenient top-level API. One to get only the URL:
In [3]: geodatasets.get_url("geoda airbnb")
Out[3]: 'https://geodacenter.github.io/data-and-lab//data/airbnb.zip'
And one to get the local path. If the file is not available in the cache, it will be downloaded first.
In [4]: geodatasets.get_path('geoda airbnb')
Out[4]: '/Users/martin/Library/Caches/geodatasets/airbnb.zip'
You can also get all the details:
In [5]: geodatasets.data.geoda.airbnb
Out[5]:
{'url': 'https://geodacenter.github.io/data-and-lab//data/airbnb.zip',
'license': 'NA',
'attribution': 'Center for Spatial Data Science, University of Chicago',
'name': 'geoda.airbnb',
'description': 'Airbnb rentals, socioeconomics, and crime in Chicago',
'geometry_type': 'Polygon',
'nrows': 77,
'ncols': 21,
'details': 'https://geodacenter.github.io/data-and-lab//airbnb/',
'hash': 'a2ab1e3f938226d287dd76cde18c00e2d3a260640dd826da7131827d9e76c824',
'filename': 'airbnb.zip'}
Or using the name query:
In [6]: geodatasets.data.query_name('geoda airbnb')
Out[6]:
{'url': 'https://geodacenter.github.io/data-and-lab//data/airbnb.zip',
'license': 'NA',
'attribution': 'Center for Spatial Data Science, University of Chicago',
'name': 'geoda.airbnb',
'description': 'Airbnb rentals, socioeconomics, and crime in Chicago',
'geometry_type': 'Polygon',
'nrows': 77,
'ncols': 21,
'details': 'https://geodacenter.github.io/data-and-lab//airbnb/',
'hash': 'a2ab1e3f938226d287dd76cde18c00e2d3a260640dd826da7131827d9e76c824',
'filename': 'airbnb.zip'}
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Hashes for geodatasets-2023.2.0b2-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 9f476f1c76471c770c417269d8eb2f2c170d57a7a7e5970beda0f864a8d2d012 |
|
MD5 | 8e6678ffc3bac188d7a096ffe9a4f495 |
|
BLAKE2b-256 | 2e5a904b8d51b0dd1397c56dc766a20cad083832b6bdeda83dcdc26756fb2084 |