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

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

Built distributions (wheels)

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

Download URL lsst-sphgeom-25.0.0a20225000.tar.gz
Size 129.2 kB
Tags Source
SHA-256 checksum
How to use checksums
edb02cbc9b8582ea8f1d2094ccca257eec1be11a73362f27f69c739cc70af13e
BLAKE2b-256 checksum
How to use checksums
d51e452aa4d79d64bf25c0d17a19b821f8611d6fc0091704299487c572a98090
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/4.0.1 CPython/3.11.1

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

Download URL lsst_sphgeom-25.0.0a20225000-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Size 659.2 kB
Tags CPython 3.10 Linux glibc 2.17+ x86-64
SHA-256 checksum
How to use checksums
f21d77f7fc0c5b6775a58810e69882472cbe51fb8641414742e64e1c9e1f9668
BLAKE2b-256 checksum
How to use checksums
9e2f39035a111717f18097ba8b0c5b059d67ca2abac2f081cfa9db3d084c0630
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/4.0.1 CPython/3.11.1

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

Download URL lsst_sphgeom-25.0.0a20225000-cp310-cp310-macosx_11_0_arm64.whl
Size 491.7 kB
Tags CPython 3.10 macOS 11.0+ ARM64
SHA-256 checksum
How to use checksums
3179979fd6cf48b08135e6c3662071c002de256c4d51793da95b55a6a4004a23
BLAKE2b-256 checksum
How to use checksums
36516efb2d9320393a96b794edbf2b40e5f84f0e12ec2a424ff1d725341e47aa
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/4.0.1 CPython/3.11.1

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

Download URL lsst_sphgeom-25.0.0a20225000-cp310-cp310-macosx_10_9_x86_64.whl
Size 513.2 kB
Tags CPython 3.10 macOS 10.9+ x86-64
SHA-256 checksum
How to use checksums
1148e3f0c350d0b2c47afb7e8634baf9242f5241b17981d83942f3b04d72406f
BLAKE2b-256 checksum
How to use checksums
5d35724aeb588232a89b1a4741bf28f851645ea7637c45e4d2d44bed684c93cd
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/4.0.1 CPython/3.11.1

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

Download URL lsst_sphgeom-25.0.0a20225000-cp39-cp39-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Size 666.6 kB
Tags CPython 3.9 Linux glibc 2.17+ x86-64
SHA-256 checksum
How to use checksums
3fbea11921f016720469c4fabb590a3f9b3b3446cf3becc5225979af2a340021
BLAKE2b-256 checksum
How to use checksums
33e4035e64f8d6f235165d3796663683dc4834c4807483bcd53b1cddf0a44617
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/4.0.1 CPython/3.11.1

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

Download URL lsst_sphgeom-25.0.0a20225000-cp39-cp39-macosx_11_0_arm64.whl
Size 491.7 kB
Tags CPython 3.9 macOS 11.0+ ARM64
SHA-256 checksum
How to use checksums
1478c162b88fdbe5ac49130f6a2dfa98de482f49a285f0a0aa832c87353c2950
BLAKE2b-256 checksum
How to use checksums
76edfaa06feb60bf08fb24c252d930d56beb3a2f7bb5ac18be8ef08a93fa345d
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/4.0.1 CPython/3.11.1

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

Download URL lsst_sphgeom-25.0.0a20225000-cp39-cp39-macosx_10_9_x86_64.whl
Size 513.4 kB
Tags CPython 3.9 macOS 10.9+ x86-64
SHA-256 checksum
How to use checksums
a4f56565915950981e0d310aaf6588ada2b3fba4b87e69ba81259df4cca22f40
BLAKE2b-256 checksum
How to use checksums
095754811577f5493aba9a7602e42a2e08ffd27d4de79d5e43c4e9c5de97014b
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/4.0.1 CPython/3.11.1

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

Download URL lsst_sphgeom-25.0.0a20225000-cp38-cp38-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Size 659.8 kB
Tags CPython 3.8 Linux glibc 2.17+ x86-64
SHA-256 checksum
How to use checksums
86e4ea40e9c5eb23ffb40fabf5fd56678b1b7ed0672e4a43843d6019ae0e3350
BLAKE2b-256 checksum
How to use checksums
edde89976ac1d284b0abb78566e775e37fcbbc57dd7cc9f14f3945835a9c943f
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/4.0.1 CPython/3.11.1

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

Download URL lsst_sphgeom-25.0.0a20225000-cp38-cp38-macosx_11_0_arm64.whl
Size 491.7 kB
Tags CPython 3.8 macOS 11.0+ ARM64
SHA-256 checksum
How to use checksums
b7907c22245000f8dffdea921dce4f00e3d37e9fc297506dc3423290ac10a657
BLAKE2b-256 checksum
How to use checksums
2f28d312f0b8c1fadbf3766485ca99d5f8502b32734f85210f9ccce5780dbe52
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/4.0.1 CPython/3.11.1

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

Download URL lsst_sphgeom-25.0.0a20225000-cp38-cp38-macosx_10_9_x86_64.whl
Size 513.2 kB
Tags CPython 3.8 macOS 10.9+ x86-64
SHA-256 checksum
How to use checksums
11d62460c7c754bb314f1e63ca070f608169ef046b880d5039acc159ff787cf4
BLAKE2b-256 checksum
How to use checksums
b165704d0a557a69b4876f37d1078f0446b0f31b7fa063803f4d01c7891e264a
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/4.0.1 CPython/3.11.1

Security for lsst-sphgeom 25.0.0a20225000

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