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.0a20224200

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.0a20224200
File Size Uploaded Provenance
lsst-sphgeom-25.0.0a20224200.tar.gz 129.3 kB Without provenance Details

Built distributions (wheels)

Table of built distributions (wheels) for lsst-sphgeom 25.0.0a20224200
File
lsst_sphgeom-25.0.0a20224200-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.0a20224200-cp310-cp310-macosx_11_0_arm64.whl CPython 3.10 CPython 3.10 macOS 11.0+ ARM64 Details
lsst_sphgeom-25.0.0a20224200-cp310-cp310-macosx_10_9_x86_64.whl CPython 3.10 CPython 3.10 macOS 10.9+ x86-64 Details
lsst_sphgeom-25.0.0a20224200-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.0a20224200-cp39-cp39-macosx_11_0_arm64.whl CPython 3.9 CPython 3.9 macOS 11.0+ ARM64 Details
lsst_sphgeom-25.0.0a20224200-cp39-cp39-macosx_10_9_x86_64.whl CPython 3.9 CPython 3.9 macOS 10.9+ x86-64 Details
lsst_sphgeom-25.0.0a20224200-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.0a20224200-cp38-cp38-macosx_11_0_arm64.whl CPython 3.8 CPython 3.8 macOS 11.0+ ARM64 Details
lsst_sphgeom-25.0.0a20224200-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.0a20224200.tar.gz

Download URL lsst-sphgeom-25.0.0a20224200.tar.gz
Size 129.3 kB
Tags Source
SHA-256 checksum
How to use checksums
92d7e9eaca04690af1988054c2c959191d3ed41dcf03ae9c321d98a94a7224ec
BLAKE2b-256 checksum
How to use checksums
76fc51013f1467b3877d8260d40094f452474bb797ddac3c27ee71bef5266d05
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/4.0.1 CPython/3.9.14

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

Download URL lsst_sphgeom-25.0.0a20224200-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Size 652.6 kB
Tags CPython 3.10 Linux glibc 2.17+ x86-64
SHA-256 checksum
How to use checksums
86fe4389e993d1392f8007abcce0e0174a4959c4b59a1e48e8afb994e54e9ed6
BLAKE2b-256 checksum
How to use checksums
e7bc1d47b40a0e465d823d25946401f17279cc7151125e25a2cef17f48f7a19c
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/4.0.1 CPython/3.9.14

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

Download URL lsst_sphgeom-25.0.0a20224200-cp310-cp310-macosx_11_0_arm64.whl
Size 495.4 kB
Tags CPython 3.10 macOS 11.0+ ARM64
SHA-256 checksum
How to use checksums
df496277178bdc83e10fc4c1d24a6c4fd4bfda9dc42e6d6e0c56ae0551496df5
BLAKE2b-256 checksum
How to use checksums
8fe5b3d20057d847d8a647876d81ffa608bf18e6d22a3bd99ce50d1cf67a06b2
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/4.0.1 CPython/3.9.14

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

Download URL lsst_sphgeom-25.0.0a20224200-cp310-cp310-macosx_10_9_x86_64.whl
Size 516.5 kB
Tags CPython 3.10 macOS 10.9+ x86-64
SHA-256 checksum
How to use checksums
a3d64e3097c40c204177eca5f168c3b2681b97fa43f9727f4a5779c7ab980717
BLAKE2b-256 checksum
How to use checksums
fb96d171f696203ab482fd33dad84040a3295887377807bd396f17e271f4823d
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/4.0.1 CPython/3.9.14

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

Download URL lsst_sphgeom-25.0.0a20224200-cp39-cp39-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Size 656.6 kB
Tags CPython 3.9 Linux glibc 2.17+ x86-64
SHA-256 checksum
How to use checksums
735d550bc17c67bf3df55e77ca60bcac93979e88bc8dd805a89b678af5a2d9d0
BLAKE2b-256 checksum
How to use checksums
55744eac7f2ec5b956694bfc0fedd42c85140616e36d4752272ce2919d02900c
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/4.0.1 CPython/3.9.14

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

Download URL lsst_sphgeom-25.0.0a20224200-cp39-cp39-macosx_11_0_arm64.whl
Size 495.4 kB
Tags CPython 3.9 macOS 11.0+ ARM64
SHA-256 checksum
How to use checksums
7496ea5fe09911c83a81f8d787305cdc13b34769840af4743eb40daf5af838fe
BLAKE2b-256 checksum
How to use checksums
a7d222349625d2b4e43bd0597abe81e343a7a34288b28101a12e2af9f1e9f77e
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/4.0.1 CPython/3.9.14

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

Download URL lsst_sphgeom-25.0.0a20224200-cp39-cp39-macosx_10_9_x86_64.whl
Size 516.7 kB
Tags CPython 3.9 macOS 10.9+ x86-64
SHA-256 checksum
How to use checksums
1d9f42c2414cdba84e5bcc57e4963b5243cad55885671d6446957d26d9d0297d
BLAKE2b-256 checksum
How to use checksums
93147e56690faada2dad762f826d876baf375c3454fb1a772ddc2627aa675e10
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/4.0.1 CPython/3.9.14

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

Download URL lsst_sphgeom-25.0.0a20224200-cp38-cp38-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Size 652.7 kB
Tags CPython 3.8 Linux glibc 2.17+ x86-64
SHA-256 checksum
How to use checksums
2bd941ba000e85015d2e20b19a74245373ad2dc4d3e62dc83a83a61a2643e70b
BLAKE2b-256 checksum
How to use checksums
5617a8e7f9df787a6ad0d7d8f085e75a585f13180f99eebfaa2643fe47c8ad79
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/4.0.1 CPython/3.9.14

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

Download URL lsst_sphgeom-25.0.0a20224200-cp38-cp38-macosx_11_0_arm64.whl
Size 495.3 kB
Tags CPython 3.8 macOS 11.0+ ARM64
SHA-256 checksum
How to use checksums
f49ea6b7ce9693dfdf84b6023ce451675eeece2c4f042da2ab7095f1adbcf78c
BLAKE2b-256 checksum
How to use checksums
39c297a16be650da00ada11d2c283dee1f53cd21ff82ddc43ebd6f05da4dfb7f
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/4.0.1 CPython/3.9.14

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

Download URL lsst_sphgeom-25.0.0a20224200-cp38-cp38-macosx_10_9_x86_64.whl
Size 516.4 kB
Tags CPython 3.8 macOS 10.9+ x86-64
SHA-256 checksum
How to use checksums
12e195c853cbfed3190eab538ad97e0113d2b8c8ed336e3e5255bc00229dc74c
BLAKE2b-256 checksum
How to use checksums
2e4893886a9783a5d3a604559f03b4709695f9549a7043fc4e063ecb49134a1b
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/4.0.1 CPython/3.9.14

Security for lsst-sphgeom 25.0.0a20224200

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