Skip to main content

A spherical geometry library.

Project description

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.

Project details


Release history Release notifications | RSS feed

Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

lsst_sphgeom-30.0.5.tar.gz (162.2 kB view details)

Uploaded Source

Built Distributions

If you're not sure about the file name format, learn more about wheel file names.

lsst_sphgeom-30.0.5-cp314-cp314-manylinux_2_27_x86_64.manylinux_2_28_x86_64.whl (885.2 kB view details)

Uploaded CPython 3.14manylinux: glibc 2.27+ x86-64manylinux: glibc 2.28+ x86-64

lsst_sphgeom-30.0.5-cp314-cp314-manylinux_2_26_aarch64.manylinux_2_28_aarch64.whl (833.1 kB view details)

Uploaded CPython 3.14manylinux: glibc 2.26+ ARM64manylinux: glibc 2.28+ ARM64

lsst_sphgeom-30.0.5-cp314-cp314-macosx_11_0_arm64.whl (602.2 kB view details)

Uploaded CPython 3.14macOS 11.0+ ARM64

lsst_sphgeom-30.0.5-cp314-cp314-macosx_10_15_x86_64.whl (630.1 kB view details)

Uploaded CPython 3.14macOS 10.15+ x86-64

lsst_sphgeom-30.0.5-cp313-cp313-manylinux_2_27_x86_64.manylinux_2_28_x86_64.whl (884.0 kB view details)

Uploaded CPython 3.13manylinux: glibc 2.27+ x86-64manylinux: glibc 2.28+ x86-64

lsst_sphgeom-30.0.5-cp313-cp313-manylinux_2_26_aarch64.manylinux_2_28_aarch64.whl (829.0 kB view details)

Uploaded CPython 3.13manylinux: glibc 2.26+ ARM64manylinux: glibc 2.28+ ARM64

lsst_sphgeom-30.0.5-cp313-cp313-macosx_11_0_arm64.whl (600.9 kB view details)

Uploaded CPython 3.13macOS 11.0+ ARM64

lsst_sphgeom-30.0.5-cp313-cp313-macosx_10_13_x86_64.whl (631.3 kB view details)

Uploaded CPython 3.13macOS 10.13+ x86-64

lsst_sphgeom-30.0.5-cp312-cp312-manylinux_2_27_x86_64.manylinux_2_28_x86_64.whl (885.6 kB view details)

Uploaded CPython 3.12manylinux: glibc 2.27+ x86-64manylinux: glibc 2.28+ x86-64

lsst_sphgeom-30.0.5-cp312-cp312-manylinux_2_26_aarch64.manylinux_2_28_aarch64.whl (829.2 kB view details)

Uploaded CPython 3.12manylinux: glibc 2.26+ ARM64manylinux: glibc 2.28+ ARM64

lsst_sphgeom-30.0.5-cp312-cp312-macosx_11_0_arm64.whl (601.0 kB view details)

Uploaded CPython 3.12macOS 11.0+ ARM64

lsst_sphgeom-30.0.5-cp312-cp312-macosx_10_13_x86_64.whl (631.2 kB view details)

Uploaded CPython 3.12macOS 10.13+ x86-64

lsst_sphgeom-30.0.5-cp311-cp311-manylinux_2_27_x86_64.manylinux_2_28_x86_64.whl (886.7 kB view details)

Uploaded CPython 3.11manylinux: glibc 2.27+ x86-64manylinux: glibc 2.28+ x86-64

lsst_sphgeom-30.0.5-cp311-cp311-manylinux_2_26_aarch64.manylinux_2_28_aarch64.whl (830.3 kB view details)

Uploaded CPython 3.11manylinux: glibc 2.26+ ARM64manylinux: glibc 2.28+ ARM64

lsst_sphgeom-30.0.5-cp311-cp311-macosx_11_0_arm64.whl (595.0 kB view details)

Uploaded CPython 3.11macOS 11.0+ ARM64

lsst_sphgeom-30.0.5-cp311-cp311-macosx_10_9_x86_64.whl (618.2 kB view details)

Uploaded CPython 3.11macOS 10.9+ x86-64

lsst_sphgeom-30.0.5-cp310-cp310-manylinux_2_27_x86_64.manylinux_2_28_x86_64.whl (885.7 kB view details)

Uploaded CPython 3.10manylinux: glibc 2.27+ x86-64manylinux: glibc 2.28+ x86-64

lsst_sphgeom-30.0.5-cp310-cp310-manylinux_2_26_aarch64.manylinux_2_28_aarch64.whl (830.6 kB view details)

Uploaded CPython 3.10manylinux: glibc 2.26+ ARM64manylinux: glibc 2.28+ ARM64

lsst_sphgeom-30.0.5-cp310-cp310-macosx_11_0_arm64.whl (593.7 kB view details)

Uploaded CPython 3.10macOS 11.0+ ARM64

lsst_sphgeom-30.0.5-cp310-cp310-macosx_10_9_x86_64.whl (616.5 kB view details)

Uploaded CPython 3.10macOS 10.9+ x86-64

File details

Details for the file lsst_sphgeom-30.0.5.tar.gz.

File metadata

  • Download URL: lsst_sphgeom-30.0.5.tar.gz
  • Upload date:
  • Size: 162.2 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.13.7

File hashes

Hashes for lsst_sphgeom-30.0.5.tar.gz
Algorithm Hash digest
SHA256 6743c239a6ac9378c8887a4af1e0939d9a618f3c8fc9d2f3aa5789ef22b04de6
MD5 619257fa83d3df0a615a0acae28708f2
BLAKE2b-256 9ec4aa64d306571853bf15b48246e5228296301ce66dd42c55076f8332c0004d

See more details on using hashes here.

File details

Details for the file lsst_sphgeom-30.0.5-cp314-cp314-manylinux_2_27_x86_64.manylinux_2_28_x86_64.whl.

File metadata

File hashes

Hashes for lsst_sphgeom-30.0.5-cp314-cp314-manylinux_2_27_x86_64.manylinux_2_28_x86_64.whl
Algorithm Hash digest
SHA256 822f464a9632cd69eeefd94105a4358c0bf583a79d1350b7f7fd6b3b83ff6d28
MD5 d1c13af5da619d9cd16757c0c7a0a6d8
BLAKE2b-256 d85670b5e697ad9a1064a112b138096cfa2bb3b8e5e4028bb400d49d7f712de3

See more details on using hashes here.

File details

Details for the file lsst_sphgeom-30.0.5-cp314-cp314-manylinux_2_26_aarch64.manylinux_2_28_aarch64.whl.

File metadata

File hashes

Hashes for lsst_sphgeom-30.0.5-cp314-cp314-manylinux_2_26_aarch64.manylinux_2_28_aarch64.whl
Algorithm Hash digest
SHA256 8c8941ab96e89f022b7c75b8fe54f0b3a306c2b23595c013ab015728c8e5e029
MD5 3033031d01d558fa54514dcde5fdbdf9
BLAKE2b-256 37cb40c41f6f22a9261a8969d65cb81c1e135de7085f0168e3aa28133f1617a8

See more details on using hashes here.

File details

Details for the file lsst_sphgeom-30.0.5-cp314-cp314-macosx_11_0_arm64.whl.

File metadata

File hashes

Hashes for lsst_sphgeom-30.0.5-cp314-cp314-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 3b0c7065913a893d5e425eec9c13f3223fb85b878a9c994be3c64cd035af3ec9
MD5 fd6a30506b7894802f26e66e9134d708
BLAKE2b-256 dd60a1e1dca93cbbf614b79cc1ba7054c9abca907667290bdf0c76a834736b51

See more details on using hashes here.

File details

Details for the file lsst_sphgeom-30.0.5-cp314-cp314-macosx_10_15_x86_64.whl.

File metadata

File hashes

Hashes for lsst_sphgeom-30.0.5-cp314-cp314-macosx_10_15_x86_64.whl
Algorithm Hash digest
SHA256 91bd1c96b3937ed2a21a976f71a5eb7e8c77ff36231654ad8322c4ed841f23b5
MD5 d9b99a7f805ba8751a80978b1125e7fd
BLAKE2b-256 18f08c48651958ed754910989609b1e32559a4458211d6ed434463067cffe021

See more details on using hashes here.

File details

Details for the file lsst_sphgeom-30.0.5-cp313-cp313-manylinux_2_27_x86_64.manylinux_2_28_x86_64.whl.

File metadata

File hashes

Hashes for lsst_sphgeom-30.0.5-cp313-cp313-manylinux_2_27_x86_64.manylinux_2_28_x86_64.whl
Algorithm Hash digest
SHA256 d592071815b044a89311c3c1d9fbb1fc822b66788b5b6c83931ce955cfba6460
MD5 0fab65dfe4c8503c2685a0b1e7a0fa78
BLAKE2b-256 1ce78df892bf4d10a5d26c10e4a7e2d8d6f0fa0b251dc86447d2acf0822713a8

See more details on using hashes here.

File details

Details for the file lsst_sphgeom-30.0.5-cp313-cp313-manylinux_2_26_aarch64.manylinux_2_28_aarch64.whl.

File metadata

File hashes

Hashes for lsst_sphgeom-30.0.5-cp313-cp313-manylinux_2_26_aarch64.manylinux_2_28_aarch64.whl
Algorithm Hash digest
SHA256 5cfcdba03e2ae1a1527948aa73406b9774bd25e5e8dbc5bc28e1192240ebad27
MD5 46b97636514f716704205dc1ef941e80
BLAKE2b-256 37fe1efcbabb6dd666f0ca74ac1a72e09823fabc7e5efe084337c84c3e909636

See more details on using hashes here.

File details

Details for the file lsst_sphgeom-30.0.5-cp313-cp313-macosx_11_0_arm64.whl.

File metadata

File hashes

Hashes for lsst_sphgeom-30.0.5-cp313-cp313-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 2ab59642baeae5dfaba630e80a4e5bdd0e07ec73dbae331c76240a64fc7a57cf
MD5 e3870fdfe055970c09b850516b0f68df
BLAKE2b-256 ebe66e16d943a6aa7f3e49c735e776e37af4638dc7f46f89f63247808038022b

See more details on using hashes here.

File details

Details for the file lsst_sphgeom-30.0.5-cp313-cp313-macosx_10_13_x86_64.whl.

File metadata

File hashes

Hashes for lsst_sphgeom-30.0.5-cp313-cp313-macosx_10_13_x86_64.whl
Algorithm Hash digest
SHA256 63d8762a443d1e0e863df45a8af8cec4326f9aa9eff632477f0d62642201883c
MD5 d9fa6da5560c974400a20eec9aed34e0
BLAKE2b-256 597b9495e65454fb00e86dca39330cba91d026a16bc58517959cb64e54948110

See more details on using hashes here.

File details

Details for the file lsst_sphgeom-30.0.5-cp312-cp312-manylinux_2_27_x86_64.manylinux_2_28_x86_64.whl.

File metadata

File hashes

Hashes for lsst_sphgeom-30.0.5-cp312-cp312-manylinux_2_27_x86_64.manylinux_2_28_x86_64.whl
Algorithm Hash digest
SHA256 217911af0c36dc0e1c57b3b54eab6c3ba8083c5912923d5991eb67bd5162020a
MD5 b9c38882cd6502fbc6f61d28236d0faa
BLAKE2b-256 a907f3ff20b783383dd8954c79ac23f6047abc81cdff085aef1663ec1938d23b

See more details on using hashes here.

File details

Details for the file lsst_sphgeom-30.0.5-cp312-cp312-manylinux_2_26_aarch64.manylinux_2_28_aarch64.whl.

File metadata

File hashes

Hashes for lsst_sphgeom-30.0.5-cp312-cp312-manylinux_2_26_aarch64.manylinux_2_28_aarch64.whl
Algorithm Hash digest
SHA256 47a8aefeb6eac878739fbf82162988fdce15dff5473eb3ac4a32e2c3fc0c1970
MD5 5fb0870db77f52389372d18aa32360bd
BLAKE2b-256 5c55f9c72529e2aa8de9ce6850d6646a4ea91758bb26ef3880deb3c383288ced

See more details on using hashes here.

File details

Details for the file lsst_sphgeom-30.0.5-cp312-cp312-macosx_11_0_arm64.whl.

File metadata

File hashes

Hashes for lsst_sphgeom-30.0.5-cp312-cp312-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 b250f153901daa54265f1bd4a5ccb6b418048f8b8cd3f0d4bda393201a5c9273
MD5 3e00724f60d96b81f33a824b90fb0cc9
BLAKE2b-256 e2a53404d163b9b525d9b9f0a6faf32368a0504953de73d235d561a4d9a4b51b

See more details on using hashes here.

File details

Details for the file lsst_sphgeom-30.0.5-cp312-cp312-macosx_10_13_x86_64.whl.

File metadata

File hashes

Hashes for lsst_sphgeom-30.0.5-cp312-cp312-macosx_10_13_x86_64.whl
Algorithm Hash digest
SHA256 01b2387e6abf9c1b3fe7fbbc1f70c8f5dbe40cec28edf940f2283a8ae79fc134
MD5 0b9c9e0feaa849d0eca452ef45e95e13
BLAKE2b-256 3c6335eecb3cfde14050e5b99cfd01bfb285050fec10ecda2a82730c8127a120

See more details on using hashes here.

File details

Details for the file lsst_sphgeom-30.0.5-cp311-cp311-manylinux_2_27_x86_64.manylinux_2_28_x86_64.whl.

File metadata

File hashes

Hashes for lsst_sphgeom-30.0.5-cp311-cp311-manylinux_2_27_x86_64.manylinux_2_28_x86_64.whl
Algorithm Hash digest
SHA256 b48b0a7c1514c636413402ca11fccf06e80320101dfcab2ee11dfb98c2b73525
MD5 4ae1828bdbfbf188751939dbfeb80436
BLAKE2b-256 44716f7a16b5c673b40b754446d03489054f08724e725f6a15daf8d73f20a657

See more details on using hashes here.

File details

Details for the file lsst_sphgeom-30.0.5-cp311-cp311-manylinux_2_26_aarch64.manylinux_2_28_aarch64.whl.

File metadata

File hashes

Hashes for lsst_sphgeom-30.0.5-cp311-cp311-manylinux_2_26_aarch64.manylinux_2_28_aarch64.whl
Algorithm Hash digest
SHA256 357196719767db4c0f2dd16c6731e839fe7d7dadd1f3d2450e8a0cd87f31dd72
MD5 6ff43eb99a21626569bdf58f5645e384
BLAKE2b-256 c945fda6c6c1b27a848cf091eff302587ba6c6b404ef7aeb2c7142e64f0aa95c

See more details on using hashes here.

File details

Details for the file lsst_sphgeom-30.0.5-cp311-cp311-macosx_11_0_arm64.whl.

File metadata

File hashes

Hashes for lsst_sphgeom-30.0.5-cp311-cp311-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 abca97af4e198d2f8149f80f44d1d82a071dc4c45a714f88e6d63db42acfcbce
MD5 576624dd9c1acf370a1a4e441995aaba
BLAKE2b-256 76d60e08899bf67c41c08c738de8bfde6ac14a3c72072c89f9d2023d7a1473f2

See more details on using hashes here.

File details

Details for the file lsst_sphgeom-30.0.5-cp311-cp311-macosx_10_9_x86_64.whl.

File metadata

File hashes

Hashes for lsst_sphgeom-30.0.5-cp311-cp311-macosx_10_9_x86_64.whl
Algorithm Hash digest
SHA256 a8b9c529481bd1782dfe8f3531436697438aff64934b4e2db176bc0bb145de37
MD5 c06f81b1d5547aafc0c6ab4c4da6224c
BLAKE2b-256 f145506016fc1abbec06164930617d81863feeeb3b0623ac2c88556111bc0b1e

See more details on using hashes here.

File details

Details for the file lsst_sphgeom-30.0.5-cp310-cp310-manylinux_2_27_x86_64.manylinux_2_28_x86_64.whl.

File metadata

File hashes

Hashes for lsst_sphgeom-30.0.5-cp310-cp310-manylinux_2_27_x86_64.manylinux_2_28_x86_64.whl
Algorithm Hash digest
SHA256 7d05eff22fd1d3ad334684e5f4e55d31412bfb5148df0c872f5da2c43dff01af
MD5 e976f108e60b5b7a5dda635b9c7818bc
BLAKE2b-256 5c770f6501c8abcf41d42806dfce47caeee83f22f19add9092e95b2aad741a1a

See more details on using hashes here.

File details

Details for the file lsst_sphgeom-30.0.5-cp310-cp310-manylinux_2_26_aarch64.manylinux_2_28_aarch64.whl.

File metadata

File hashes

Hashes for lsst_sphgeom-30.0.5-cp310-cp310-manylinux_2_26_aarch64.manylinux_2_28_aarch64.whl
Algorithm Hash digest
SHA256 0884ed9aaf94ea12a1f3798117308db7971a031041a19a9eb74878cef4eb5ef9
MD5 50faa9f0ba6bca390bf0a7384442ae7d
BLAKE2b-256 638f9f6670da4f4ee4e92852d3727c07168c668afd3fe498d19a8af8f3597909

See more details on using hashes here.

File details

Details for the file lsst_sphgeom-30.0.5-cp310-cp310-macosx_11_0_arm64.whl.

File metadata

File hashes

Hashes for lsst_sphgeom-30.0.5-cp310-cp310-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 3e0db57b2aeb1f9e16b68723eda6c3d64982ec3de39ba7d1c2659803b42584db
MD5 5f2176cc2128f587868e72eadcf2c957
BLAKE2b-256 34784e2ce062928e1e4a6d06c837a4936111c791ec22821507181430067a2e83

See more details on using hashes here.

File details

Details for the file lsst_sphgeom-30.0.5-cp310-cp310-macosx_10_9_x86_64.whl.

File metadata

File hashes

Hashes for lsst_sphgeom-30.0.5-cp310-cp310-macosx_10_9_x86_64.whl
Algorithm Hash digest
SHA256 7173203141ac0f826abfb12f67de90a4c17b3bdc7d089009e2149250c117e2d3
MD5 f3b6d58c0310988964f961708c1da8ea
BLAKE2b-256 43172ad2d00b7c7860b06f0e00f87da228dcb17e2bbe1b36b061c487b50ded1d

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page