Skip to main content

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 30.2026.4000

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 30.2026.4000
File Size Uploaded
lsst_sphgeom-30.2026.4000.tar.gz 177.5 kB Details

Built distributions (wheels)

Table of built distributions (wheels) for lsst-sphgeom 30.2026.4000
File
lsst_sphgeom-30.2026.4000-cp314-cp314-manylinux_2_27_x86_64.manylinux_2_28_x86_64.whl CPython 3.14 CPython 3.14 Linux glibc 2.27+ x86-64, Linux glibc 2.28+ x86-64 Details
lsst_sphgeom-30.2026.4000-cp314-cp314-manylinux_2_26_aarch64.manylinux_2_28_aarch64.whl CPython 3.14 CPython 3.14 Linux glibc 2.26+ ARM64, Linux glibc 2.28+ ARM64 Details
lsst_sphgeom-30.2026.4000-cp314-cp314-macosx_11_0_arm64.whl CPython 3.14 CPython 3.14 macOS 11.0+ ARM64 Details
lsst_sphgeom-30.2026.4000-cp314-cp314-macosx_10_15_x86_64.whl CPython 3.14 CPython 3.14 macOS 10.15+ x86-64 Details
lsst_sphgeom-30.2026.4000-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
lsst_sphgeom-30.2026.4000-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
lsst_sphgeom-30.2026.4000-cp313-cp313-macosx_11_0_arm64.whl CPython 3.13 CPython 3.13 macOS 11.0+ ARM64 Details
lsst_sphgeom-30.2026.4000-cp313-cp313-macosx_10_13_x86_64.whl CPython 3.13 CPython 3.13 macOS 10.13+ x86-64 Details
lsst_sphgeom-30.2026.4000-cp312-cp312-manylinux_2_27_x86_64.manylinux_2_28_x86_64.whl CPython 3.12 CPython 3.12 Linux glibc 2.27+ x86-64, Linux glibc 2.28+ x86-64 Details
lsst_sphgeom-30.2026.4000-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
lsst_sphgeom-30.2026.4000-cp312-cp312-macosx_11_0_arm64.whl CPython 3.12 CPython 3.12 macOS 11.0+ ARM64 Details
lsst_sphgeom-30.2026.4000-cp312-cp312-macosx_10_13_x86_64.whl CPython 3.12 CPython 3.12 macOS 10.13+ x86-64 Details
lsst_sphgeom-30.2026.4000-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
lsst_sphgeom-30.2026.4000-cp311-cp311-manylinux_2_26_aarch64.manylinux_2_28_aarch64.whl CPython 3.11 CPython 3.11 Linux glibc 2.26+ ARM64, Linux glibc 2.28+ ARM64 Details
lsst_sphgeom-30.2026.4000-cp311-cp311-macosx_11_0_arm64.whl CPython 3.11 CPython 3.11 macOS 11.0+ ARM64 Details
lsst_sphgeom-30.2026.4000-cp311-cp311-macosx_10_9_x86_64.whl CPython 3.11 CPython 3.11 macOS 10.9+ x86-64 Details
lsst_sphgeom-30.2026.4000-cp310-cp310-manylinux_2_27_x86_64.manylinux_2_28_x86_64.whl CPython 3.10 CPython 3.10 Linux glibc 2.28+ x86-64, Linux glibc 2.27+ x86-64 Details
lsst_sphgeom-30.2026.4000-cp310-cp310-manylinux_2_26_aarch64.manylinux_2_28_aarch64.whl CPython 3.10 CPython 3.10 Linux glibc 2.26+ ARM64, Linux glibc 2.28+ ARM64 Details
lsst_sphgeom-30.2026.4000-cp310-cp310-macosx_11_0_arm64.whl CPython 3.10 CPython 3.10 macOS 11.0+ ARM64 Details
lsst_sphgeom-30.2026.4000-cp310-cp310-macosx_10_9_x86_64.whl CPython 3.10 CPython 3.10 macOS 10.9+ x86-64 Details

Total release size: 16.9 MB

Release files / lsst_sphgeom-30.2026.4000.tar.gz

Download URL lsst_sphgeom-30.2026.4000.tar.gz
Size 177.5 kB
Tags Source
SHA-256 checksum
How to use checksums
fe0a3b18d82a2305247eff36c2af04659c3e61c376501d088e89698acff71851
BLAKE2b-256 checksum
How to use checksums
ea486b4bf145423a1447103345e566d33fafaed02549aa8585a15ee6d5acd895
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.13.14

Release files / lsst_sphgeom-30.2026.4000-cp314-cp314-manylinux_2_27_x86_64.manylinux_2_28_x86_64.whl

Download URL lsst_sphgeom-30.2026.4000-cp314-cp314-manylinux_2_27_x86_64.manylinux_2_28_x86_64.whl
Size 1.1 MB
Tags CPython 3.14 Linux glibc 2.27+ x86-64 Linux glibc 2.28+ x86-64
SHA-256 checksum
How to use checksums
167b4aeb72ce1aa4627f756f8a4f57e43c28b2afd53b8725bc257c9f639b14c0
BLAKE2b-256 checksum
How to use checksums
3403494129b845b2d6fdf9fbd011511e39f529e1d1edf45a0130cf9555c5f7ff
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.13.14

Release files / lsst_sphgeom-30.2026.4000-cp314-cp314-manylinux_2_26_aarch64.manylinux_2_28_aarch64.whl

Download URL lsst_sphgeom-30.2026.4000-cp314-cp314-manylinux_2_26_aarch64.manylinux_2_28_aarch64.whl
Size 1.0 MB
Tags CPython 3.14 Linux glibc 2.26+ ARM64 Linux glibc 2.28+ ARM64
SHA-256 checksum
How to use checksums
d32c101163c5274f502d3cd4dad70791b0f81f5aeaac5d6e7e6fe4351c9fe13e
BLAKE2b-256 checksum
How to use checksums
22ef8e57d42c3fb0a77781065e8e7395042f6fdda614007e6e25885011f64d7b
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.13.14

Release files / lsst_sphgeom-30.2026.4000-cp314-cp314-macosx_11_0_arm64.whl

Download URL lsst_sphgeom-30.2026.4000-cp314-cp314-macosx_11_0_arm64.whl
Size 633.7 kB
Tags CPython 3.14 macOS 11.0+ ARM64
SHA-256 checksum
How to use checksums
cd045781b1d302775e24c833466f5ace3ea265584b63ae313e7b01f73cf3dc4a
BLAKE2b-256 checksum
How to use checksums
84fbb3ad43e0a8939b0ab25810d7944a150adb4a039b82180eae4f52382a1638
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.13.14

Release files / lsst_sphgeom-30.2026.4000-cp314-cp314-macosx_10_15_x86_64.whl

Download URL lsst_sphgeom-30.2026.4000-cp314-cp314-macosx_10_15_x86_64.whl
Size 665.4 kB
Tags CPython 3.14 macOS 10.15+ x86-64
SHA-256 checksum
How to use checksums
0163ce61d5d05796e73e208856e021e199d3acf6b0200778358ef0c24b3936b9
BLAKE2b-256 checksum
How to use checksums
e167d096358d0cfad62dea4254d47920eb86985b8d9925eb4e591c062f6c4d10
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.13.14

Release files / lsst_sphgeom-30.2026.4000-cp313-cp313-manylinux_2_27_x86_64.manylinux_2_28_x86_64.whl

Download URL lsst_sphgeom-30.2026.4000-cp313-cp313-manylinux_2_27_x86_64.manylinux_2_28_x86_64.whl
Size 1.1 MB
Tags CPython 3.13 Linux glibc 2.27+ x86-64 Linux glibc 2.28+ x86-64
SHA-256 checksum
How to use checksums
fce13fd48c03d7a04b74eddca2cfe5a1217a57afb6fb292c1458f642efb1d5fa
BLAKE2b-256 checksum
How to use checksums
39112dc18d799762b5ff9199d514d0de832011bd69b26cd1ec1eb0e0028777cb
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.13.14

Release files / lsst_sphgeom-30.2026.4000-cp313-cp313-manylinux_2_26_aarch64.manylinux_2_28_aarch64.whl

Download URL lsst_sphgeom-30.2026.4000-cp313-cp313-manylinux_2_26_aarch64.manylinux_2_28_aarch64.whl
Size 998.5 kB
Tags CPython 3.13 Linux glibc 2.26+ ARM64 Linux glibc 2.28+ ARM64
SHA-256 checksum
How to use checksums
01722b8b3378b3b4e1cf6422f69bc5d2b61f40fc43b28b7b60d1a279cdbe66af
BLAKE2b-256 checksum
How to use checksums
7195541af37a8cc7ac6be4edfd9afb2a0fcbc088fb3f2cb1cdfe3e7ae29ec6a8
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.13.14

Release files / lsst_sphgeom-30.2026.4000-cp313-cp313-macosx_11_0_arm64.whl

Download URL lsst_sphgeom-30.2026.4000-cp313-cp313-macosx_11_0_arm64.whl
Size 631.7 kB
Tags CPython 3.13 macOS 11.0+ ARM64
SHA-256 checksum
How to use checksums
2cb1a1256a54d1d3005777386968615e2c004426429daf82abcb768ddc647e99
BLAKE2b-256 checksum
How to use checksums
2cb0c49a31841046e054ed2a72c496451689be04474080cabba15d41fd89af80
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.13.14

Release files / lsst_sphgeom-30.2026.4000-cp313-cp313-macosx_10_13_x86_64.whl

Download URL lsst_sphgeom-30.2026.4000-cp313-cp313-macosx_10_13_x86_64.whl
Size 664.8 kB
Tags CPython 3.13 macOS 10.13+ x86-64
SHA-256 checksum
How to use checksums
b9a3e3afa37f333de935497540ba7a1b10122c892bdf36e69e1badc0c6a88ae0
BLAKE2b-256 checksum
How to use checksums
ecacc09f87024f2ae5d4c4bc2ddb9307359e93a86d59953fdec926d70e9c3345
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.13.14

Release files / lsst_sphgeom-30.2026.4000-cp312-cp312-manylinux_2_27_x86_64.manylinux_2_28_x86_64.whl

Download URL lsst_sphgeom-30.2026.4000-cp312-cp312-manylinux_2_27_x86_64.manylinux_2_28_x86_64.whl
Size 1.1 MB
Tags CPython 3.12 Linux glibc 2.27+ x86-64 Linux glibc 2.28+ x86-64
SHA-256 checksum
How to use checksums
0c09294b1732dc0573e793b7c8694ea5f18a14c8b2cf71c52dd0008b534ba35b
BLAKE2b-256 checksum
How to use checksums
202f25f1058acd94745649bbff37fc28e987acae910a0aaa5d5f84f40a1ed62b
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.13.14

Release files / lsst_sphgeom-30.2026.4000-cp312-cp312-manylinux_2_26_aarch64.manylinux_2_28_aarch64.whl

Download URL lsst_sphgeom-30.2026.4000-cp312-cp312-manylinux_2_26_aarch64.manylinux_2_28_aarch64.whl
Size 997.8 kB
Tags CPython 3.12 Linux glibc 2.26+ ARM64 Linux glibc 2.28+ ARM64
SHA-256 checksum
How to use checksums
7304cc9c7bb9ecb590e773f750f34aee677a29180e8f2832f9642e5c0bdff782
BLAKE2b-256 checksum
How to use checksums
aafde06a1f85cc0278943b904d96d95eb287c5f3212f67cedb930a4809ecfd8e
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.13.14

Release files / lsst_sphgeom-30.2026.4000-cp312-cp312-macosx_11_0_arm64.whl

Download URL lsst_sphgeom-30.2026.4000-cp312-cp312-macosx_11_0_arm64.whl
Size 631.4 kB
Tags CPython 3.12 macOS 11.0+ ARM64
SHA-256 checksum
How to use checksums
c893c500d29787101b9a8333b9f29a6cd05f391e18565ee573ad583cb2e0aa39
BLAKE2b-256 checksum
How to use checksums
8755bc236085e8803e58e171ae0b6e314d74d4e7cb4535e2f96840c3e850a91c
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.13.14

Release files / lsst_sphgeom-30.2026.4000-cp312-cp312-macosx_10_13_x86_64.whl

Download URL lsst_sphgeom-30.2026.4000-cp312-cp312-macosx_10_13_x86_64.whl
Size 664.8 kB
Tags CPython 3.12 macOS 10.13+ x86-64
SHA-256 checksum
How to use checksums
d874241bfebdf67ab7456479df29bad686f7fe80db190e7065d204a4778fb62f
BLAKE2b-256 checksum
How to use checksums
79a10e9c64069f85febe5689977604b44a09e8c65a6505eafd7919dccff25bb8
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.13.14

Release files / lsst_sphgeom-30.2026.4000-cp311-cp311-manylinux_2_27_x86_64.manylinux_2_28_x86_64.whl

Download URL lsst_sphgeom-30.2026.4000-cp311-cp311-manylinux_2_27_x86_64.manylinux_2_28_x86_64.whl
Size 1.0 MB
Tags CPython 3.11 Linux glibc 2.27+ x86-64 Linux glibc 2.28+ x86-64
SHA-256 checksum
How to use checksums
68ece81bb0238e6692a671afa81747089414777bd1071f5703a8d8e7d1774d19
BLAKE2b-256 checksum
How to use checksums
0ed34a5c9609aa3b646a9c0b492f8bfc404db87ff5bbbc3c52952f22996d3853
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.13.14

Release files / lsst_sphgeom-30.2026.4000-cp311-cp311-manylinux_2_26_aarch64.manylinux_2_28_aarch64.whl

Download URL lsst_sphgeom-30.2026.4000-cp311-cp311-manylinux_2_26_aarch64.manylinux_2_28_aarch64.whl
Size 989.5 kB
Tags CPython 3.11 Linux glibc 2.26+ ARM64 Linux glibc 2.28+ ARM64
SHA-256 checksum
How to use checksums
08bbb6e94ce02703bf6f9fb18ba4cc3c3468f7d7b5839e12dfb3486991e9e376
BLAKE2b-256 checksum
How to use checksums
bd30b9136318280d005f0b8fe897f0c1672b976254cb5d74fe84f1bd9699cb4c
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.13.14

Release files / lsst_sphgeom-30.2026.4000-cp311-cp311-macosx_11_0_arm64.whl

Download URL lsst_sphgeom-30.2026.4000-cp311-cp311-macosx_11_0_arm64.whl
Size 625.4 kB
Tags CPython 3.11 macOS 11.0+ ARM64
SHA-256 checksum
How to use checksums
aba80a53de3181c05189aa23522c0df4624b61950e88cd4001fcec4d7b4bb273
BLAKE2b-256 checksum
How to use checksums
b0b51f29f816c180bf3d8d34c1c20bbb5f2988f38b62a2094b42c63e0b7d7cf1
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.13.14

Release files / lsst_sphgeom-30.2026.4000-cp311-cp311-macosx_10_9_x86_64.whl

Download URL lsst_sphgeom-30.2026.4000-cp311-cp311-macosx_10_9_x86_64.whl
Size 646.9 kB
Tags CPython 3.11 macOS 10.9+ x86-64
SHA-256 checksum
How to use checksums
2b183e7dc7e893ba6a441de635853e5df2fea9fee91bf780f1b1835c569aef76
BLAKE2b-256 checksum
How to use checksums
1f92fe6b699b17b4aab0f5db8d202bbd5d445159a1ca06cf137ebc3ed57fe41a
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.13.14

Release files / lsst_sphgeom-30.2026.4000-cp310-cp310-manylinux_2_27_x86_64.manylinux_2_28_x86_64.whl

Download URL lsst_sphgeom-30.2026.4000-cp310-cp310-manylinux_2_27_x86_64.manylinux_2_28_x86_64.whl
Size 1.0 MB
Tags CPython 3.10 Linux glibc 2.27+ x86-64 Linux glibc 2.28+ x86-64
SHA-256 checksum
How to use checksums
652fcd811cc28ec0f726f1ba79c38599317866b39bb55da7a2e282584d1e202b
BLAKE2b-256 checksum
How to use checksums
7b26806f4ee90ea62364e5b05e472a0e74f01001629480218e0a6d6a20320249
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.13.14

Release files / lsst_sphgeom-30.2026.4000-cp310-cp310-manylinux_2_26_aarch64.manylinux_2_28_aarch64.whl

Download URL lsst_sphgeom-30.2026.4000-cp310-cp310-manylinux_2_26_aarch64.manylinux_2_28_aarch64.whl
Size 986.3 kB
Tags CPython 3.10 Linux glibc 2.26+ ARM64 Linux glibc 2.28+ ARM64
SHA-256 checksum
How to use checksums
c13c2bec6af06b17ab22de756373b917d493d55b9d9faeb2c424df989947cb44
BLAKE2b-256 checksum
How to use checksums
ca7752668a1a3a50c3afc357ef11b26b6923a33cfc3d3ba19faf612635f4ef87
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.13.14

Release files / lsst_sphgeom-30.2026.4000-cp310-cp310-macosx_11_0_arm64.whl

Download URL lsst_sphgeom-30.2026.4000-cp310-cp310-macosx_11_0_arm64.whl
Size 624.1 kB
Tags CPython 3.10 macOS 11.0+ ARM64
SHA-256 checksum
How to use checksums
8e22bbc5179decc1a78b9b321cc36c0a6ff8115adad0e9ad669c30ece112110d
BLAKE2b-256 checksum
How to use checksums
ba9df8601dba5504184a527a2faa3c82db8b8e08d1eeebe6c3b17d9ef05164db
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.13.14

Release files / lsst_sphgeom-30.2026.4000-cp310-cp310-macosx_10_9_x86_64.whl

Download URL lsst_sphgeom-30.2026.4000-cp310-cp310-macosx_10_9_x86_64.whl
Size 645.1 kB
Tags CPython 3.10 macOS 10.9+ x86-64
SHA-256 checksum
How to use checksums
973a9db3b58608812f6cd6d3b3906e8dfdd3019407396b48e6995006e17172fd
BLAKE2b-256 checksum
How to use checksums
931ca62cebeeaea15ef0f5bc6d6ecbeba65d06ecefe18a24abe6c373cae6209f
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.13.14

Release history Release notifications | RSS feed

This release

30.2026.4000 This release

21 release files

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