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 29.2.2rc1

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 29.2.2rc1
File Size Uploaded Provenance Actions
lsst_sphgeom-29.2.2rc1.tar.gz 160.9 kB Without provenance Details for lsst_sphgeom-29.2.2rc1.tar.gz

Built distributions (wheels)

Table of built distributions (wheels) for lsst-sphgeom 29.2.2rc1
File Actions
lsst_sphgeom-29.2.2rc1-cp313-cp313-manylinux_2_27_x86_64.manylinux_2_28_x86_64.whl CPython 3.13 CPython 3.13 Linux glibc 2.27+ x86-64, Linux glibc 2.28+ x86-64 Details for lsst_sphgeom-29.2.2rc1-cp313-cp313-manylinux_2_27_x86_64.manylinux_2_28_x86_64.whl
lsst_sphgeom-29.2.2rc1-cp313-cp313-manylinux_2_26_aarch64.manylinux_2_28_aarch64.whl CPython 3.13 CPython 3.13 Linux glibc 2.26+ ARM64, Linux glibc 2.28+ ARM64 Details for lsst_sphgeom-29.2.2rc1-cp313-cp313-manylinux_2_26_aarch64.manylinux_2_28_aarch64.whl
lsst_sphgeom-29.2.2rc1-cp313-cp313-macosx_11_0_arm64.whl CPython 3.13 CPython 3.13 macOS 11.0+ ARM64 Details for lsst_sphgeom-29.2.2rc1-cp313-cp313-macosx_11_0_arm64.whl
lsst_sphgeom-29.2.2rc1-cp313-cp313-macosx_10_13_x86_64.whl CPython 3.13 CPython 3.13 macOS 10.13+ x86-64 Details for lsst_sphgeom-29.2.2rc1-cp313-cp313-macosx_10_13_x86_64.whl
lsst_sphgeom-29.2.2rc1-cp312-cp312-manylinux_2_27_x86_64.manylinux_2_28_x86_64.whl CPython 3.12 CPython 3.12 Linux glibc 2.28+ x86-64, Linux glibc 2.27+ x86-64 Details for lsst_sphgeom-29.2.2rc1-cp312-cp312-manylinux_2_27_x86_64.manylinux_2_28_x86_64.whl
lsst_sphgeom-29.2.2rc1-cp312-cp312-manylinux_2_26_aarch64.manylinux_2_28_aarch64.whl CPython 3.12 CPython 3.12 Linux glibc 2.26+ ARM64, Linux glibc 2.28+ ARM64 Details for lsst_sphgeom-29.2.2rc1-cp312-cp312-manylinux_2_26_aarch64.manylinux_2_28_aarch64.whl
lsst_sphgeom-29.2.2rc1-cp312-cp312-macosx_11_0_arm64.whl CPython 3.12 CPython 3.12 macOS 11.0+ ARM64 Details for lsst_sphgeom-29.2.2rc1-cp312-cp312-macosx_11_0_arm64.whl
lsst_sphgeom-29.2.2rc1-cp312-cp312-macosx_10_13_x86_64.whl CPython 3.12 CPython 3.12 macOS 10.13+ x86-64 Details for lsst_sphgeom-29.2.2rc1-cp312-cp312-macosx_10_13_x86_64.whl
lsst_sphgeom-29.2.2rc1-cp311-cp311-manylinux_2_27_x86_64.manylinux_2_28_x86_64.whl CPython 3.11 CPython 3.11 Linux glibc 2.27+ x86-64, Linux glibc 2.28+ x86-64 Details for lsst_sphgeom-29.2.2rc1-cp311-cp311-manylinux_2_27_x86_64.manylinux_2_28_x86_64.whl
lsst_sphgeom-29.2.2rc1-cp311-cp311-manylinux_2_26_aarch64.manylinux_2_28_aarch64.whl CPython 3.11 CPython 3.11 Linux glibc 2.28+ ARM64, Linux glibc 2.26+ ARM64 Details for lsst_sphgeom-29.2.2rc1-cp311-cp311-manylinux_2_26_aarch64.manylinux_2_28_aarch64.whl
lsst_sphgeom-29.2.2rc1-cp311-cp311-macosx_11_0_arm64.whl CPython 3.11 CPython 3.11 macOS 11.0+ ARM64 Details for lsst_sphgeom-29.2.2rc1-cp311-cp311-macosx_11_0_arm64.whl
lsst_sphgeom-29.2.2rc1-cp311-cp311-macosx_10_9_x86_64.whl CPython 3.11 CPython 3.11 macOS 10.9+ x86-64 Details for lsst_sphgeom-29.2.2rc1-cp311-cp311-macosx_10_9_x86_64.whl
lsst_sphgeom-29.2.2rc1-cp310-cp310-manylinux_2_27_x86_64.manylinux_2_28_x86_64.whl CPython 3.10 CPython 3.10 Linux glibc 2.27+ x86-64, Linux glibc 2.28+ x86-64 Details for lsst_sphgeom-29.2.2rc1-cp310-cp310-manylinux_2_27_x86_64.manylinux_2_28_x86_64.whl
lsst_sphgeom-29.2.2rc1-cp310-cp310-manylinux_2_26_aarch64.manylinux_2_28_aarch64.whl CPython 3.10 CPython 3.10 Linux glibc 2.28+ ARM64, Linux glibc 2.26+ ARM64 Details for lsst_sphgeom-29.2.2rc1-cp310-cp310-manylinux_2_26_aarch64.manylinux_2_28_aarch64.whl
lsst_sphgeom-29.2.2rc1-cp310-cp310-macosx_11_0_arm64.whl CPython 3.10 CPython 3.10 macOS 11.0+ ARM64 Details for lsst_sphgeom-29.2.2rc1-cp310-cp310-macosx_11_0_arm64.whl
lsst_sphgeom-29.2.2rc1-cp310-cp310-macosx_10_9_x86_64.whl CPython 3.10 CPython 3.10 macOS 10.9+ x86-64 Details for lsst_sphgeom-29.2.2rc1-cp310-cp310-macosx_10_9_x86_64.whl

Total release size: 12.5 MB

Release files / lsst_sphgeom-29.2.2rc1.tar.gz

Download URL lsst_sphgeom-29.2.2rc1.tar.gz
Size 160.9 kB
Tags Source
SHA-256 checksum
How to use checksums
25df60d9827f7c5c089d4fa9693340bd1514083b825e49e7b1db2a9c1f77faa5
BLAKE2b-256 checksum
How to use checksums
7eff6f0d9e8bb9d5c3e30d78b795d20212137af6d396b2cf69984d2a9b6d79e2
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.13.16

Release files / lsst_sphgeom-29.2.2rc1-cp313-cp313-manylinux_2_27_x86_64.manylinux_2_28_x86_64.whl

Download URL lsst_sphgeom-29.2.2rc1-cp313-cp313-manylinux_2_27_x86_64.manylinux_2_28_x86_64.whl
Size 952.1 kB
Tags CPython 3.13 Linux glibc 2.27+ x86-64 Linux glibc 2.28+ x86-64
SHA-256 checksum
How to use checksums
ebd88be1d6e5352957cc0a3d9bbb68b90c02e28668dbbb94cacc140bd0ceea21
BLAKE2b-256 checksum
How to use checksums
68e0332584190ff17c2334288748c798a4cbc722581dcd157515ac467c81bd38
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.13.16

Release files / lsst_sphgeom-29.2.2rc1-cp313-cp313-manylinux_2_26_aarch64.manylinux_2_28_aarch64.whl

Download URL lsst_sphgeom-29.2.2rc1-cp313-cp313-manylinux_2_26_aarch64.manylinux_2_28_aarch64.whl
Size 891.6 kB
Tags CPython 3.13 Linux glibc 2.26+ ARM64 Linux glibc 2.28+ ARM64
SHA-256 checksum
How to use checksums
956a50abaf7b328353789b2e07373f040b1dc010a07cf49d21dd2367e7308dd5
BLAKE2b-256 checksum
How to use checksums
2e0119924d9f24c5a6c56bf0a960fbb150bfb2ef695e5d11a4ba30bc634996df
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.13.16

Release files / lsst_sphgeom-29.2.2rc1-cp313-cp313-macosx_11_0_arm64.whl

Download URL lsst_sphgeom-29.2.2rc1-cp313-cp313-macosx_11_0_arm64.whl
Size 621.0 kB
Tags CPython 3.13 macOS 11.0+ ARM64
SHA-256 checksum
How to use checksums
f027dfc4898665fefd566822662f77d7c691aef58406faafbcfc97b7554af561
BLAKE2b-256 checksum
How to use checksums
f983e2d72fe417654864dd794f3de8fa4396e7a5a30366142ac70623d115554f
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.13.16

Release files / lsst_sphgeom-29.2.2rc1-cp313-cp313-macosx_10_13_x86_64.whl

Download URL lsst_sphgeom-29.2.2rc1-cp313-cp313-macosx_10_13_x86_64.whl
Size 653.2 kB
Tags CPython 3.13 macOS 10.13+ x86-64
SHA-256 checksum
How to use checksums
9810312a145601a8bb44f4f6ff7a9df5eee1767b70dacfa1d94374fd20c62fcb
BLAKE2b-256 checksum
How to use checksums
68641f92b07e279e3a7688d2d5ce3344993eb933b6445890b2817c861c42f5d4
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.13.16

Release files / lsst_sphgeom-29.2.2rc1-cp312-cp312-manylinux_2_27_x86_64.manylinux_2_28_x86_64.whl

Download URL lsst_sphgeom-29.2.2rc1-cp312-cp312-manylinux_2_27_x86_64.manylinux_2_28_x86_64.whl
Size 952.8 kB
Tags CPython 3.12 Linux glibc 2.27+ x86-64 Linux glibc 2.28+ x86-64
SHA-256 checksum
How to use checksums
c4f25f316ddd6f2b25a1fa77c03513cca495462a5b0841935ade171aff0b2e3b
BLAKE2b-256 checksum
How to use checksums
9786af23cbdfea17a7f65dbd9b7f58995cb0293052ea1ce71ccc74473a1bc375
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.13.16

Release files / lsst_sphgeom-29.2.2rc1-cp312-cp312-manylinux_2_26_aarch64.manylinux_2_28_aarch64.whl

Download URL lsst_sphgeom-29.2.2rc1-cp312-cp312-manylinux_2_26_aarch64.manylinux_2_28_aarch64.whl
Size 891.6 kB
Tags CPython 3.12 Linux glibc 2.26+ ARM64 Linux glibc 2.28+ ARM64
SHA-256 checksum
How to use checksums
d3be8ffd51d2d3bd907b6b7a7f45b28ca960dbc454ce07b6f910ad51fc811017
BLAKE2b-256 checksum
How to use checksums
154adc7ced447c8fc49ce492e7fb6de257108fcecc60ffbd1fd563dadb0b2861
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.13.16

Release files / lsst_sphgeom-29.2.2rc1-cp312-cp312-macosx_11_0_arm64.whl

Download URL lsst_sphgeom-29.2.2rc1-cp312-cp312-macosx_11_0_arm64.whl
Size 620.9 kB
Tags CPython 3.12 macOS 11.0+ ARM64
SHA-256 checksum
How to use checksums
4e7866e516bd3361dd629e078de1a9fe11b6b905bfde1601c110f96cf4623fec
BLAKE2b-256 checksum
How to use checksums
b5e3ccbd2fb5b7fd29dbfec66093c33163a90c987aa241d647ab14f79092377f
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.13.16

Release files / lsst_sphgeom-29.2.2rc1-cp312-cp312-macosx_10_13_x86_64.whl

Download URL lsst_sphgeom-29.2.2rc1-cp312-cp312-macosx_10_13_x86_64.whl
Size 653.2 kB
Tags CPython 3.12 macOS 10.13+ x86-64
SHA-256 checksum
How to use checksums
3087ba6221dcbbfdcd3d7fc60a52d017a72a72cd51758fa7fc2743e46aac0214
BLAKE2b-256 checksum
How to use checksums
af83f207304f42befa0722d244de0575b82561dcb84fcf3b9bb21946cc24379e
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.13.16

Release files / lsst_sphgeom-29.2.2rc1-cp311-cp311-manylinux_2_27_x86_64.manylinux_2_28_x86_64.whl

Download URL lsst_sphgeom-29.2.2rc1-cp311-cp311-manylinux_2_27_x86_64.manylinux_2_28_x86_64.whl
Size 932.6 kB
Tags CPython 3.11 Linux glibc 2.27+ x86-64 Linux glibc 2.28+ x86-64
SHA-256 checksum
How to use checksums
07e90023bb8c8e5edb8f2462a7e5f0dff8362efccb1185688e70a3375d2ac202
BLAKE2b-256 checksum
How to use checksums
c184307cd50a244351ddb96a45c36c1d943aa1f3254a0725ddbe2686edcd6795
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.13.16

Release files / lsst_sphgeom-29.2.2rc1-cp311-cp311-manylinux_2_26_aarch64.manylinux_2_28_aarch64.whl

Download URL lsst_sphgeom-29.2.2rc1-cp311-cp311-manylinux_2_26_aarch64.manylinux_2_28_aarch64.whl
Size 885.7 kB
Tags CPython 3.11 Linux glibc 2.26+ ARM64 Linux glibc 2.28+ ARM64
SHA-256 checksum
How to use checksums
4b4b0313f6302c064fb7f1edce9199f6116b2b90b5836d0ac613b4d969565daf
BLAKE2b-256 checksum
How to use checksums
a2b47021cd623853d4d0e4fbb4eacccab33f993ee77bccac497adba7f862c753
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.13.16

Release files / lsst_sphgeom-29.2.2rc1-cp311-cp311-macosx_11_0_arm64.whl

Download URL lsst_sphgeom-29.2.2rc1-cp311-cp311-macosx_11_0_arm64.whl
Size 614.4 kB
Tags CPython 3.11 macOS 11.0+ ARM64
SHA-256 checksum
How to use checksums
f71767bdddc8896093f5ee86e96248fa4c63d1b52ed5a1b13f96aeb8ff4946a8
BLAKE2b-256 checksum
How to use checksums
0543e3220d407b7b678b918a6f49ff3d7129ed9169e902e37b3171079c9dc1e0
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.13.16

Release files / lsst_sphgeom-29.2.2rc1-cp311-cp311-macosx_10_9_x86_64.whl

Download URL lsst_sphgeom-29.2.2rc1-cp311-cp311-macosx_10_9_x86_64.whl
Size 635.9 kB
Tags CPython 3.11 macOS 10.9+ x86-64
SHA-256 checksum
How to use checksums
bfcdb5841c7155f3f019c2a410d86ad075c4f7ced4c64463d62a60e54fdc969d
BLAKE2b-256 checksum
How to use checksums
d6f9f20f48d5a02bbb4d5d2017de284b3a7b468983f7f1a934f66692eb28903d
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.13.16

Release files / lsst_sphgeom-29.2.2rc1-cp310-cp310-manylinux_2_27_x86_64.manylinux_2_28_x86_64.whl

Download URL lsst_sphgeom-29.2.2rc1-cp310-cp310-manylinux_2_27_x86_64.manylinux_2_28_x86_64.whl
Size 930.4 kB
Tags CPython 3.10 Linux glibc 2.27+ x86-64 Linux glibc 2.28+ x86-64
SHA-256 checksum
How to use checksums
3e8e27d4786f730a0db18e327769c71dcea00bf09fdeb33497bff3e5bb03d480
BLAKE2b-256 checksum
How to use checksums
ff7658cfa411c25b34dacac1d2348739cf9f3dba168f77deefbab86d9ea344b2
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.13.16

Release files / lsst_sphgeom-29.2.2rc1-cp310-cp310-manylinux_2_26_aarch64.manylinux_2_28_aarch64.whl

Download URL lsst_sphgeom-29.2.2rc1-cp310-cp310-manylinux_2_26_aarch64.manylinux_2_28_aarch64.whl
Size 883.7 kB
Tags CPython 3.10 Linux glibc 2.26+ ARM64 Linux glibc 2.28+ ARM64
SHA-256 checksum
How to use checksums
3e3b2a29343f9778b9e919aa92ad6f6dcb8eb5780112d347903c7e7bdfd74960
BLAKE2b-256 checksum
How to use checksums
fabc9fb9940b8b44d48677db4aa592248353e8b9118946a58976e2abb923731d
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.13.16

Release files / lsst_sphgeom-29.2.2rc1-cp310-cp310-macosx_11_0_arm64.whl

Download URL lsst_sphgeom-29.2.2rc1-cp310-cp310-macosx_11_0_arm64.whl
Size 612.4 kB
Tags CPython 3.10 macOS 11.0+ ARM64
SHA-256 checksum
How to use checksums
79140aa55e8b57ad5774c5a5d9cacb4a2888b8a30ae74a4f7875797838b2b2f0
BLAKE2b-256 checksum
How to use checksums
856b10a79291e0005eaa1d3fcdeab28db3b03c7db72451cc7cf60b0b7f5efad2
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.13.16

Release files / lsst_sphgeom-29.2.2rc1-cp310-cp310-macosx_10_9_x86_64.whl

Download URL lsst_sphgeom-29.2.2rc1-cp310-cp310-macosx_10_9_x86_64.whl
Size 634.0 kB
Tags CPython 3.10 macOS 10.9+ x86-64
SHA-256 checksum
How to use checksums
b11783e13ad92d519657898c9fbf9cbb578db2a3d2f9660e8048bce0ac660a55
BLAKE2b-256 checksum
How to use checksums
5e7e6a77b5aa7bbc131750356ea0f6ae3bbecc422197c72616c9ccc56b95e089
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.13.16

Security for lsst-sphgeom 29.2.2rc1

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