h3v 0.1.1__tar.gz

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (50) hide show
  1. h3v-0.1.1/.github/workflows/docs-pages.yml +42 -0
  2. h3v-0.1.1/.github/workflows/tests.yml +61 -0
  3. h3v-0.1.1/CHANGELOG.md +27 -0
  4. h3v-0.1.1/LICENSE +202 -0
  5. h3v-0.1.1/MANIFEST.in +6 -0
  6. h3v-0.1.1/NOTICE +10 -0
  7. h3v-0.1.1/PKG-INFO +100 -0
  8. h3v-0.1.1/README.md +79 -0
  9. h3v-0.1.1/docs/_static/voxel.svg +18 -0
  10. h3v-0.1.1/docs/api_quick.md +131 -0
  11. h3v-0.1.1/docs/api_reference.md +193 -0
  12. h3v-0.1.1/docs/concepts.md +188 -0
  13. h3v-0.1.1/docs/conf.py +38 -0
  14. h3v-0.1.1/docs/contributing.md +188 -0
  15. h3v-0.1.1/docs/documentation_guidelines.md +141 -0
  16. h3v-0.1.1/docs/format.md +394 -0
  17. h3v-0.1.1/docs/index.md +148 -0
  18. h3v-0.1.1/docs/usage.md +493 -0
  19. h3v-0.1.1/pyproject.toml +43 -0
  20. h3v-0.1.1/setup.cfg +4 -0
  21. h3v-0.1.1/src/_h3v_core.py +196 -0
  22. h3v-0.1.1/src/h3v.egg-info/PKG-INFO +100 -0
  23. h3v-0.1.1/src/h3v.egg-info/SOURCES.txt +48 -0
  24. h3v-0.1.1/src/h3v.egg-info/dependency_links.txt +1 -0
  25. h3v-0.1.1/src/h3v.egg-info/requires.txt +6 -0
  26. h3v-0.1.1/src/h3v.egg-info/top_level.txt +11 -0
  27. h3v-0.1.1/src/h3v.py +66 -0
  28. h3v-0.1.1/src/h3v_directed_edges.py +219 -0
  29. h3v-0.1.1/src/h3v_geometry.py +478 -0
  30. h3v-0.1.1/src/h3v_hierarchy.py +142 -0
  31. h3v-0.1.1/src/h3v_indexing.py +442 -0
  32. h3v-0.1.1/src/h3v_inspection.py +194 -0
  33. h3v-0.1.1/src/h3v_miscellaneous.py +54 -0
  34. h3v-0.1.1/src/h3v_regions.py +4 -0
  35. h3v-0.1.1/src/h3v_traversal.py +154 -0
  36. h3v-0.1.1/src/h3v_vertexes.py +4 -0
  37. h3v-0.1.1/tests/test_core.py +670 -0
  38. h3v-0.1.1/tests/test_directed_edges.py +127 -0
  39. h3v-0.1.1/tests/test_ecef.py +115 -0
  40. h3v-0.1.1/tests/test_format.py +156 -0
  41. h3v-0.1.1/tests/test_great_circle.py +103 -0
  42. h3v-0.1.1/tests/test_lines.py +290 -0
  43. h3v-0.1.1/tests/test_module_layout.py +80 -0
  44. h3v-0.1.1/tests/test_signed.py +178 -0
  45. h3v-0.1.1/tests/test_traversal.py +105 -0
  46. h3v-0.1.1/tests/test_vectors.py +99 -0
  47. h3v-0.1.1/tests/test_visibility.py +129 -0
  48. h3v-0.1.1/tools/check_release.py +81 -0
  49. h3v-0.1.1/tools/export_preview.py +70 -0
  50. h3v-0.1.1/tools/function_test_report.py +219 -0
@@ -0,0 +1,42 @@
1
+ name: Publish documentation
2
+
3
+ on:
4
+ workflow_dispatch:
5
+
6
+ permissions:
7
+ contents: read
8
+
9
+ concurrency:
10
+ group: github-pages
11
+ cancel-in-progress: false
12
+
13
+ jobs:
14
+ build:
15
+ if: github.ref == 'refs/heads/main'
16
+ runs-on: ubuntu-latest
17
+ steps:
18
+ - uses: actions/checkout@v6
19
+ - uses: actions/setup-python@v6
20
+ with:
21
+ python-version: '3.12'
22
+ - run: python -m pip install -e ".[docs]"
23
+ - run: python -m sphinx -b html -n -W --keep-going docs docs/_build/html
24
+ - run: python -m sphinx -b doctest -n -W --keep-going docs docs/_build/doctest
25
+ - uses: actions/configure-pages@v5
26
+ - uses: actions/upload-pages-artifact@v3
27
+ with:
28
+ path: docs/_build/html
29
+
30
+ deploy:
31
+ needs: build
32
+ runs-on: ubuntu-latest
33
+ permissions:
34
+ pages: write
35
+ id-token: write
36
+ environment:
37
+ name: github-pages
38
+ url: ${{ steps.deployment.outputs.page_url }}
39
+ steps:
40
+ - name: Deploy documentation
41
+ id: deployment
42
+ uses: actions/deploy-pages@v4
@@ -0,0 +1,61 @@
1
+ name: Tests
2
+
3
+ on:
4
+ push:
5
+ branches: [main]
6
+ tags: ['v*']
7
+ pull_request:
8
+ workflow_dispatch:
9
+
10
+ permissions:
11
+ contents: read
12
+
13
+ jobs:
14
+ test:
15
+ name: Python ${{ matrix.python }} / ${{ matrix.os }}
16
+ runs-on: ${{ matrix.os }}
17
+ strategy:
18
+ fail-fast: false
19
+ matrix:
20
+ os: [ubuntu-latest, windows-latest]
21
+ python: ['3.10', '3.12', '3.14']
22
+ steps:
23
+ - uses: actions/checkout@v6
24
+ - uses: actions/setup-python@v6
25
+ with:
26
+ python-version: ${{ matrix.python }}
27
+ - name: Install the packaged library
28
+ run: |
29
+ python -m pip install --upgrade pip
30
+ python -m pip install build twine
31
+ python -m build --outdir build/release
32
+ python -m twine check --strict build/release/*
33
+ python -c "import pathlib, subprocess, sys; wheel, = pathlib.Path('build/release').glob('*.whl'); subprocess.check_call([sys.executable, '-m', 'pip', 'install', str(wheel)])"
34
+ python -m pip check
35
+ - name: Check release contents and installed README examples
36
+ run: python -I tools/check_release.py build/release
37
+ - name: Run core tests
38
+ run: python -m unittest discover -s tests -v
39
+ - name: Check release tag matches package version
40
+ if: startsWith(github.ref, 'refs/tags/')
41
+ run: python -c "import os, importlib.metadata; tag = os.environ['GITHUB_REF_NAME']; version = importlib.metadata.version('h3v'); assert tag == 'v' + version, (tag, version)"
42
+
43
+ docs:
44
+ name: Documentation
45
+ runs-on: ubuntu-latest
46
+ steps:
47
+ - uses: actions/checkout@v6
48
+ - uses: actions/setup-python@v6
49
+ with:
50
+ python-version: '3.12'
51
+ - name: Install documentation dependencies
52
+ run: python -m pip install -e ".[docs]"
53
+ - name: Build documentation with warnings treated as errors
54
+ run: python -m sphinx -b html -n -W --keep-going docs docs/_build/html
55
+ - name: Test documentation examples
56
+ run: python -m sphinx -b doctest -n -W --keep-going docs docs/_build/doctest
57
+ - name: Save rendered documentation for review
58
+ uses: actions/upload-artifact@v4
59
+ with:
60
+ name: documentation-html
61
+ path: docs/_build/html
h3v-0.1.1/CHANGELOG.md ADDED
@@ -0,0 +1,27 @@
1
+ # Changelog
2
+
3
+ ## 0.1.1 - Publication corrections
4
+
5
+ - Lead package documentation with installation from PyPI and a first example.
6
+ - Use absolute public documentation and license links in the PyPI description.
7
+ - Keep encoding details and contributor build commands out of the README.
8
+ - Include documentation, tests, and release tools in source distributions.
9
+ - Check wheel/sdist consistency, metadata rendering, and installed README examples in CI.
10
+ - Save rendered documentation in CI and add a manual GitHub Pages deployment workflow.
11
+ - Describe the first published index format using its fixed header marker,
12
+ without development-era format numbering. Serialized IDs remain unchanged.
13
+
14
+ ## 0.1.0 - Experimental preview
15
+
16
+ First preview of H3V's 128-bit volumetric indexing and spherical geometry API.
17
+
18
+ - Independent H3 surface and radial resolutions with exact altitude intervals.
19
+ - Geographic and ECEF coordinate indexing and voxel-center decoding.
20
+ - Horizontal grid traversal, hierarchy, and directed edges.
21
+ - Voxel volumes, chord geometry, ECEF vectors, great-circle arcs, and visibility caps.
22
+ - Kilometres, cubic kilometres, and degrees as the public defaults.
23
+ - H3 4.5.0 dependency and Apache License 2.0.
24
+
25
+ This is an experimental preview. Public API and serialized-index compatibility
26
+ are not yet guaranteed. Record the H3V package version alongside persisted
27
+ voxel IDs.
h3v-0.1.1/LICENSE ADDED
@@ -0,0 +1,202 @@
1
+
2
+ Apache License
3
+ Version 2.0, January 2004
4
+ http://www.apache.org/licenses/
5
+
6
+ TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
7
+
8
+ 1. Definitions.
9
+
10
+ "License" shall mean the terms and conditions for use, reproduction,
11
+ and distribution as defined by Sections 1 through 9 of this document.
12
+
13
+ "Licensor" shall mean the copyright owner or entity authorized by
14
+ the copyright owner that is granting the License.
15
+
16
+ "Legal Entity" shall mean the union of the acting entity and all
17
+ other entities that control, are controlled by, or are under common
18
+ control with that entity. For the purposes of this definition,
19
+ "control" means (i) the power, direct or indirect, to cause the
20
+ direction or management of such entity, whether by contract or
21
+ otherwise, or (ii) ownership of fifty percent (50%) or more of the
22
+ outstanding shares, or (iii) beneficial ownership of such entity.
23
+
24
+ "You" (or "Your") shall mean an individual or Legal Entity
25
+ exercising permissions granted by this License.
26
+
27
+ "Source" form shall mean the preferred form for making modifications,
28
+ including but not limited to software source code, documentation
29
+ source, and configuration files.
30
+
31
+ "Object" form shall mean any form resulting from mechanical
32
+ transformation or translation of a Source form, including but
33
+ not limited to compiled object code, generated documentation,
34
+ and conversions to other media types.
35
+
36
+ "Work" shall mean the work of authorship, whether in Source or
37
+ Object form, made available under the License, as indicated by a
38
+ copyright notice that is included in or attached to the work
39
+ (an example is provided in the Appendix below).
40
+
41
+ "Derivative Works" shall mean any work, whether in Source or Object
42
+ form, that is based on (or derived from) the Work and for which the
43
+ editorial revisions, annotations, elaborations, or other modifications
44
+ represent, as a whole, an original work of authorship. For the purposes
45
+ of this License, Derivative Works shall not include works that remain
46
+ separable from, or merely link (or bind by name) to the interfaces of,
47
+ the Work and Derivative Works thereof.
48
+
49
+ "Contribution" shall mean any work of authorship, including
50
+ the original version of the Work and any modifications or additions
51
+ to that Work or Derivative Works thereof, that is intentionally
52
+ submitted to Licensor for inclusion in the Work by the copyright owner
53
+ or by an individual or Legal Entity authorized to submit on behalf of
54
+ the copyright owner. For the purposes of this definition, "submitted"
55
+ means any form of electronic, verbal, or written communication sent
56
+ to the Licensor or its representatives, including but not limited to
57
+ communication on electronic mailing lists, source code control systems,
58
+ and issue tracking systems that are managed by, or on behalf of, the
59
+ Licensor for the purpose of discussing and improving the Work, but
60
+ excluding communication that is conspicuously marked or otherwise
61
+ designated in writing by the copyright owner as "Not a Contribution."
62
+
63
+ "Contributor" shall mean Licensor and any individual or Legal Entity
64
+ on behalf of whom a Contribution has been received by Licensor and
65
+ subsequently incorporated within the Work.
66
+
67
+ 2. Grant of Copyright License. Subject to the terms and conditions of
68
+ this License, each Contributor hereby grants to You a perpetual,
69
+ worldwide, non-exclusive, no-charge, royalty-free, irrevocable
70
+ copyright license to reproduce, prepare Derivative Works of,
71
+ publicly display, publicly perform, sublicense, and distribute the
72
+ Work and such Derivative Works in Source or Object form.
73
+
74
+ 3. Grant of Patent License. Subject to the terms and conditions of
75
+ this License, each Contributor hereby grants to You a perpetual,
76
+ worldwide, non-exclusive, no-charge, royalty-free, irrevocable
77
+ (except as stated in this section) patent license to make, have made,
78
+ use, offer to sell, sell, import, and otherwise transfer the Work,
79
+ where such license applies only to those patent claims licensable
80
+ by such Contributor that are necessarily infringed by their
81
+ Contribution(s) alone or by combination of their Contribution(s)
82
+ with the Work to which such Contribution(s) was submitted. If You
83
+ institute patent litigation against any entity (including a
84
+ cross-claim or counterclaim in a lawsuit) alleging that the Work
85
+ or a Contribution incorporated within the Work constitutes direct
86
+ or contributory patent infringement, then any patent licenses
87
+ granted to You under this License for that Work shall terminate
88
+ as of the date such litigation is filed.
89
+
90
+ 4. Redistribution. You may reproduce and distribute copies of the
91
+ Work or Derivative Works thereof in any medium, with or without
92
+ modifications, and in Source or Object form, provided that You
93
+ meet the following conditions:
94
+
95
+ (a) You must give any other recipients of the Work or
96
+ Derivative Works a copy of this License; and
97
+
98
+ (b) You must cause any modified files to carry prominent notices
99
+ stating that You changed the files; and
100
+
101
+ (c) You must retain, in the Source form of any Derivative Works
102
+ that You distribute, all copyright, patent, trademark, and
103
+ attribution notices from the Source form of the Work,
104
+ excluding those notices that do not pertain to any part of
105
+ the Derivative Works; and
106
+
107
+ (d) If the Work includes a "NOTICE" text file as part of its
108
+ distribution, then any Derivative Works that You distribute must
109
+ include a readable copy of the attribution notices contained
110
+ within such NOTICE file, excluding those notices that do not
111
+ pertain to any part of the Derivative Works, in at least one
112
+ of the following places: within a NOTICE text file distributed
113
+ as part of the Derivative Works; within the Source form or
114
+ documentation, if provided along with the Derivative Works; or,
115
+ within a display generated by the Derivative Works, if and
116
+ wherever such third-party notices normally appear. The contents
117
+ of the NOTICE file are for informational purposes only and
118
+ do not modify the License. You may add Your own attribution
119
+ notices within Derivative Works that You distribute, alongside
120
+ or as an addendum to the NOTICE text from the Work, provided
121
+ that such additional attribution notices cannot be construed
122
+ as modifying the License.
123
+
124
+ You may add Your own copyright statement to Your modifications and
125
+ may provide additional or different license terms and conditions
126
+ for use, reproduction, or distribution of Your modifications, or
127
+ for any such Derivative Works as a whole, provided Your use,
128
+ reproduction, and distribution of the Work otherwise complies with
129
+ the conditions stated in this License.
130
+
131
+ 5. Submission of Contributions. Unless You explicitly state otherwise,
132
+ any Contribution intentionally submitted for inclusion in the Work
133
+ by You to the Licensor shall be under the terms and conditions of
134
+ this License, without any additional terms or conditions.
135
+ Notwithstanding the above, nothing herein shall supersede or modify
136
+ the terms of any separate license agreement you may have executed
137
+ with Licensor regarding such Contributions.
138
+
139
+ 6. Trademarks. This License does not grant permission to use the trade
140
+ names, trademarks, service marks, or product names of the Licensor,
141
+ except as required for reasonable and customary use in describing the
142
+ origin of the Work and reproducing the content of the NOTICE file.
143
+
144
+ 7. Disclaimer of Warranty. Unless required by applicable law or
145
+ agreed to in writing, Licensor provides the Work (and each
146
+ Contributor provides its Contributions) on an "AS IS" BASIS,
147
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
148
+ implied, including, without limitation, any warranties or conditions
149
+ of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
150
+ PARTICULAR PURPOSE. You are solely responsible for determining the
151
+ appropriateness of using or redistributing the Work and assume any
152
+ risks associated with Your exercise of permissions under this License.
153
+
154
+ 8. Limitation of Liability. In no event and under no legal theory,
155
+ whether in tort (including negligence), contract, or otherwise,
156
+ unless required by applicable law (such as deliberate and grossly
157
+ negligent acts) or agreed to in writing, shall any Contributor be
158
+ liable to You for damages, including any direct, indirect, special,
159
+ incidental, or consequential damages of any character arising as a
160
+ result of this License or out of the use or inability to use the
161
+ Work (including but not limited to damages for loss of goodwill,
162
+ work stoppage, computer failure or malfunction, or any and all
163
+ other commercial damages or losses), even if such Contributor
164
+ has been advised of the possibility of such damages.
165
+
166
+ 9. Accepting Warranty or Additional Liability. While redistributing
167
+ the Work or Derivative Works thereof, You may choose to offer,
168
+ and charge a fee for, acceptance of support, warranty, indemnity,
169
+ or other liability obligations and/or rights consistent with this
170
+ License. However, in accepting such obligations, You may act only
171
+ on Your own behalf and on Your sole responsibility, not on behalf
172
+ of any other Contributor, and only if You agree to indemnify,
173
+ defend, and hold each Contributor harmless for any liability
174
+ incurred by, or claims asserted against, such Contributor by reason
175
+ of your accepting any such warranty or additional liability.
176
+
177
+ END OF TERMS AND CONDITIONS
178
+
179
+ APPENDIX: How to apply the Apache License to your work.
180
+
181
+ To apply the Apache License to your work, attach the following
182
+ boilerplate notice, with the fields enclosed by brackets "[]"
183
+ replaced with your own identifying information. (Don't include
184
+ the brackets!) The text should be enclosed in the appropriate
185
+ comment syntax for the file format. We also recommend that a
186
+ file or class name and description of purpose be included on the
187
+ same "printed page" as the copyright notice for easier
188
+ identification within third-party archives.
189
+
190
+ Copyright 2026 Piglabs
191
+
192
+ Licensed under the Apache License, Version 2.0 (the "License");
193
+ you may not use this file except in compliance with the License.
194
+ You may obtain a copy of the License at
195
+
196
+ http://www.apache.org/licenses/LICENSE-2.0
197
+
198
+ Unless required by applicable law or agreed to in writing, software
199
+ distributed under the License is distributed on an "AS IS" BASIS,
200
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
201
+ See the License for the specific language governing permissions and
202
+ limitations under the License.
h3v-0.1.1/MANIFEST.in ADDED
@@ -0,0 +1,6 @@
1
+ include README.md CHANGELOG.md LICENSE NOTICE
2
+ recursive-include docs *.md *.py *.svg
3
+ recursive-include tests *.py
4
+ recursive-include tools *.py
5
+ recursive-include .github/workflows *.yml
6
+ prune docs/_build
h3v-0.1.1/NOTICE ADDED
@@ -0,0 +1,10 @@
1
+ H3V
2
+ Copyright 2026 H3V contributors
3
+
4
+ Licensed under the Apache License, Version 2.0. See LICENSE.
5
+
6
+ H3V is an independent extension and is not an official H3 format.
7
+ H3V depends on H3 through h3-py, projects maintained by Uber Technologies
8
+ and their contributors and distributed separately under Apache License 2.0.
9
+ The authalic Earth radius follows H3's EARTH_RADIUS_KM constant:
10
+ 6371.007180918475 kilometres.
h3v-0.1.1/PKG-INFO ADDED
@@ -0,0 +1,100 @@
1
+ Metadata-Version: 2.4
2
+ Name: h3v
3
+ Version: 0.1.1
4
+ Summary: H3 cells with altitude and independent surface and radial resolutions
5
+ License-Expression: Apache-2.0
6
+ Project-URL: Repository, https://github.com/piglabsai/h3v
7
+ Project-URL: Documentation, https://github.com/piglabsai/h3v/blob/main/docs/index.md
8
+ Project-URL: Issues, https://github.com/piglabsai/h3v/issues
9
+ Project-URL: Changelog, https://github.com/piglabsai/h3v/blob/main/CHANGELOG.md
10
+ Classifier: Development Status :: 3 - Alpha
11
+ Requires-Python: >=3.10
12
+ Description-Content-Type: text/markdown
13
+ License-File: LICENSE
14
+ License-File: NOTICE
15
+ Requires-Dist: h3==4.5.0
16
+ Provides-Extra: docs
17
+ Requires-Dist: sphinx<9,>=7.4; extra == "docs"
18
+ Requires-Dist: myst-parser<5,>=3; extra == "docs"
19
+ Requires-Dist: sphinx-book-theme<2,>=1.1; extra == "docs"
20
+ Dynamic: license-file
21
+
22
+ # H3V: H3 cells with altitude
23
+
24
+ **A voxel is H3V's equivalent of an H3 cell: a region with an ID.**
25
+ An H3 cell covers an area on Earth's surface. An H3V voxel combines that
26
+ cell with an altitude interval, giving it a vertical extent as well.
27
+
28
+ The starting operation is **latitude + longitude + altitude -> voxel ID**, using
29
+ `latlngalt_to_voxel()`. It works like H3's `latlng_to_cell()`, with altitude
30
+ and a separate radial resolution (altitude detail) added.
31
+
32
+ Use H3V to group positions by voxel, change grid detail, get boundaries for
33
+ drawing, calculate volumes, or measure straight lines between voxel centers.
34
+
35
+ **Experimental preview.** Public API and serialized-index compatibility are
36
+ not yet guaranteed. Record the H3V package version alongside persisted voxel IDs.
37
+
38
+ ## Install
39
+
40
+ Install from PyPI with Python 3.10 or later:
41
+
42
+ ```console
43
+ python -m pip install h3v
44
+ ```
45
+
46
+ The H3 dependency is installed automatically.
47
+
48
+ ## First example
49
+
50
+ Find the voxel containing a point at latitude 52 degrees, longitude 13 degrees,
51
+ and altitude 1 km:
52
+
53
+ ```python
54
+ import h3v
55
+
56
+ voxel = h3v.latlngalt_to_voxel(
57
+ 52, 13, 1, surface_resolution=9, radial_resolution=7
58
+ )
59
+ print(h3v.get_resolution(voxel)) # (9, 7)
60
+
61
+ latitude, longitude, altitude_km = h3v.voxel_to_latlngalt(voxel)
62
+ print(round(altitude_km, 4)) # 1.0018
63
+ ```
64
+
65
+ The integer `voxel` identifies a region, not the original point. Decoding
66
+ returns the voxel center, so its altitude can differ from the input.
67
+
68
+ `surface_resolution` controls horizontal detail. `radial_resolution` controls
69
+ altitude thickness; level 7 is about 7.74 m thick. The two choices are independent.
70
+
71
+ ## What to know
72
+
73
+ - Latitude and longitude use degrees; altitude uses kilometres.
74
+ - Altitudes refer to a spherical Earth surface with an Earth radius of about
75
+ 6,371 km, not terrain or an ellipsoid.
76
+ - Every voxel ID represents a positive-volume voxel, including at altitude zero.
77
+ Both resolutions are required; bare H3 cells are invalid voxel IDs.
78
+ - Higher radial resolution divides thickness by seven, up to level 10
79
+ (about 0.0226 m). Surface resolution follows standard H3 levels 0 through 15.
80
+ - Voxel IDs are 128-bit Python integers;
81
+ use `int_to_str()` and `str_to_int()` to exchange them as strings.
82
+ - ECEF conversions use kilometres through `ecef_to_voxel()` and `voxel_to_ecef()`.
83
+
84
+ H3V is a project-specific extension, not an official H3 format.
85
+
86
+ ## Documentation
87
+
88
+ - [Understand the grid](https://github.com/piglabsai/h3v/blob/main/docs/concepts.md): voxels, altitude, and resolution.
89
+ - [Usage guide](https://github.com/piglabsai/h3v/blob/main/docs/usage.md): common tasks with runnable examples.
90
+ - [API quick reference source](https://github.com/piglabsai/h3v/blob/main/docs/api_quick.md): functions grouped by task.
91
+ - [API reference source](https://github.com/piglabsai/h3v/blob/main/docs/api_reference.md): Sphinx reference definitions.
92
+ - [Format specification](https://github.com/piglabsai/h3v/blob/main/docs/format.md): exact interval rules and encoding.
93
+
94
+ The documentation sources are available on GitHub. The API reference requires
95
+ Sphinx rendering; use Python's `help(h3v)` or `help(h3v.latlngalt_to_voxel)`
96
+ to read installed API documentation. Development setup, tests, and documentation
97
+ builds are covered in the [contributor guide](https://github.com/piglabsai/h3v/blob/main/docs/contributing.md).
98
+
99
+ The repository is <https://github.com/piglabsai/h3v>.
100
+ Licensed under the [Apache License 2.0](https://github.com/piglabsai/h3v/blob/main/LICENSE).
h3v-0.1.1/README.md ADDED
@@ -0,0 +1,79 @@
1
+ # H3V: H3 cells with altitude
2
+
3
+ **A voxel is H3V's equivalent of an H3 cell: a region with an ID.**
4
+ An H3 cell covers an area on Earth's surface. An H3V voxel combines that
5
+ cell with an altitude interval, giving it a vertical extent as well.
6
+
7
+ The starting operation is **latitude + longitude + altitude -> voxel ID**, using
8
+ `latlngalt_to_voxel()`. It works like H3's `latlng_to_cell()`, with altitude
9
+ and a separate radial resolution (altitude detail) added.
10
+
11
+ Use H3V to group positions by voxel, change grid detail, get boundaries for
12
+ drawing, calculate volumes, or measure straight lines between voxel centers.
13
+
14
+ **Experimental preview.** Public API and serialized-index compatibility are
15
+ not yet guaranteed. Record the H3V package version alongside persisted voxel IDs.
16
+
17
+ ## Install
18
+
19
+ Install from PyPI with Python 3.10 or later:
20
+
21
+ ```console
22
+ python -m pip install h3v
23
+ ```
24
+
25
+ The H3 dependency is installed automatically.
26
+
27
+ ## First example
28
+
29
+ Find the voxel containing a point at latitude 52 degrees, longitude 13 degrees,
30
+ and altitude 1 km:
31
+
32
+ ```python
33
+ import h3v
34
+
35
+ voxel = h3v.latlngalt_to_voxel(
36
+ 52, 13, 1, surface_resolution=9, radial_resolution=7
37
+ )
38
+ print(h3v.get_resolution(voxel)) # (9, 7)
39
+
40
+ latitude, longitude, altitude_km = h3v.voxel_to_latlngalt(voxel)
41
+ print(round(altitude_km, 4)) # 1.0018
42
+ ```
43
+
44
+ The integer `voxel` identifies a region, not the original point. Decoding
45
+ returns the voxel center, so its altitude can differ from the input.
46
+
47
+ `surface_resolution` controls horizontal detail. `radial_resolution` controls
48
+ altitude thickness; level 7 is about 7.74 m thick. The two choices are independent.
49
+
50
+ ## What to know
51
+
52
+ - Latitude and longitude use degrees; altitude uses kilometres.
53
+ - Altitudes refer to a spherical Earth surface with an Earth radius of about
54
+ 6,371 km, not terrain or an ellipsoid.
55
+ - Every voxel ID represents a positive-volume voxel, including at altitude zero.
56
+ Both resolutions are required; bare H3 cells are invalid voxel IDs.
57
+ - Higher radial resolution divides thickness by seven, up to level 10
58
+ (about 0.0226 m). Surface resolution follows standard H3 levels 0 through 15.
59
+ - Voxel IDs are 128-bit Python integers;
60
+ use `int_to_str()` and `str_to_int()` to exchange them as strings.
61
+ - ECEF conversions use kilometres through `ecef_to_voxel()` and `voxel_to_ecef()`.
62
+
63
+ H3V is a project-specific extension, not an official H3 format.
64
+
65
+ ## Documentation
66
+
67
+ - [Understand the grid](https://github.com/piglabsai/h3v/blob/main/docs/concepts.md): voxels, altitude, and resolution.
68
+ - [Usage guide](https://github.com/piglabsai/h3v/blob/main/docs/usage.md): common tasks with runnable examples.
69
+ - [API quick reference source](https://github.com/piglabsai/h3v/blob/main/docs/api_quick.md): functions grouped by task.
70
+ - [API reference source](https://github.com/piglabsai/h3v/blob/main/docs/api_reference.md): Sphinx reference definitions.
71
+ - [Format specification](https://github.com/piglabsai/h3v/blob/main/docs/format.md): exact interval rules and encoding.
72
+
73
+ The documentation sources are available on GitHub. The API reference requires
74
+ Sphinx rendering; use Python's `help(h3v)` or `help(h3v.latlngalt_to_voxel)`
75
+ to read installed API documentation. Development setup, tests, and documentation
76
+ builds are covered in the [contributor guide](https://github.com/piglabsai/h3v/blob/main/docs/contributing.md).
77
+
78
+ The repository is <https://github.com/piglabsai/h3v>.
79
+ Licensed under the [Apache License 2.0](https://github.com/piglabsai/h3v/blob/main/LICENSE).
@@ -0,0 +1,18 @@
1
+ <svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 760 265" role="img" aria-labelledby="title desc">
2
+ <title id="title">An H3 cell plus an altitude interval makes a voxel</title>
3
+ <desc id="desc">Left: a surface cell. Right: its footprint repeated at a bottom and top altitude, joined to show a volume.</desc>
4
+ <rect x="1" y="1" width="758" height="263" rx="12" fill="#f5f8fb" stroke="#d4dee8"/>
5
+ <g font-family="sans-serif" fill="#24394b">
6
+ <text x="48" y="38" font-size="20" font-weight="600">H3: a surface cell</text>
7
+ <text x="350" y="38" font-size="20" font-weight="600">H3V: cell + altitude interval</text>
8
+ <polygon points="65,125 120,95 175,125 175,180 120,210 65,180" fill="#dcecf6" stroke="#367aa5" stroke-width="3"/>
9
+ <text x="120" y="158" text-anchor="middle" font-size="15">footprint</text>
10
+ <path d="M245 152h49m-10-8 10 8-10 8" fill="none" stroke="#62788a" stroke-width="2"/>
11
+ <polygon points="365,149 420,119 475,149 475,199 420,229 365,199" fill="#dcecf6" stroke="#367aa5" stroke-width="2"/>
12
+ <path d="M365 149v-73m55 43v-73m55 103v-73m0 123v-73m-55 103v-73m-55 43v-73" stroke="#367aa5" stroke-width="2"/>
13
+ <polygon points="365,76 420,46 475,76 475,126 420,156 365,126" fill="#a9d7d0" fill-opacity=".8" stroke="#237e72" stroke-width="3"/>
14
+ <path d="M484 78h34m-34 120h34m-10-110v101m-5-91 5-10 5 10m-10 81 5 10 5-10" fill="none" stroke="#62788a" stroke-width="1.5"/>
15
+ <text x="535" y="82" font-size="15">top altitude</text>
16
+ <text x="535" y="145" font-size="15">thickness</text>
17
+ <text x="535" y="203" font-size="15">bottom altitude</text>
18
+ </g></svg>