vector2dggs 0.10.0__py3-none-any.whl → 0.10.1__py3-none-any.whl
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.
- vector2dggs/__init__.py +1 -1
- vector2dggs/rHP.py +1 -53
- {vector2dggs-0.10.0.dist-info → vector2dggs-0.10.1.dist-info}/METADATA +4 -3
- {vector2dggs-0.10.0.dist-info → vector2dggs-0.10.1.dist-info}/RECORD +8 -8
- {vector2dggs-0.10.0.dist-info → vector2dggs-0.10.1.dist-info}/COPYING +0 -0
- {vector2dggs-0.10.0.dist-info → vector2dggs-0.10.1.dist-info}/COPYING.LESSER +0 -0
- {vector2dggs-0.10.0.dist-info → vector2dggs-0.10.1.dist-info}/WHEEL +0 -0
- {vector2dggs-0.10.0.dist-info → vector2dggs-0.10.1.dist-info}/entry_points.txt +0 -0
vector2dggs/__init__.py
CHANGED
@@ -1 +1 @@
|
|
1
|
-
__version__: str = "0.10.
|
1
|
+
__version__: str = "0.10.1"
|
vector2dggs/rHP.py
CHANGED
@@ -12,13 +12,9 @@ import geopandas as gpd
|
|
12
12
|
from typing import Union
|
13
13
|
from pathlib import Path
|
14
14
|
from rhealpixdggs.conversion import compress_order_cells
|
15
|
+
from rhealpixdggs.rhp_wrappers import rhp_to_center_child
|
15
16
|
from rhppandas.util.const import COLUMNS
|
16
17
|
|
17
|
-
# from rhealpixdggs.rhp_wrappers import rhp_to_center_child, rhp_is_valid
|
18
|
-
from rhealpixdggs.rhp_wrappers import rhp_is_valid
|
19
|
-
from rhealpixdggs.dggs import RHEALPixDGGS
|
20
|
-
from rhealpixdggs.dggs import WGS84_003
|
21
|
-
|
22
18
|
import vector2dggs.constants as const
|
23
19
|
import vector2dggs.common as common
|
24
20
|
|
@@ -57,54 +53,6 @@ def rhppolyfill(df: gpd.GeoDataFrame, resolution: int) -> pd.DataFrame:
|
|
57
53
|
)
|
58
54
|
|
59
55
|
|
60
|
-
# TODO replace when merged https://github.com/manaakiwhenua/rhealpixdggs-py/pull/37
|
61
|
-
def rhp_to_center_child(
|
62
|
-
rhpindex: str, res: int = None, dggs: RHEALPixDGGS = WGS84_003
|
63
|
-
) -> str:
|
64
|
-
"""
|
65
|
-
Returns central child of rhpindex at resolution res (immediate central
|
66
|
-
child if res == None).
|
67
|
-
|
68
|
-
Returns None if the cell index is invalid.
|
69
|
-
|
70
|
-
Returns None if the DGGS has an even number of cells on a side.
|
71
|
-
|
72
|
-
EXAMPLES::
|
73
|
-
|
74
|
-
>>> rhp_to_center_child('S001450634')
|
75
|
-
'S0014506344'
|
76
|
-
>>> rhp_to_center_child('S001450634', res=13)
|
77
|
-
'S001450634444'
|
78
|
-
>>> rhp_to_center_child('INVALID')
|
79
|
-
"""
|
80
|
-
# Stop early if the cell index is invalid
|
81
|
-
if not rhp_is_valid(rhpindex, dggs):
|
82
|
-
return None
|
83
|
-
|
84
|
-
# DGGSs with even numbers of cells on a side never have a cell at the centre
|
85
|
-
if (dggs.N_side % 2) == 0:
|
86
|
-
return None
|
87
|
-
|
88
|
-
# Handle mismatch between cell resolution and requested child resolution
|
89
|
-
parent_res = len(rhpindex) - 1
|
90
|
-
if res is not None and res < parent_res:
|
91
|
-
return rhpindex
|
92
|
-
|
93
|
-
# Standard case (including parent_res == res)
|
94
|
-
else:
|
95
|
-
# res == None returns the central child from one level down (by convention)
|
96
|
-
added_levels = 1 if res is None else res - parent_res
|
97
|
-
|
98
|
-
# Derive index of centre child and append that to rhpindex
|
99
|
-
# NOTE: only works for odd values of N_side
|
100
|
-
c_index = int((dggs.N_side**2 - 1) / 2)
|
101
|
-
|
102
|
-
# Append the required number of child digits to cell index
|
103
|
-
child_index = rhpindex + "".join(str(c_index) for _ in range(0, added_levels))
|
104
|
-
|
105
|
-
return child_index
|
106
|
-
|
107
|
-
|
108
56
|
def compact_cells(cells: set[str]) -> set[str]:
|
109
57
|
"""
|
110
58
|
Compact a set of rHEALPix DGGS cells.
|
@@ -1,6 +1,6 @@
|
|
1
1
|
Metadata-Version: 2.3
|
2
2
|
Name: vector2dggs
|
3
|
-
Version: 0.10.
|
3
|
+
Version: 0.10.1
|
4
4
|
Summary: CLI DGGS indexer for vector geospatial data
|
5
5
|
License: LGPL-3.0-or-later
|
6
6
|
Keywords: dggs,vector,h3,rHEALPix,cli
|
@@ -30,6 +30,7 @@ Requires-Dist: psycopg2 (>=2.9.9,<3.0.0)
|
|
30
30
|
Requires-Dist: pyarrow (>=20.0,<21.0)
|
31
31
|
Requires-Dist: pyproj (>=3.7,<4.0)
|
32
32
|
Requires-Dist: python-geohash (>=0.8.5,<0.9.0)
|
33
|
+
Requires-Dist: rhealpixdggs (>=0.5.12,<0.6.0)
|
33
34
|
Requires-Dist: rhppandas (>=0.2.0,<0.3.0)
|
34
35
|
Requires-Dist: rusty-polygon-geohasher (>=0.2.3,<0.3.0)
|
35
36
|
Requires-Dist: s2geometry (>=0.9.0,<0.10.0)
|
@@ -261,14 +262,14 @@ vector2dggs h3 -v DEBUG -id ogc_fid -r 9 -p 5 -t 4 --overwrite -lyr topo50_lake
|
|
261
262
|
title={{vector2dggs}},
|
262
263
|
author={Ardo, James and Law, Richard},
|
263
264
|
url={https://github.com/manaakiwhenua/vector2dggs},
|
264
|
-
version={0.10.
|
265
|
+
version={0.10.1},
|
265
266
|
date={2023-04-20}
|
266
267
|
}
|
267
268
|
```
|
268
269
|
|
269
270
|
APA/Harvard
|
270
271
|
|
271
|
-
> Ardo, J., & Law, R. (2023). vector2dggs (0.10.
|
272
|
+
> Ardo, J., & Law, R. (2023). vector2dggs (0.10.1) [Computer software]. https://github.com/manaakiwhenua/vector2dggs
|
272
273
|
|
273
274
|
[](https://github.com/manaakiwhenua/manaakiwhenua-standards)
|
274
275
|
|
@@ -1,15 +1,15 @@
|
|
1
|
-
vector2dggs/__init__.py,sha256=
|
1
|
+
vector2dggs/__init__.py,sha256=zkryc4Uha10GTKJDVvFVRKEySO4-gejqb9sTlyYC-EE,28
|
2
2
|
vector2dggs/cli.py,sha256=d_4skD62k6pXUWgDdVHbDwpe4A4yo62ZFx8Cp_6GpBA,767
|
3
3
|
vector2dggs/common.py,sha256=rQL1_rFr1VTyILffOZgdwPzZS1JThn4TBPswfCkMjbM,14471
|
4
4
|
vector2dggs/constants.py,sha256=KdmBQCP_GCygzvDLtS8AMQM9i6QqOkf-9YQkh_AzrKc,1779
|
5
5
|
vector2dggs/geohash.py,sha256=PVLkaaSVLgzDZNfuL0y3Xioh4pyvom845HuyLIAsLUY,10398
|
6
6
|
vector2dggs/h3.py,sha256=Juvc8g4QWfDIco9RQHaX8p9S9rkW5QvusxpyO-G7eSs,7408
|
7
7
|
vector2dggs/katana.py,sha256=v4BRzVCsroC6RzIYdxLfrr9eFOdmXb5S9jXBMs5tgSo,3571
|
8
|
-
vector2dggs/rHP.py,sha256=
|
8
|
+
vector2dggs/rHP.py,sha256=UoRdidkkVGhGP85wrfBE_5BNrx1Xg5skQQe1F5X0LZ8,8109
|
9
9
|
vector2dggs/s2.py,sha256=SOXMHQQq86bM88MDgBBemGiXIbuEIbrhLSgPwLKceLY,12809
|
10
|
-
vector2dggs-0.10.
|
11
|
-
vector2dggs-0.10.
|
12
|
-
vector2dggs-0.10.
|
13
|
-
vector2dggs-0.10.
|
14
|
-
vector2dggs-0.10.
|
15
|
-
vector2dggs-0.10.
|
10
|
+
vector2dggs-0.10.1.dist-info/COPYING,sha256=OXLcl0T2SZ8Pmy2_dmlvKuetivmyPd5m1q-Gyd-zaYY,35149
|
11
|
+
vector2dggs-0.10.1.dist-info/COPYING.LESSER,sha256=46mU2C5kSwOnkqkw9XQAJlhBL2JAf1_uCD8lVcXyMRg,7652
|
12
|
+
vector2dggs-0.10.1.dist-info/METADATA,sha256=MNgUCPkWdxUte-n8iRQUgCFAdv_rOXp-GtPvK7vaTNU,12652
|
13
|
+
vector2dggs-0.10.1.dist-info/WHEEL,sha256=b4K_helf-jlQoXBBETfwnf4B04YC67LOev0jo4fX5m8,88
|
14
|
+
vector2dggs-0.10.1.dist-info/entry_points.txt,sha256=5h8LB9L2oOE5u_N7FRGtu4JDwa553iPs4u0XhcLeLZU,52
|
15
|
+
vector2dggs-0.10.1.dist-info/RECORD,,
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|