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.7.tar.gz (162.7 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.7-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.7-cp314-cp314-manylinux_2_26_aarch64.manylinux_2_28_aarch64.whl (831.7 kB view details)

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

lsst_sphgeom-30.0.7-cp314-cp314-macosx_11_0_arm64.whl (601.9 kB view details)

Uploaded CPython 3.14macOS 11.0+ ARM64

lsst_sphgeom-30.0.7-cp314-cp314-macosx_10_15_x86_64.whl (629.4 kB view details)

Uploaded CPython 3.14macOS 10.15+ x86-64

lsst_sphgeom-30.0.7-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.7-cp313-cp313-manylinux_2_26_aarch64.manylinux_2_28_aarch64.whl (829.2 kB view details)

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

lsst_sphgeom-30.0.7-cp313-cp313-macosx_11_0_arm64.whl (600.6 kB view details)

Uploaded CPython 3.13macOS 11.0+ ARM64

lsst_sphgeom-30.0.7-cp313-cp313-macosx_10_13_x86_64.whl (631.1 kB view details)

Uploaded CPython 3.13macOS 10.13+ x86-64

lsst_sphgeom-30.0.7-cp312-cp312-manylinux_2_27_x86_64.manylinux_2_28_x86_64.whl (885.0 kB view details)

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

lsst_sphgeom-30.0.7-cp312-cp312-manylinux_2_26_aarch64.manylinux_2_28_aarch64.whl (828.8 kB view details)

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

lsst_sphgeom-30.0.7-cp312-cp312-macosx_11_0_arm64.whl (600.8 kB view details)

Uploaded CPython 3.12macOS 11.0+ ARM64

lsst_sphgeom-30.0.7-cp312-cp312-macosx_10_13_x86_64.whl (630.9 kB view details)

Uploaded CPython 3.12macOS 10.13+ x86-64

lsst_sphgeom-30.0.7-cp311-cp311-manylinux_2_27_x86_64.manylinux_2_28_x86_64.whl (886.5 kB view details)

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

lsst_sphgeom-30.0.7-cp311-cp311-manylinux_2_26_aarch64.manylinux_2_28_aarch64.whl (829.2 kB view details)

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

lsst_sphgeom-30.0.7-cp311-cp311-macosx_11_0_arm64.whl (594.7 kB view details)

Uploaded CPython 3.11macOS 11.0+ ARM64

lsst_sphgeom-30.0.7-cp311-cp311-macosx_10_9_x86_64.whl (618.0 kB view details)

Uploaded CPython 3.11macOS 10.9+ x86-64

lsst_sphgeom-30.0.7-cp310-cp310-manylinux_2_27_x86_64.manylinux_2_28_x86_64.whl (885.5 kB view details)

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

lsst_sphgeom-30.0.7-cp310-cp310-manylinux_2_26_aarch64.manylinux_2_28_aarch64.whl (831.2 kB view details)

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

lsst_sphgeom-30.0.7-cp310-cp310-macosx_11_0_arm64.whl (593.5 kB view details)

Uploaded CPython 3.10macOS 11.0+ ARM64

lsst_sphgeom-30.0.7-cp310-cp310-macosx_10_9_x86_64.whl (616.3 kB view details)

Uploaded CPython 3.10macOS 10.9+ x86-64

File details

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

File metadata

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

File hashes

Hashes for lsst_sphgeom-30.0.7.tar.gz
Algorithm Hash digest
SHA256 295b18b53058b09ec75e1c4147ad89ffd3d4baf6c686a6f723926dcd61c662df
MD5 6df3e2a1c5cf2000aac42d54cbf2bd40
BLAKE2b-256 32fa0d2b7527305bf489086d1c264cbd9b92cce4f5b4a15d825fd0ddb69ec3fe

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for lsst_sphgeom-30.0.7-cp314-cp314-manylinux_2_27_x86_64.manylinux_2_28_x86_64.whl
Algorithm Hash digest
SHA256 a49b1229c9dda1670b9b6e726c6193d03e9278cc910f330d6956fbf1fcb4528a
MD5 196a201c69a4faa50bf2eff35f4d46a1
BLAKE2b-256 b8a281fd199164d95effa155ece482aa7fc32a0284a49b0369a58929c227baea

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for lsst_sphgeom-30.0.7-cp314-cp314-manylinux_2_26_aarch64.manylinux_2_28_aarch64.whl
Algorithm Hash digest
SHA256 56797802ec16099b0a075f3d5581daeb30d3c5b7d2609442a0b8a7413caa1ae1
MD5 09d2bd132f162624cf82c36e447280d2
BLAKE2b-256 091ed8d7adae774c88e9f37e11764e59311e8a558a4eef93c52bc33f013461ea

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for lsst_sphgeom-30.0.7-cp314-cp314-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 5dcdaa33bef3febbcec10ae9b64d6932ab91d0f7d8a965cf6ce4502d0955db9b
MD5 daf23207d04d4043fd900bdf2570fff0
BLAKE2b-256 1f780a91f5c52c48a0c838a1372ed2873b20f46583be38149973539da36ae60a

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for lsst_sphgeom-30.0.7-cp314-cp314-macosx_10_15_x86_64.whl
Algorithm Hash digest
SHA256 096f0c60331bc51d90093c96f07942413c4ab6315bc49d89771987bf5f26728d
MD5 ce054ecbae22ef8d13b69a4b5b153c27
BLAKE2b-256 ed4ebed169d867f74e4b3390dac92b6967c94daf52080de50aead026a72c443f

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for lsst_sphgeom-30.0.7-cp313-cp313-manylinux_2_27_x86_64.manylinux_2_28_x86_64.whl
Algorithm Hash digest
SHA256 775599d270075ce80c5e3ed9f6b0a738979e513acbf3a469c7f9cc7f6362f8c1
MD5 8ed95751ba538a6f231299417a8cbde1
BLAKE2b-256 d75150a4945feac48d3ac1a664a8090db6a316ad00d81af314dd9e61e2060791

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for lsst_sphgeom-30.0.7-cp313-cp313-manylinux_2_26_aarch64.manylinux_2_28_aarch64.whl
Algorithm Hash digest
SHA256 8080dca1b3cd2f1102ee2dfa2ab9100d30308b1a0a4a12fd345a8b65b7f613ac
MD5 ef8510026a77cf29229e63a5329c6038
BLAKE2b-256 02cc6bce67f5cf96e3035458a3723a8897d87b53aa818fb18580b384dc2b1840

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for lsst_sphgeom-30.0.7-cp313-cp313-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 ad7f81e8121bec1f8e4a2dbfadcd54830d3cd7cf18e4a27a4c5f3aecea80b2ac
MD5 44879cd1ad3207c1c252ac0d20408fc2
BLAKE2b-256 6d9c435e64f3ace6771eebdb0674f0d4959309a76229991ee18995c09a677df1

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for lsst_sphgeom-30.0.7-cp313-cp313-macosx_10_13_x86_64.whl
Algorithm Hash digest
SHA256 6503c33ccdcdb91d3482e5eb3372b745246b0ffc276f997e069f7d7cf63f7732
MD5 978bc5fefc11b26b4c535f35df2799b4
BLAKE2b-256 158e097eb1805b3800babfde94219847490ac662912bc1f8ca8c83e993ecf98f

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for lsst_sphgeom-30.0.7-cp312-cp312-manylinux_2_27_x86_64.manylinux_2_28_x86_64.whl
Algorithm Hash digest
SHA256 58d86726658ff1bc5a10ddbeabf7f53dfff192db46eb27e0c8511b4493235c62
MD5 a20c9562926b7cde2d360c2593cc4863
BLAKE2b-256 e2f6212f981d1e324742b3d05b9ef69c607f31afb38caaea726f6c33614de90a

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for lsst_sphgeom-30.0.7-cp312-cp312-manylinux_2_26_aarch64.manylinux_2_28_aarch64.whl
Algorithm Hash digest
SHA256 bd6593e828240c8fc9c0949dfe1dd05b9e07d8d7a91604d71532be9f848e2692
MD5 6788f65804fee40d3732f1614f35f7ae
BLAKE2b-256 796ce008dc48b9b410d9015a7de2142e3dfb2d07f1e9a1d10369ae4fe094650f

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for lsst_sphgeom-30.0.7-cp312-cp312-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 6300c1373a684efa5d2212cbb6ea6b500adcefd720049aeb633bffe8689c84a8
MD5 198436145c0091bc3e3af633f9be2b77
BLAKE2b-256 6f0f1fd11e594c50fa28a4cdcf6eadbcd7fd0935e55e61b43c256e4fa4857fd6

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for lsst_sphgeom-30.0.7-cp312-cp312-macosx_10_13_x86_64.whl
Algorithm Hash digest
SHA256 ceaa53caee00db0713612c83dbac328b3e14dca97df959a59ee6ff9501256e7b
MD5 61d8f916e3f120744d836e4cca7cdfac
BLAKE2b-256 42f53a2f65adbb3d7cc710b3e37470b8831c44274f1cbd5b544d149aa5a8ae3e

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for lsst_sphgeom-30.0.7-cp311-cp311-manylinux_2_27_x86_64.manylinux_2_28_x86_64.whl
Algorithm Hash digest
SHA256 e49df40db275c674ec46f4a8059b2e9e1560defdbda9b1c6d41afac847784adc
MD5 90205d60963ba7f677ad76ac581e343f
BLAKE2b-256 3d601e67257d101df9331c8e2bc3ffafbb13325826e6a1e876c0a0afdc426d09

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for lsst_sphgeom-30.0.7-cp311-cp311-manylinux_2_26_aarch64.manylinux_2_28_aarch64.whl
Algorithm Hash digest
SHA256 1390336b70c9aaab9697774e34bddda6de0b3c4f52b8f1493bfe9b777e35e691
MD5 ffbaf14295110790683911d2a332ee25
BLAKE2b-256 f566b2c8e99e25546295204f01aa96240b5c6ff8648d0380ee66f5199bcd7784

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for lsst_sphgeom-30.0.7-cp311-cp311-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 5db9d0b7e7fa3759ee7ed6d09d19299ff826e90e95304b23e7646f3e738855be
MD5 aecdb80c53b2ea9331c9acec13f9f26c
BLAKE2b-256 ac358d0a9de798c48443e425243e43c53de879298e264f3da387b366dd4723dc

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for lsst_sphgeom-30.0.7-cp311-cp311-macosx_10_9_x86_64.whl
Algorithm Hash digest
SHA256 724307d858dc7f41a091d24fce43eb9cca1c33db70150b3dccb0ee0a1b63edc7
MD5 572dd7d6d743cf178ff00872e878057b
BLAKE2b-256 b220cf0c1514d04ac6e1c7c3c251537f29521af1bb6bdf69aa9687e984313424

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for lsst_sphgeom-30.0.7-cp310-cp310-manylinux_2_27_x86_64.manylinux_2_28_x86_64.whl
Algorithm Hash digest
SHA256 25e97ab930d2820ffd73db221cfcd1c93eed213209b28e7702d30a69c4f2cb24
MD5 6426e21307856534efbceebe5eb576be
BLAKE2b-256 d216c2730dee9698f9e221ae2f32901e51e5589913e74aedf14ecd04bf2ef1c9

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for lsst_sphgeom-30.0.7-cp310-cp310-manylinux_2_26_aarch64.manylinux_2_28_aarch64.whl
Algorithm Hash digest
SHA256 90b166383ec075ecd7e3ab677efcaf3f23b3d0e06631782073f67302a364c1a7
MD5 48a7898f41466b69ff51228915c799a4
BLAKE2b-256 d7102fc77dc1b916bbdf9f7d5a1ebcc4aa2b4448fd84f42156cd74dc9553328d

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for lsst_sphgeom-30.0.7-cp310-cp310-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 6c9183bdf7469fb066cb1c9e7ceb7d78ec3040c4addf1cc00df5d923e6274837
MD5 14b56d25660d863522a9e7ea3c2f5d16
BLAKE2b-256 a1f67261a088c20592cbc3ffed95c38cbd76baf475d22e1b175b44b4f0c4ebf1

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for lsst_sphgeom-30.0.7-cp310-cp310-macosx_10_9_x86_64.whl
Algorithm Hash digest
SHA256 3ac856c3acfa55e19f113ce7acef0dda01baeaa2acbb4616ac1d6ec34a612266
MD5 7fdd4b7efa1413b2a11335567afc8a32
BLAKE2b-256 a3a01d6aa40d10c4de6f70edb5a33afef0c784611b1f0f8ea8de61b1c5e821aa

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