Skip to main content

Objects for DGGS Cells and collections of Cells.

Project description

rHEALPix DGGS Simple Feature functions

This library contains functions for evaluating Simple Feature relations between DGGS Cells and sets of these. A wrapped version of this library is available as an RDFLib extension for GeoSPARQL queries: geosparql-dggs.

Installation

Coming to PyPI.

This package depends on the rhealpix-geo package to represent valid sets of Cells, and perform low level operations required to implement these functions.

Use

These functions are implemented in the file rhealsf/dggs_functions.py

This means they can be used like this (full working script):

from rhealsf import sfContains, sfEquals, sfDisjoint, sfOverlaps, sfWithin, sfTouches, sfIntersects

a = "R1"
b = "R11"
c = "R2"
d = "R1 R2"
e = "R2 R3"

print(f"a contains b, expected True, returns: {sfContains(a, b)}")
print(f"b contains a, expected False, returns: {sfContains(b, a)}")
print(f"a equals a, expected True, returns: {sfEquals(a, a)}")
print(f"a equals b, expected False, returns: {sfEquals(a, b)}")
print(f"a disjoint b, expected False, returns: {sfDisjoint(a, b)}")
print(f"b disjoint c, expected True, returns: {sfDisjoint(b, c)}")
print(f"a overlaps d, expected False (within), returns: {sfOverlaps(a, d)}")
print(f"d overlaps e, expected True, returns: {sfOverlaps(d, e)}")
print(f"c within d, expected True, returns: {sfWithin(c, d)}")
print(f"d within c, expected False, returns: {sfWithin(d, c)}")
print(f"a touches b, expected False, returns: {sfTouches(a, b)}")
print(f"a touches c, expected True, returns: {sfTouches(a, c)}")
print(f"a intersects b, expected True, returns: {sfIntersects(a, b)}")
print(f"b intersects c, expected False, returns: {sfIntersects(b, c)}")

Function Definitions

sfEqual: Two sets of cells are equal if they have the same identifier.
sfWithin: One set of cells (A) is within some other set of cells (B) if the addition of A's cells to B results in a set of cells equal to B, where A is not equal to B.
sfContains: One set of cells (A) is contains some other set of cells (B) if the addition of A's cells to B results in a set of cells equal to A, where A is not equal to B.
sfIntersects: One set of cells (A) intersects some other set of cells (B) where they share any two cells, or any cell in A is the parent or child of a cell in B, or any cell in A or B touches.
sfTouches: One set of cells (A) touches some other set of cells (B) where the cells meet at an edge, or vertex.
sfDisjoint: One set of cells (A) is disjoint with some other set of cells (B) where they do not share any two cells, no cell in A is the parent or child of a cell in B, and no cells in A and B touch.
sfOverlaps: One set of cells (A) overlaps some other set of cells (B) where the addition of A's cells to B results in a set of cells different from A and B, and A and B are not disjoint and do not touch.

Testing

All tests are in tests/ and implemented using unittest.

There are sets of tests for each of the Simple Feature functions.

Contributing

Via GitHub, Issues & Pull Requests:

License

This code is licensed with the BSD 3-clause license as per LICENSE.

Citation

@software{https://github.com/surroundaustralia/rhealpix-sf,
  author = {{David Habgood}},
  title = {Simple Feature functions for rHEALPix DGGS},
  version = {0.0.1},
  date = {2021},
  url = {https://github.com/surroundaustralia/rhealpix-sf}
}

Contact

Creator & maintainer:
David Habgood
Application Architect
SURROUND Australia Pty Ltd
david.habgood@surroundaustrlaia.com

https://orcid.org/0000-0002-3322-1868

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

rhealpix-sf-0.1.tar.gz (5.4 kB view details)

Uploaded Source

Built Distribution

rhealpix_sf-0.1-py3-none-any.whl (5.6 kB view details)

Uploaded Python 3

File details

Details for the file rhealpix-sf-0.1.tar.gz.

File metadata

  • Download URL: rhealpix-sf-0.1.tar.gz
  • Upload date:
  • Size: 5.4 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.4.2 importlib_metadata/4.6.4 pkginfo/1.7.1 requests/2.26.0 requests-toolbelt/0.9.1 tqdm/4.62.1 CPython/3.8.10

File hashes

Hashes for rhealpix-sf-0.1.tar.gz
Algorithm Hash digest
SHA256 55157e676abdaa7ceee77b836bdf29520572939089896603c89d774a2b6bcae1
MD5 32ee48b537e54aa5aa2a3c9ee4a1da20
BLAKE2b-256 5d8607bd0f7221cde51b723b5e0f0300f00a25ff154704b45c710ac61abf295e

See more details on using hashes here.

Provenance

File details

Details for the file rhealpix_sf-0.1-py3-none-any.whl.

File metadata

  • Download URL: rhealpix_sf-0.1-py3-none-any.whl
  • Upload date:
  • Size: 5.6 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.4.2 importlib_metadata/4.6.4 pkginfo/1.7.1 requests/2.26.0 requests-toolbelt/0.9.1 tqdm/4.62.1 CPython/3.8.10

File hashes

Hashes for rhealpix_sf-0.1-py3-none-any.whl
Algorithm Hash digest
SHA256 6f74c694fe91981200ad896eac4b07d2a926b64952a7780b373b03d9254f723f
MD5 fdd43b9f0e3c83db756bc450d1ed5b6e
BLAKE2b-256 cfd03bb49ff362e0d310abe8f7301498efc88d8837d4a3582dc19ab66d2a5824

See more details on using hashes here.

Provenance

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