https://github.com/dahnj/h3-pandas

Integration of H3 with GeoPandas and Pandas

https://github.com/dahnj/h3-pandas

Science Score: 26.0%

This score indicates how likely this project is to be science-related based on various indicators:

  • CITATION.cff file
  • codemeta.json file
    Found codemeta.json file
  • .zenodo.json file
    Found .zenodo.json file
  • DOI references
  • Academic publication links
  • Committers with academic emails
  • Institutional organization owner
  • JOSS paper metadata
  • Scientific vocabulary similarity
    Low similarity (11.1%) to scientific vocabulary

Keywords

geopandas geospatial h3 h3-pandas hexagons-are-bestagons pandas pyhon
Last synced: 5 months ago · JSON representation

Repository

Integration of H3 with GeoPandas and Pandas

Basic Info
Statistics
  • Stars: 220
  • Watchers: 5
  • Forks: 20
  • Open Issues: 12
  • Releases: 14
Topics
geopandas geospatial h3 h3-pandas hexagons-are-bestagons pandas pyhon
Created almost 5 years ago · Last pushed 12 months ago
Metadata Files
Readme License

README.md

H3 Logo

 

H3-Pandas ⬢ 🐼

Integrates H3 with GeoPandas and Pandas. image Binder image Documentation Status

 


Try it out


example usage

Installation

pip

image bash pip install h3pandas

conda

conda-version Anaconda-Server Badge bash conda install -c conda-forge h3pandas

Usage examples

H3 API

h3pandas automatically applies H3 functions to both Pandas Dataframes and GeoPandas Geodataframes

```python

Prepare data

import pandas as pd import h3pandas df = pd.DataFrame({'lat': [50, 51], 'lng': [14, 15]}) ```

```python

resolution = 10 df = df.h3.geotoh3(resolution) df

| h3_10 | lat | lng | |:----------------|------:|------:| | 8a1e30973807fff | 50 | 14 | | 8a1e2659c2c7fff | 51 | 15 |

df = df.h3.h3togeo_boundary() df

| h3_10 | lat | lng | geometry | |:----------------|------:|------:|:----------------| | 8a1e30973807fff | 50 | 14 | POLYGON ((...)) | | 8a1e2659c2c7fff | 51 | 15 | POLYGON ((...)) | ```

H3-Pandas Extended API

h3pandas also provides some extended functionality out-of-the-box, often simplifying common workflows into a single command.

```python

Set up data

import numpy as np import pandas as pd np.random.seed(1729) df = pd.DataFrame({ 'lat': np.random.uniform(50, 51, 100), 'lng': np.random.uniform(14, 15, 100), 'value': np.random.poisson(100, 100)}) }) ```

```python

Aggregate values by their location and sum

df = df.h3.geotoh3_aggregate(3) df

| h3_03 | value | geometry | |:----------------|--------:|:----------------| | 831e30fffffffff | 102 | POLYGON ((...)) | | 831e34fffffffff | 189 | POLYGON ((...)) | | 831e35fffffffff | 8744 | POLYGON ((...)) | | 831f1bfffffffff | 1040 | POLYGON ((...)) |

Aggregate to a lower H3 resolution

df.h3.h3toparent_aggregate(2)

| h3_02 | value | geometry | |:----------------|--------:|:----------------| | 821e37fffffffff | 9035 | POLYGON ((...)) | | 821f1ffffffffff | 1040 | POLYGON ((...)) | ```

Further examples

For more examples, see the example notebooks.

API

For a full API documentation and more usage examples, see the documentation.

Development

H3-Pandas cover the basics of the H3 API, but there are still many possible improvements.

Any suggestions and contributions are very welcome!

In particular, the next steps are: - [ ] Improvements & stability of the "Extended API", e.g. k_ring_smoothing.

Additional possible directions - [ ] Allow for alternate h3-py APIs such as memview_int - [ ] Performance improvements through Cythonized h3-py - [ ] Dask integration through dask-geopandas (experimental as of now)

See issues for more.

Owner

  • Name: Daniel Jahn (dahn)
  • Login: DahnJ
  • Kind: user
  • Location: null island (epsg:3068)
  • Company: @SylveraIO

If it has coordinates, then I'm up for it

GitHub Events

Total
  • Create event: 6
  • Release event: 1
  • Issues event: 4
  • Watch event: 15
  • Delete event: 9
  • Issue comment event: 9
  • Push event: 7
  • Pull request review event: 1
  • Pull request event: 10
  • Fork event: 2
Last Year
  • Create event: 6
  • Release event: 1
  • Issues event: 4
  • Watch event: 15
  • Delete event: 9
  • Issue comment event: 9
  • Push event: 7
  • Pull request review event: 1
  • Pull request event: 10
  • Fork event: 2

Committers

Last synced: 9 months ago

All Time
  • Total Commits: 146
  • Total Committers: 4
  • Avg Commits per committer: 36.5
  • Development Distribution Score (DDS): 0.048
Past Year
  • Commits: 4
  • Committers: 1
  • Avg Commits per committer: 4.0
  • Development Distribution Score (DDS): 0.0
Top Committers
Name Email Commits
dahn d****n@g****m 139
Richard Law l****r@l****z 4
RichardScottOZ 7****Z 2
Florian Neukirchen m****l@r****e 1
Committer Domains (Top 20 + Academic)

Issues and Pull Requests

Last synced: 6 months ago

All Time
  • Total issues: 20
  • Total pull requests: 24
  • Average time to close issues: 8 months
  • Average time to close pull requests: 5 days
  • Total issue authors: 15
  • Total pull request authors: 5
  • Average comments per issue: 1.6
  • Average comments per pull request: 0.46
  • Merged pull requests: 22
  • Bot issues: 0
  • Bot pull requests: 0
Past Year
  • Issues: 2
  • Pull requests: 10
  • Average time to close issues: 3 months
  • Average time to close pull requests: 4 days
  • Issue authors: 2
  • Pull request authors: 2
  • Average comments per issue: 2.0
  • Average comments per pull request: 0.8
  • Merged pull requests: 8
  • Bot issues: 0
  • Bot pull requests: 0
Top Authors
Issue Authors
  • DahnJ (6)
  • benmcdermott (1)
  • csetzkorn (1)
  • bwcastillo (1)
  • rfc-hv (1)
  • JoaoCarabetta (1)
  • KoalaGeo (1)
  • diehl (1)
  • ioalexei (1)
  • CarlaFernandez (1)
  • rejexx (1)
  • alpha-beta-soup (1)
  • MathewBiddle (1)
  • johnziebro (1)
  • hsbsid (1)
Pull Request Authors
  • DahnJ (17)
  • MathewBiddle (2)
  • RichardScottOZ (2)
  • alpha-beta-soup (1)
  • florianneukirchen (1)
Top Labels
Issue Labels
enhancement (6) good first issue (1)
Pull Request Labels

Packages

  • Total packages: 2
  • Total downloads:
    • pypi 19,051 last-month
  • Total dependent packages: 4
    (may contain duplicates)
  • Total dependent repositories: 5
    (may contain duplicates)
  • Total versions: 16
  • Total maintainers: 1
pypi.org: h3pandas

Integration of H3 and GeoPandas

  • Homepage: https://github.com/DahnJ/H3-Pandas
  • Documentation: https://h3pandas.readthedocs.io/
  • License: MIT License Copyright (c) 2021 Dahn Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
  • Latest release: 0.3.0
    published 12 months ago
  • Versions: 14
  • Dependent Packages: 4
  • Dependent Repositories: 5
  • Downloads: 19,051 Last month
Rankings
Dependent packages count: 2.4%
Downloads: 2.6%
Stargazers count: 5.3%
Average: 5.3%
Dependent repos count: 6.6%
Forks count: 9.6%
Maintainers (1)
Last synced: 6 months ago
conda-forge.org: h3pandas
  • Versions: 2
  • Dependent Packages: 0
  • Dependent Repositories: 0
Rankings
Stargazers count: 30.4%
Dependent repos count: 39.4%
Average: 41.6%
Forks count: 44.9%
Dependent packages count: 51.6%
Last synced: 5 months ago

Dependencies

docs/requirements.txt pypi
  • Sphinx ==3.5.4
  • geopandas ==0.9.
  • h3 ==3.7.
  • nbsphinx *
  • numpy ==1.20.
  • numpydoc ==1.1.0
  • pandas ==1.2.
  • pydata-sphinx-theme ==0.6.3
  • shapely ==1.7.
  • typing-extensions ==3.10.
environment.yml pypi
  • h3 ==3.7.6
setup.py pypi
  • geopandas *
  • h3 *
  • numpy *
  • pandas *
  • shapely *
  • typing-extensions *