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

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

Built distributions (wheels)

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

Download URL lsst-sphgeom-25.0.0a20224400.tar.gz
Size 129.3 kB
Tags Source
SHA-256 checksum
How to use checksums
2e0068c49e3d4b0f4d1a70eab3b07031d64982a06e01e942c28791f69814480f
BLAKE2b-256 checksum
How to use checksums
d96371431a107daa3d74d31ae6c801136f537bc5047bf58a12128e6281ee2d96
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.0a20224400-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.whl

Download URL lsst_sphgeom-25.0.0a20224400-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Size 652.5 kB
Tags CPython 3.10 Linux glibc 2.17+ x86-64
SHA-256 checksum
How to use checksums
18b39a190c88b1f0bd6901f2500c2ef1cd792fd0257a65234bba9117d3d40f51
BLAKE2b-256 checksum
How to use checksums
fdd84e01543130df4708120bc11d1a8f17db98c6821a97d432eb8220f0e321f9
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.0a20224400-cp310-cp310-macosx_11_0_arm64.whl

Download URL lsst_sphgeom-25.0.0a20224400-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
a2aead033758e4572405582dac781be240d57b9425d17f17fcb5439e942df793
BLAKE2b-256 checksum
How to use checksums
cac5974c9cda9b532dda0ae038940a20ea83de3083ff48df532c9a6d94028c47
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.0a20224400-cp310-cp310-macosx_10_9_x86_64.whl

Download URL lsst_sphgeom-25.0.0a20224400-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
f1a140faaa65dfdf99650a1dcf743165977fa5a8d6f76a38ebe50a3c13c3de90
BLAKE2b-256 checksum
How to use checksums
66a94df428b5c5fac8da1e4f09c26a738adab61af27a985db43a3a67f382cb56
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.0a20224400-cp39-cp39-manylinux_2_17_x86_64.manylinux2014_x86_64.whl

Download URL lsst_sphgeom-25.0.0a20224400-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
31901ca734fd7d80a04cf8d41767942fa132ee68e949441d6d8e39960c2f9e7e
BLAKE2b-256 checksum
How to use checksums
bdca716695cc61e0a3e21a55b2668123595303b4c13ac7d5b5f41ea8832e0239
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.0a20224400-cp39-cp39-macosx_11_0_arm64.whl

Download URL lsst_sphgeom-25.0.0a20224400-cp39-cp39-macosx_11_0_arm64.whl
Size 495.6 kB
Tags CPython 3.9 macOS 11.0+ ARM64
SHA-256 checksum
How to use checksums
f688ab455e868a8b26906a7b053d5031e79953d00ab4fd9bb8729aa5f13c9eab
BLAKE2b-256 checksum
How to use checksums
a6e648473959811c66a8e7827e2d0bf069ce872ca9b0d369e589fec2d7c631e8
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.0a20224400-cp39-cp39-macosx_10_9_x86_64.whl

Download URL lsst_sphgeom-25.0.0a20224400-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
22c250956cb10755919b1a89cec20bf66b80d85471a57223ce35232da7d84888
BLAKE2b-256 checksum
How to use checksums
f96ebb5e69501c91d630dec975a62f856c216d6b12f17425dfe433a78fe3b3c3
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.0a20224400-cp38-cp38-manylinux_2_17_x86_64.manylinux2014_x86_64.whl

Download URL lsst_sphgeom-25.0.0a20224400-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
66e1bb2f16dbdc95a55eabb319da6c1932141309cceecdea6384f88b97a2a71d
BLAKE2b-256 checksum
How to use checksums
c56b80457ec362b36584247d9a6465c4ea4794c20335b677ae15519198204d7d
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.0a20224400-cp38-cp38-macosx_11_0_arm64.whl

Download URL lsst_sphgeom-25.0.0a20224400-cp38-cp38-macosx_11_0_arm64.whl
Size 495.4 kB
Tags CPython 3.8 macOS 11.0+ ARM64
SHA-256 checksum
How to use checksums
0831d873d2a56c315fa4d8124e6de238c7f24daf419f4b36823af528b8e0b277
BLAKE2b-256 checksum
How to use checksums
9b51966c1dc78f0f10087fd8c2ce977815dad1733958e60d5f92653e8a539632
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.0a20224400-cp38-cp38-macosx_10_9_x86_64.whl

Download URL lsst_sphgeom-25.0.0a20224400-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
b3b12779637b006d626d3c72d8e8b8fbb1f031fbd8b39957677851f90c56484f
BLAKE2b-256 checksum
How to use checksums
235d343c3ca5fb469e0c2552e152fd8a45e0bb675e62f32942c52b3548274c08
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.0a20224400

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