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 29.2.2

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

Built distributions (wheels)

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

Total release size: 12.5 MB

Release files / lsst_sphgeom-29.2.2.tar.gz

Download URL lsst_sphgeom-29.2.2.tar.gz
Size 160.9 kB
Tags Source
SHA-256 checksum
How to use checksums
1854aa56b861fb2aa0f18aa69deb4d6345cbc581419c8792d84967e0825e8ee0
BLAKE2b-256 checksum
How to use checksums
b79c07216c1de17b751e39392df07db43e087b389130c3b0d7fb53d4b6b065e4
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.2-cp313-cp313-manylinux_2_27_x86_64.manylinux_2_28_x86_64.whl

Download URL lsst_sphgeom-29.2.2-cp313-cp313-manylinux_2_27_x86_64.manylinux_2_28_x86_64.whl
Size 952.0 kB
Tags CPython 3.13 Linux glibc 2.27+ x86-64 Linux glibc 2.28+ x86-64
SHA-256 checksum
How to use checksums
8cc50d9678b8a4acbee496bf23b3a0e8a2c022592615619e440048d7be9d9bc9
BLAKE2b-256 checksum
How to use checksums
82ea4a636cf4b28b63055d34e69b3839ffc9e09f5c917fa7d50894f8f060f234
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.2-cp313-cp313-manylinux_2_26_aarch64.manylinux_2_28_aarch64.whl

Download URL lsst_sphgeom-29.2.2-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
cf3314fe4acc0a955a885ba68712013e13d85643769ad689a4f091c571184947
BLAKE2b-256 checksum
How to use checksums
49056c2e776775f21e01824ca8872499f214ccd3f139d6f480bc01b07122d61f
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.2-cp313-cp313-macosx_11_0_arm64.whl

Download URL lsst_sphgeom-29.2.2-cp313-cp313-macosx_11_0_arm64.whl
Size 620.9 kB
Tags CPython 3.13 macOS 11.0+ ARM64
SHA-256 checksum
How to use checksums
284e57a29ff95f3e6bb711f39809845a42e0212ceb2c6aac97cfbc02d9bd1b2b
BLAKE2b-256 checksum
How to use checksums
39711686e30a9c3ddaec947b5ef0566067dd1d4c517317fb270e1050570c51f3
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.2-cp313-cp313-macosx_10_13_x86_64.whl

Download URL lsst_sphgeom-29.2.2-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
5125e41841cdaafa099cc2cb2747458ce909625d9c77f065753be3f7de7da18f
BLAKE2b-256 checksum
How to use checksums
c494837947d6e7253be1d9352ce8d754027ebba4dc2eea6480a9ae122f0e685b
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.2-cp312-cp312-manylinux_2_27_x86_64.manylinux_2_28_x86_64.whl

Download URL lsst_sphgeom-29.2.2-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
6bf8093038b5c51d23b8898663bf9c3450cabc512053f47b891c761cbf587c92
BLAKE2b-256 checksum
How to use checksums
0f2b74e1994d7b4004922449931b1a1800b66f85fa1db2894044f0e6ec4cf1b2
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.2-cp312-cp312-manylinux_2_26_aarch64.manylinux_2_28_aarch64.whl

Download URL lsst_sphgeom-29.2.2-cp312-cp312-manylinux_2_26_aarch64.manylinux_2_28_aarch64.whl
Size 891.5 kB
Tags CPython 3.12 Linux glibc 2.26+ ARM64 Linux glibc 2.28+ ARM64
SHA-256 checksum
How to use checksums
64df99077036a030beed696c130f2ee09d63555e2210f474d92717366f472df4
BLAKE2b-256 checksum
How to use checksums
6ec4fd0024e9752b4223663831fa553faab90448c2e12abb9bd2d277a8be062f
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.2-cp312-cp312-macosx_11_0_arm64.whl

Download URL lsst_sphgeom-29.2.2-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
8a2dc567805336424ff40b0427f9e5e3392c0b41deb786f6710f2744ede5b089
BLAKE2b-256 checksum
How to use checksums
0e9fe05136a2c1e3ba33545e4597c3e2eeed63847887b4f6afc29842450d4d1b
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.2-cp312-cp312-macosx_10_13_x86_64.whl

Download URL lsst_sphgeom-29.2.2-cp312-cp312-macosx_10_13_x86_64.whl
Size 653.1 kB
Tags CPython 3.12 macOS 10.13+ x86-64
SHA-256 checksum
How to use checksums
4d671d010b391411e2ba433e4bee3ec0cffb7366c71fb1661b8e65ebdfd4e857
BLAKE2b-256 checksum
How to use checksums
8eccad29bff5126c0d4072dfe102f31033907025e820ca23160a9a4b8e2deb83
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.2-cp311-cp311-manylinux_2_27_x86_64.manylinux_2_28_x86_64.whl

Download URL lsst_sphgeom-29.2.2-cp311-cp311-manylinux_2_27_x86_64.manylinux_2_28_x86_64.whl
Size 932.5 kB
Tags CPython 3.11 Linux glibc 2.27+ x86-64 Linux glibc 2.28+ x86-64
SHA-256 checksum
How to use checksums
231f941146dabeebd00e5ada271e64fe03dbd081f32c80b7d96f92d2dc275a3d
BLAKE2b-256 checksum
How to use checksums
e1941cea94b80ab584d1a2e5d945861228ac6f6f3f88473672e771a13b9a5164
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.2-cp311-cp311-manylinux_2_26_aarch64.manylinux_2_28_aarch64.whl

Download URL lsst_sphgeom-29.2.2-cp311-cp311-manylinux_2_26_aarch64.manylinux_2_28_aarch64.whl
Size 885.6 kB
Tags CPython 3.11 Linux glibc 2.26+ ARM64 Linux glibc 2.28+ ARM64
SHA-256 checksum
How to use checksums
028970e775164f35a7cd51698e79c3984faee0fc792dadde42ba5467d611fdf5
BLAKE2b-256 checksum
How to use checksums
4d103da92abd835c293523b39aef6249929c8745644f27a8eca0068d4255e2be
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.2-cp311-cp311-macosx_11_0_arm64.whl

Download URL lsst_sphgeom-29.2.2-cp311-cp311-macosx_11_0_arm64.whl
Size 614.3 kB
Tags CPython 3.11 macOS 11.0+ ARM64
SHA-256 checksum
How to use checksums
08ad9bb23efbfd07ebf6d8458ad5861b11c09fc4ab3c807366e9edba5be28687
BLAKE2b-256 checksum
How to use checksums
9514e24c879ee21e110e3ec526fd68c245f67c8767b10ce7ded96e371213c577
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.2-cp311-cp311-macosx_10_9_x86_64.whl

Download URL lsst_sphgeom-29.2.2-cp311-cp311-macosx_10_9_x86_64.whl
Size 635.8 kB
Tags CPython 3.11 macOS 10.9+ x86-64
SHA-256 checksum
How to use checksums
6433800004efe688cc0686ae9deac410a710df14b9ff6ef93952ae82a5777f77
BLAKE2b-256 checksum
How to use checksums
12df9efe01acb1d9480fe2bf064da5dc20347e1c35bb214ab0331057f8c7b8bc
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.2-cp310-cp310-manylinux_2_27_x86_64.manylinux_2_28_x86_64.whl

Download URL lsst_sphgeom-29.2.2-cp310-cp310-manylinux_2_27_x86_64.manylinux_2_28_x86_64.whl
Size 930.3 kB
Tags CPython 3.10 Linux glibc 2.27+ x86-64 Linux glibc 2.28+ x86-64
SHA-256 checksum
How to use checksums
39fe7066c5c77928272009478551c3269d76fbc93231060865e12cb2b698595b
BLAKE2b-256 checksum
How to use checksums
1a885cf72bf6d894179051aeb99412b7bd52cd92aea13f7aa03c8a4ffb87f8ac
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.2-cp310-cp310-manylinux_2_26_aarch64.manylinux_2_28_aarch64.whl

Download URL lsst_sphgeom-29.2.2-cp310-cp310-manylinux_2_26_aarch64.manylinux_2_28_aarch64.whl
Size 883.6 kB
Tags CPython 3.10 Linux glibc 2.26+ ARM64 Linux glibc 2.28+ ARM64
SHA-256 checksum
How to use checksums
c2a60c33f9529abe66afd9021983588f2fbbeb70888ed0dad8262d5f890c3166
BLAKE2b-256 checksum
How to use checksums
4da33480027cf33dec3a58153440735788261c12579a3fcae0ee1cda359b769b
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.2-cp310-cp310-macosx_11_0_arm64.whl

Download URL lsst_sphgeom-29.2.2-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
e601ff6f4f2a6a17d339df64eebe78629246425596734ce0639118a616bbdb56
BLAKE2b-256 checksum
How to use checksums
dac6e715945f4c3d38fdec7d217a3999f9ad25bfc4a61234ce6c3751d8532174
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.2-cp310-cp310-macosx_10_9_x86_64.whl

Download URL lsst_sphgeom-29.2.2-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
6fc62e6f685a94b6b079d6519e254fab4499b5118a13d1829d76c9711d82e0af
BLAKE2b-256 checksum
How to use checksums
cc22789144fe90851735e9519980b282600ff0200eb0e600507ef13687d3c089
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.2

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

29.2.2 This release

17 release files No provenance

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