Skip to main content
Pre-release

This release is a pre-release and may not be stable for production use.

sphgeom: spherical geometry primitives

Overview

This low-level C++ library provides primitives for representing points and regions on the unit sphere, as well as support for partitioning the sphere. It can be used to answer the following sorts of questions:

  • Is point X inside region Y?
  • Do two regions A and B intersect?
  • Which pieces of the sphere does region C overlap?

Regions can be serialized to binary strings, so that they may be stored efficiently in files or VARBINARY database columns. They can also be approximated with simpler regions - for example, one can ask for the bounding circle of a convex polygon.

Python bindings that expose most of the C++ API are also provided via pybind11.

Points

There are 3 different classes for points

  • LonLat for spherical coordinates,
  • Vector3d for Cartesian vectors in ℝ³ (not constrained to lie on the unit sphere)
  • UnitVector3d for vectors in ℝ³ with unit ℓ² norm.

Regions

Four basic spherical Region types are provided:

  • Box, a longitude/latitude angle box
  • Circle, a small circle defined by a center and opening angle/chord length
  • Ellipse, the intersection of an elliptical cone with the unit sphere
  • ConvexPolygon, a convex spherical polygon with unit vector vertices and great circle edges

In addition to the spherical regions, there is a type for 3-D axis aligned boxes, Box3d. All spherical regions know how to compute their 3-D bounding boxes, which makes it possible to insert them into a 3-D R-tree. This is used by the exposure indexing task in the daf_ingest package to spatially index exposure bounding polygons using the SQLite 3 R*tree module.

A region can also determine its spatial relationship to another region, and test whether or not it contains a given unit vector.

Pixelizations

This library also provides support for assigning points to pixels (a.k.a. cells or partitions) in a Pixelization (a.k.a. partitioning) of the sphere, and for determining which pixels intersect a region.

Currently, the Chunker class implements the partitioning scheme employed by Qserv. The HtmPixelization class implements the HTM (Hierarchical Triangular Mesh) pixelization. The Q3cPixelization and Mq3cPixelization classes implement the original Quad Tree Cube indexing scheme and a modified version with reduced pixel area variation.

Installing with pip

A simple pip-compatible installer is available. This only installs the Python bindings and the resulting installation is not usable for linking from C++. Some metadata (in particular the version number) are not set properly for the distribution. The main purpose for now is to allow other packages to pip install from the GitHub URL in their CI systems where sphgeom is a dependency.

See Also

Contributing

For instructions on how to contribute, see http://dm.lsst.org/#contributing (or just send us a pull request).

Support

For help, see http://dm.lsst.org/#support.

Metadata

Release files for lsst-sphgeom 25.0.0a20224800

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for lsst-sphgeom 25.0.0a20224800
File Size Uploaded Provenance
lsst-sphgeom-25.0.0a20224800.tar.gz 129.3 kB Without provenance Details

Built distributions (wheels)

Table of built distributions (wheels) for lsst-sphgeom 25.0.0a20224800
File
lsst_sphgeom-25.0.0a20224800-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.whl CPython 3.10 CPython 3.10 Linux glibc 2.17+ x86-64 Details
lsst_sphgeom-25.0.0a20224800-cp310-cp310-macosx_11_0_arm64.whl CPython 3.10 CPython 3.10 macOS 11.0+ ARM64 Details
lsst_sphgeom-25.0.0a20224800-cp310-cp310-macosx_10_9_x86_64.whl CPython 3.10 CPython 3.10 macOS 10.9+ x86-64 Details
lsst_sphgeom-25.0.0a20224800-cp39-cp39-manylinux_2_17_x86_64.manylinux2014_x86_64.whl CPython 3.9 CPython 3.9 Linux glibc 2.17+ x86-64 Details
lsst_sphgeom-25.0.0a20224800-cp39-cp39-macosx_11_0_arm64.whl CPython 3.9 CPython 3.9 macOS 11.0+ ARM64 Details
lsst_sphgeom-25.0.0a20224800-cp39-cp39-macosx_10_9_x86_64.whl CPython 3.9 CPython 3.9 macOS 10.9+ x86-64 Details
lsst_sphgeom-25.0.0a20224800-cp38-cp38-manylinux_2_17_x86_64.manylinux2014_x86_64.whl CPython 3.8 CPython 3.8 Linux glibc 2.17+ x86-64 Details
lsst_sphgeom-25.0.0a20224800-cp38-cp38-macosx_11_0_arm64.whl CPython 3.8 CPython 3.8 macOS 11.0+ ARM64 Details
lsst_sphgeom-25.0.0a20224800-cp38-cp38-macosx_10_9_x86_64.whl CPython 3.8 CPython 3.8 macOS 10.9+ x86-64 Details

Total release size: 5.1 MB

Release files / lsst-sphgeom-25.0.0a20224800.tar.gz

Download URL lsst-sphgeom-25.0.0a20224800.tar.gz
Size 129.3 kB
Tags Source
SHA-256 checksum
How to use checksums
2113a7b1395178bb27db5e62be2dfb94413892477eaa3af5cd10eafd46152ef9
BLAKE2b-256 checksum
How to use checksums
86076691665c9a8f40896d148c51b70a8c580508a76c28020baa32f8a05cf72d
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/4.0.1 CPython/3.9.15

Release files / lsst_sphgeom-25.0.0a20224800-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.whl

Download URL lsst_sphgeom-25.0.0a20224800-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Size 659.2 kB
Tags CPython 3.10 Linux glibc 2.17+ x86-64
SHA-256 checksum
How to use checksums
d668ac07d291b6c5b0c428c744cace2f4e3b29d90923c73a6b29a33fd65af055
BLAKE2b-256 checksum
How to use checksums
1cd0371e72fac8e0b665616fe57e676c7d19739390e18c623b6a5bd04a28c3a6
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/4.0.1 CPython/3.9.15

Release files / lsst_sphgeom-25.0.0a20224800-cp310-cp310-macosx_11_0_arm64.whl

Download URL lsst_sphgeom-25.0.0a20224800-cp310-cp310-macosx_11_0_arm64.whl
Size 491.7 kB
Tags CPython 3.10 macOS 11.0+ ARM64
SHA-256 checksum
How to use checksums
d589fe7be12ed2f1acda56cdb8c997a36a2056c50f1b322b80c8d36234d8f9fc
BLAKE2b-256 checksum
How to use checksums
75069dfd01cb6c17c1c73ea691466c2ca29022a42100d0eae98239ca5ba986fb
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/4.0.1 CPython/3.9.15

Release files / lsst_sphgeom-25.0.0a20224800-cp310-cp310-macosx_10_9_x86_64.whl

Download URL lsst_sphgeom-25.0.0a20224800-cp310-cp310-macosx_10_9_x86_64.whl
Size 513.2 kB
Tags CPython 3.10 macOS 10.9+ x86-64
SHA-256 checksum
How to use checksums
0890d808d9aa4272b58e5a06f3805ef9992904c3280ed58e07f70f6d51e9cc71
BLAKE2b-256 checksum
How to use checksums
7ec1bf145fe03ea0a98c47cf4dacd350d029ef02a5c11181c55a47d80a81fc4f
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/4.0.1 CPython/3.9.15

Release files / lsst_sphgeom-25.0.0a20224800-cp39-cp39-manylinux_2_17_x86_64.manylinux2014_x86_64.whl

Download URL lsst_sphgeom-25.0.0a20224800-cp39-cp39-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Size 666.6 kB
Tags CPython 3.9 Linux glibc 2.17+ x86-64
SHA-256 checksum
How to use checksums
2dee75ed6b2fbe962a485a069108c8a86bee0db514eb601979321fd1c48204cf
BLAKE2b-256 checksum
How to use checksums
301f893e313ae4ef6b401e3b7dc4b3674894ba4f99a056f423d5fdfade07bb85
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/4.0.1 CPython/3.9.15

Release files / lsst_sphgeom-25.0.0a20224800-cp39-cp39-macosx_11_0_arm64.whl

Download URL lsst_sphgeom-25.0.0a20224800-cp39-cp39-macosx_11_0_arm64.whl
Size 491.7 kB
Tags CPython 3.9 macOS 11.0+ ARM64
SHA-256 checksum
How to use checksums
f2686a6ca7164a6702c1991fbedb3d78f42f6813d46301adcb97dcc5291b3a19
BLAKE2b-256 checksum
How to use checksums
0f7113af765e350a409c315d4695305d1236725f87208cb7554c663c49f9157d
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/4.0.1 CPython/3.9.15

Release files / lsst_sphgeom-25.0.0a20224800-cp39-cp39-macosx_10_9_x86_64.whl

Download URL lsst_sphgeom-25.0.0a20224800-cp39-cp39-macosx_10_9_x86_64.whl
Size 513.3 kB
Tags CPython 3.9 macOS 10.9+ x86-64
SHA-256 checksum
How to use checksums
780c2b53500d8364cf9f0e6b7fd75fd9f032c5bf2fbb82b2eb7ae18923b1ce69
BLAKE2b-256 checksum
How to use checksums
13f5240952290d7ff5b71be406f43e0605e0e5de5c82dff0e7e270180d0c999b
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/4.0.1 CPython/3.9.15

Release files / lsst_sphgeom-25.0.0a20224800-cp38-cp38-manylinux_2_17_x86_64.manylinux2014_x86_64.whl

Download URL lsst_sphgeom-25.0.0a20224800-cp38-cp38-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Size 659.8 kB
Tags CPython 3.8 Linux glibc 2.17+ x86-64
SHA-256 checksum
How to use checksums
35944c066acb83973dec93a08296a77d629c43394fcc14626eca867776abcdd5
BLAKE2b-256 checksum
How to use checksums
ccd096eb30cc1eb8e820be32c0988ecfc36ec66603bb9391bb5cb68b5cbbd746
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/4.0.1 CPython/3.9.15

Release files / lsst_sphgeom-25.0.0a20224800-cp38-cp38-macosx_11_0_arm64.whl

Download URL lsst_sphgeom-25.0.0a20224800-cp38-cp38-macosx_11_0_arm64.whl
Size 491.6 kB
Tags CPython 3.8 macOS 11.0+ ARM64
SHA-256 checksum
How to use checksums
afd04599a682ff8b05f32695652898ae99ae3cea959528a65e9077b9332caffe
BLAKE2b-256 checksum
How to use checksums
d1be13d882d030f04acf2fb4f73cfcec039c5c0bd39ff29ed2f1caa073853e96
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/4.0.1 CPython/3.9.15

Release files / lsst_sphgeom-25.0.0a20224800-cp38-cp38-macosx_10_9_x86_64.whl

Download URL lsst_sphgeom-25.0.0a20224800-cp38-cp38-macosx_10_9_x86_64.whl
Size 513.1 kB
Tags CPython 3.8 macOS 10.9+ x86-64
SHA-256 checksum
How to use checksums
a4c7443f002de6ad030addf0b6c2f0fc4d32ee0d0d00a53933588201664db2be
BLAKE2b-256 checksum
How to use checksums
16b85416b5e9154038a1acb63c6183bd2af03115ed3d9a62f961cf035ed291c6
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/4.0.1 CPython/3.9.15

Security for lsst-sphgeom 25.0.0a20224800

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

No provenance found

None of the files in this release were uploaded with provenance metadata.

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Release history Release notifications | RSS feed

This release
Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page