vector2dggs 0.8.0__tar.gz → 0.9.0__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.
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: vector2dggs
3
- Version: 0.8.0
3
+ Version: 0.9.0
4
4
  Summary: CLI DGGS indexer for vector geospatial data
5
5
  Home-page: https://github.com/manaakiwhenua/vector2dggs
6
6
  License: LGPL-3.0-or-later
@@ -30,8 +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.5,<0.6.0)
34
- Requires-Dist: rhppandas (>=0.1.2,<0.2.0)
33
+ Requires-Dist: rhppandas (>=0.2.0,<0.3.0)
35
34
  Requires-Dist: rusty-polygon-geohasher (>=0.2.3,<0.3.0)
36
35
  Requires-Dist: s2geometry (>=0.9.0,<0.10.0)
37
36
  Requires-Dist: shapely (>=2.1,<3.0)
@@ -51,7 +50,7 @@ This is the vector equivalent of [raster2dggs](https://github.com/manaakiwhenua/
51
50
  Currently this tool supports the following DGGSs:
52
51
 
53
52
  - [H3](https://h3geo.org/)
54
- - [rHEALPix](https://datastore.landcareresearch.co.nz/dataset/rhealpix-discrete-global-grid-system) (points, polygons)
53
+ - [rHEALPix](https://datastore.landcareresearch.co.nz/dataset/rhealpix-discrete-global-grid-system)
55
54
  - [S2](https://s2geometry.io/)
56
55
 
57
56
  ... and the following geocode systems:
@@ -130,8 +129,8 @@ Options:
130
129
  [default: 5000; required]
131
130
  -t, --threads INTEGER Amount of threads used for operation
132
131
  [default: 7]
133
- -tbl, --table TEXT Name of the table to read when using a
134
- spatial database connection as input
132
+ -lyr, --layer TEXT Name of the layer or table to read when using a
133
+ an input that supports layers or tables
135
134
  -g, --geom_col TEXT Column name to use when using a spatial
136
135
  database connection as input [default:
137
136
  geom]
@@ -239,7 +238,7 @@ vector2dggs h3 -v DEBUG -id title_no -r 12 -o ~/Downloads/nz-property-titles.gpk
239
238
  With a PostgreSQL/PostGIS connection:
240
239
 
241
240
  ```bash
242
- vector2dggs h3 -v DEBUG -id ogc_fid -r 9 -p 5 -t 4 --overwrite -tbl topo50_lake postgresql://user:password@host:port/db ./topo50_lake.parquet
241
+ vector2dggs h3 -v DEBUG -id ogc_fid -r 9 -p 5 -t 4 --overwrite -lyr topo50_lake postgresql://user:password@host:port/db ./topo50_lake.parquet
243
242
  ```
244
243
 
245
244
  ## Citation
@@ -249,14 +248,14 @@ vector2dggs h3 -v DEBUG -id ogc_fid -r 9 -p 5 -t 4 --overwrite -tbl topo50_lake
249
248
  title={{vector2dggs}},
250
249
  author={Ardo, James and Law, Richard},
251
250
  url={https://github.com/manaakiwhenua/vector2dggs},
252
- version={0.8.0},
251
+ version={0.9.0},
253
252
  date={2023-04-20}
254
253
  }
255
254
  ```
256
255
 
257
256
  APA/Harvard
258
257
 
259
- > Ardo, J., & Law, R. (2023). vector2dggs (0.8.0) [Computer software]. https://github.com/manaakiwhenua/vector2dggs
258
+ > Ardo, J., & Law, R. (2023). vector2dggs (0.9.0) [Computer software]. https://github.com/manaakiwhenua/vector2dggs
260
259
 
261
260
  [![manaakiwhenua-standards](https://github.com/manaakiwhenua/vector2dggs/workflows/manaakiwhenua-standards/badge.svg)](https://github.com/manaakiwhenua/manaakiwhenua-standards)
262
261
 
@@ -9,7 +9,7 @@ This is the vector equivalent of [raster2dggs](https://github.com/manaakiwhenua/
9
9
  Currently this tool supports the following DGGSs:
10
10
 
11
11
  - [H3](https://h3geo.org/)
12
- - [rHEALPix](https://datastore.landcareresearch.co.nz/dataset/rhealpix-discrete-global-grid-system) (points, polygons)
12
+ - [rHEALPix](https://datastore.landcareresearch.co.nz/dataset/rhealpix-discrete-global-grid-system)
13
13
  - [S2](https://s2geometry.io/)
14
14
 
15
15
  ... and the following geocode systems:
@@ -88,8 +88,8 @@ Options:
88
88
  [default: 5000; required]
89
89
  -t, --threads INTEGER Amount of threads used for operation
90
90
  [default: 7]
91
- -tbl, --table TEXT Name of the table to read when using a
92
- spatial database connection as input
91
+ -lyr, --layer TEXT Name of the layer or table to read when using a
92
+ an input that supports layers or tables
93
93
  -g, --geom_col TEXT Column name to use when using a spatial
94
94
  database connection as input [default:
95
95
  geom]
@@ -197,7 +197,7 @@ vector2dggs h3 -v DEBUG -id title_no -r 12 -o ~/Downloads/nz-property-titles.gpk
197
197
  With a PostgreSQL/PostGIS connection:
198
198
 
199
199
  ```bash
200
- vector2dggs h3 -v DEBUG -id ogc_fid -r 9 -p 5 -t 4 --overwrite -tbl topo50_lake postgresql://user:password@host:port/db ./topo50_lake.parquet
200
+ vector2dggs h3 -v DEBUG -id ogc_fid -r 9 -p 5 -t 4 --overwrite -lyr topo50_lake postgresql://user:password@host:port/db ./topo50_lake.parquet
201
201
  ```
202
202
 
203
203
  ## Citation
@@ -207,13 +207,13 @@ vector2dggs h3 -v DEBUG -id ogc_fid -r 9 -p 5 -t 4 --overwrite -tbl topo50_lake
207
207
  title={{vector2dggs}},
208
208
  author={Ardo, James and Law, Richard},
209
209
  url={https://github.com/manaakiwhenua/vector2dggs},
210
- version={0.8.0},
210
+ version={0.9.0},
211
211
  date={2023-04-20}
212
212
  }
213
213
  ```
214
214
 
215
215
  APA/Harvard
216
216
 
217
- > Ardo, J., & Law, R. (2023). vector2dggs (0.8.0) [Computer software]. https://github.com/manaakiwhenua/vector2dggs
217
+ > Ardo, J., & Law, R. (2023). vector2dggs (0.9.0) [Computer software]. https://github.com/manaakiwhenua/vector2dggs
218
218
 
219
219
  [![manaakiwhenua-standards](https://github.com/manaakiwhenua/vector2dggs/workflows/manaakiwhenua-standards/badge.svg)](https://github.com/manaakiwhenua/manaakiwhenua-standards)
@@ -1,6 +1,6 @@
1
1
  [tool.poetry]
2
2
  name = "vector2dggs"
3
- version = "0.8.0"
3
+ version = "0.9.0"
4
4
  description = "CLI DGGS indexer for vector geospatial data"
5
5
  authors = ["James Ardo <ardoj@landcareresearch.co.nz>"]
6
6
  maintainers = ["Richard Law <lawr@landcareresearch.co.nz>"]
@@ -30,8 +30,7 @@ sqlalchemy = "^2.0.32"
30
30
  psycopg2 = "^2.9.9"
31
31
  shapely = "^2.1"
32
32
  numpy = "^2"
33
- rhppandas = "^0.1.2"
34
- rhealpixdggs = "^0.5.5"
33
+ rhppandas = "^0.2.0"
35
34
  pillow = "^11.2.1"
36
35
  s2geometry = "^0.9.0"
37
36
  rusty-polygon-geohasher = "^0.2.3"
@@ -0,0 +1 @@
1
+ __version__: str = "0.9.0"
@@ -112,7 +112,7 @@ def drop_condition(
112
112
  return df
113
113
 
114
114
 
115
- def get_parent_res(dggs: str, parent_res: Union[None, int], resolution: int):
115
+ def get_parent_res(dggs: str, parent_res: Union[None, str], resolution: int) -> int:
116
116
  """
117
117
  Uses a parent resolution,
118
118
  OR,
@@ -127,7 +127,7 @@ def get_parent_res(dggs: str, parent_res: Union[None, int], resolution: int):
127
127
  )
128
128
  )
129
129
  return (
130
- parent_res
130
+ int(parent_res)
131
131
  if parent_res is not None
132
132
  else const.DEFAULT_DGGS_PARENT_RES[dggs](resolution)
133
133
  )
@@ -138,10 +138,9 @@ def parent_partitioning(
138
138
  input_dir: Path,
139
139
  output_dir: Path,
140
140
  resolution: int,
141
- parent_res: Union[None, int],
141
+ parent_res: int,
142
142
  **kwargs,
143
143
  ) -> None:
144
- parent_res: int = get_parent_res(dggs, parent_res, resolution)
145
144
  partition_col = f"{dggs}_{parent_res:02}"
146
145
 
147
146
  with TqdmCallback(desc="Repartitioning"):
@@ -171,7 +170,7 @@ def polyfill(
171
170
  pq_in: Path,
172
171
  spatial_sort_col: str,
173
172
  resolution: int,
174
- parent_res: Union[None, int],
173
+ parent_res: int,
175
174
  output_directory: str,
176
175
  ) -> None:
177
176
  """
@@ -179,7 +178,9 @@ def polyfill(
179
178
  linetracing (for LineString), or indexing (for Point),
180
179
  and writes out to parquet.
181
180
  """
182
- df = gpd.read_parquet(pq_in).reset_index().drop(columns=[spatial_sort_col])
181
+ df = gpd.read_parquet(pq_in).reset_index()
182
+ if spatial_sort_col != "none":
183
+ df = df.drop(columns=[spatial_sort_col])
183
184
  if len(df.index) == 0:
184
185
  # Input is empty, nothing to convert
185
186
  return None
@@ -192,7 +193,6 @@ def polyfill(
192
193
  return None
193
194
 
194
195
  df.index.rename(f"{dggs}_{resolution:02}", inplace=True)
195
- parent_res: int = get_parent_res(dggs, parent_res, resolution)
196
196
 
197
197
  # Secondary (parent) index, used later for partitioning
198
198
  df = secondary_index_func(df, parent_res)
@@ -223,22 +223,23 @@ def index(
223
223
  id_field: str = None,
224
224
  cut_crs: pyproj.CRS = None,
225
225
  con: SQLConnectionType = None,
226
- table: str = None,
226
+ layer: str = None,
227
227
  geom_col: str = "geom",
228
228
  overwrite: bool = False,
229
229
  ) -> Path:
230
230
  """
231
231
  Performs multi-threaded DGGS indexing on geometries (including multipart and collections).
232
232
  """
233
+ parent_res = get_parent_res(dggs, parent_res, resolution)
233
234
 
234
- if table and con:
235
+ if layer and con:
235
236
  # Database connection
236
237
  if keep_attributes:
237
- q = sqlalchemy.text(f"SELECT * FROM {table}")
238
+ q = sqlalchemy.text(f"SELECT * FROM {layer}")
238
239
  elif id_field and not keep_attributes:
239
- q = sqlalchemy.text(f"SELECT {id_field}, {geom_col} FROM {table}")
240
+ q = sqlalchemy.text(f"SELECT {id_field}, {geom_col} FROM {layer}")
240
241
  else:
241
- q = sqlalchemy.text(f"SELECT {geom_col} FROM {table}")
242
+ q = sqlalchemy.text(f"SELECT {geom_col} FROM {layer}")
242
243
  df = gpd.read_postgis(q, con.connect(), geom_col=geom_col).rename_geometry(
243
244
  "geometry"
244
245
  )
@@ -296,11 +297,12 @@ def index(
296
297
 
297
298
  ddf = dgpd.from_geopandas(df, chunksize=max(1, chunksize), sort=True)
298
299
 
299
- LOGGER.debug("Spatially sorting and partitioning (%s)", spatial_sorting)
300
- ddf = ddf.spatial_shuffle(by=spatial_sorting)
300
+ if spatial_sorting != "none":
301
+ LOGGER.debug("Spatially sorting and partitioning (%s)", spatial_sorting)
302
+ ddf = ddf.spatial_shuffle(by=spatial_sorting)
301
303
  spatial_sort_col = (
302
304
  spatial_sorting
303
- if spatial_sorting == "geohash"
305
+ if (spatial_sorting == "geohash" or spatial_sorting == "none")
304
306
  else f"{spatial_sorting}_distance"
305
307
  )
306
308
 
@@ -6,21 +6,23 @@ import tempfile
6
6
  MIN_H3, MAX_H3 = 0, 15
7
7
  MIN_RHP, MAX_RHP = 0, 15
8
8
  MIN_S2, MAX_S2 = 0, 30
9
- MIN_GEOHASH, MAX_GEOHASH = 0, 12
9
+ MIN_GEOHASH, MAX_GEOHASH = 1, 12
10
10
 
11
11
  DEFAULTS = {
12
12
  "id": None,
13
13
  "k": False,
14
14
  "ch": 50,
15
- "s": "hilbert",
15
+ "s": "none",
16
16
  "crs": None,
17
17
  "c": 5000,
18
18
  "t": (multiprocessing.cpu_count() - 1),
19
- "tbl": None,
19
+ "lyr": None,
20
20
  "g": "geom",
21
21
  "tempdir": tempfile.tempdir,
22
22
  }
23
23
 
24
+ SPATIAL_SORTING_METHODS = ["hilbert", "morton", "geohash", "none"]
25
+
24
26
  DEFAULT_DGGS_PARENT_RES = {
25
27
  "h3": lambda resolution: max(MIN_H3, (resolution - DEFAULT_PARENT_OFFSET)),
26
28
  "rhp": lambda resolution: max(MIN_RHP, (resolution - DEFAULT_PARENT_OFFSET)),
@@ -123,7 +123,7 @@ def gh_polyfill(df: gpd.GeoDataFrame, level: int) -> pd.DataFrame:
123
123
  @click.option(
124
124
  "-s",
125
125
  "--spatial_sorting",
126
- type=click.Choice(["hilbert", "morton", "geohash"]),
126
+ type=click.Choice(const.SPATIAL_SORTING_METHODS),
127
127
  default=const.DEFAULTS["s"],
128
128
  help="Spatial sorting method when perfoming spatial partitioning.",
129
129
  )
@@ -155,12 +155,12 @@ def gh_polyfill(df: gpd.GeoDataFrame, level: int) -> pd.DataFrame:
155
155
  nargs=1,
156
156
  )
157
157
  @click.option(
158
- "-tbl",
159
- "--table",
158
+ "-lyr",
159
+ "--layer",
160
160
  required=False,
161
- default=const.DEFAULTS["tbl"],
161
+ default=const.DEFAULTS["lyr"],
162
162
  type=str,
163
- help="Name of the table to read when using a spatial database connection as input",
163
+ help="Name of the layer or table to read when using an input that supports layers or tables",
164
164
  nargs=1,
165
165
  )
166
166
  @click.option(
@@ -192,7 +192,7 @@ def geohash(
192
192
  cut_crs: int,
193
193
  cut_threshold: int,
194
194
  threads: int,
195
- table: str,
195
+ layer: str,
196
196
  geom_col: str,
197
197
  tempdir: Union[str, Path],
198
198
  overwrite: bool,
@@ -230,7 +230,7 @@ def geohash(
230
230
  cut_crs=cut_crs,
231
231
  id_field=id_field,
232
232
  con=con,
233
- table=table,
233
+ layer=layer,
234
234
  geom_col=geom_col,
235
235
  overwrite=overwrite,
236
236
  )
@@ -98,7 +98,7 @@ def h3polyfill(df: gpd.GeoDataFrame, resolution: int) -> pd.DataFrame:
98
98
  @click.option(
99
99
  "-s",
100
100
  "--spatial_sorting",
101
- type=click.Choice(["hilbert", "morton", "geohash"]),
101
+ type=click.Choice(const.SPATIAL_SORTING_METHODS),
102
102
  default=const.DEFAULTS["s"],
103
103
  help="Spatial sorting method when perfoming spatial partitioning.",
104
104
  )
@@ -130,12 +130,12 @@ def h3polyfill(df: gpd.GeoDataFrame, resolution: int) -> pd.DataFrame:
130
130
  nargs=1,
131
131
  )
132
132
  @click.option(
133
- "-tbl",
134
- "--table",
133
+ "-lyr",
134
+ "--layer",
135
135
  required=False,
136
- default=const.DEFAULTS["tbl"],
136
+ default=const.DEFAULTS["lyr"],
137
137
  type=str,
138
- help="Name of the table to read when using a spatial database connection as input",
138
+ help="Name of the layer or table to read when using an input that supports layers or tables",
139
139
  nargs=1,
140
140
  )
141
141
  @click.option(
@@ -167,7 +167,7 @@ def h3(
167
167
  cut_crs: int,
168
168
  cut_threshold: int,
169
169
  threads: int,
170
- table: str,
170
+ layer: str,
171
171
  geom_col: str,
172
172
  tempdir: Union[str, Path],
173
173
  overwrite: bool,
@@ -205,7 +205,7 @@ def h3(
205
205
  cut_crs=cut_crs,
206
206
  id_field=id_field,
207
207
  con=con,
208
- table=table,
208
+ layer=layer,
209
209
  geom_col=geom_col,
210
210
  overwrite=overwrite,
211
211
  )
@@ -11,6 +11,7 @@ Redistribution and use in source and binary forms, with or without modification,
11
11
  THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS “AS IS” AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
12
12
  """
13
13
 
14
+ from shapely import force_2d, has_z, has_m
14
15
  from shapely.geometry import (
15
16
  box,
16
17
  Polygon,
@@ -18,20 +19,32 @@ from shapely.geometry import (
18
19
  LineString,
19
20
  MultiLineString,
20
21
  GeometryCollection,
22
+ LinearRing,
21
23
  )
22
- from shapely.validation import explain_validity, make_valid
24
+ from shapely.geometry.base import BaseGeometry
25
+ from shapely.validation import make_valid
26
+ from typing import Union, List
23
27
 
24
28
 
25
- def katana(geometry, threshold, count=0) -> GeometryCollection:
29
+ def katana(
30
+ geometry: Union[BaseGeometry, None],
31
+ threshold: float,
32
+ count: int = 0,
33
+ check_2D: bool = True,
34
+ ) -> List[BaseGeometry]:
26
35
  """
27
- Split a geometry into two parts across its shortest dimension.
36
+ Recursively split a geometry into two parts across its shortest dimension.
28
37
  Invalid input `geometry` will silently be made valid (if possible).
38
+ Any LinearRings will be converted to Polygons.
29
39
  """
30
40
  if geometry is None:
31
- # Empty geometry collection
32
- return GeometryCollection([])
41
+ return []
42
+ if isinstance(geometry, LinearRing):
43
+ geometry = Polygon(geometry)
44
+ if check_2D and (has_z(geometry) or has_m(geometry)):
45
+ geometry = force_2d(geometry)
46
+ check_2D = False # No further 2D check needed
33
47
  if not geometry.is_valid:
34
- # print(explain_validity(geometry))
35
48
  geometry = make_valid(geometry)
36
49
  if geometry.geom_type == "GeometryCollection":
37
50
  geometry.normalize()
@@ -60,16 +73,9 @@ def katana(geometry, threshold, count=0) -> GeometryCollection:
60
73
  if not isinstance(c, GeometryCollection):
61
74
  c = GeometryCollection([c])
62
75
  for e in c.geoms:
63
- if isinstance(e, (Polygon, MultiPolygon, LineString, MultiLineString)):
64
- result.extend(katana(e, threshold, count + 1))
65
- if count > 0:
66
- return result
67
- # convert multipart into singlepart
68
- final_result = []
69
- for g in result:
70
- # if isinstance(g, MultiPolygon):
71
- # final_result.extend(g)
72
- # else:
73
- # final_result.append(g)
74
- final_result.append(g)
75
- return final_result
76
+ if isinstance(
77
+ e, (Polygon, MultiPolygon, LineString, MultiLineString, LinearRing)
78
+ ):
79
+ result.extend(katana(e, threshold, count + 1, check_2D))
80
+
81
+ return result
@@ -11,6 +11,7 @@ import geopandas as gpd
11
11
 
12
12
  from typing import Union
13
13
  from pathlib import Path
14
+ from rhppandas.util.const import COLUMNS
14
15
 
15
16
  import vector2dggs.constants as const
16
17
  import vector2dggs.common as common
@@ -29,14 +30,14 @@ def rhppolyfill(df: gpd.GeoDataFrame, resolution: int) -> pd.DataFrame:
29
30
  resolution, return_geometry=False
30
31
  ).drop(columns=["index"])
31
32
 
32
- # df_linestring = df[df.geom_type == "LineString"]
33
- # if len(df_linestring.index) > 0:
34
- # df_linestring = (
35
- # df_linestring.rhp.linetrace(resolution)
36
- # .explode("rhp_linetrace")
37
- # .set_index("rhp_linetrace")
38
- # )
39
- # df_linestring = df_linestring[~df_linestring.index.duplicated(keep="first")]
33
+ df_linestring = df[df.geom_type == "LineString"]
34
+ if len(df_linestring.index) > 0:
35
+ df_linestring = (
36
+ df_linestring.rhp.linetrace(resolution)
37
+ .explode(COLUMNS["linetrace"])
38
+ .set_index(COLUMNS["linetrace"])
39
+ )
40
+ df_linestring = df_linestring[~df_linestring.index.duplicated(keep="first")]
40
41
 
41
42
  df_point = df[df.geom_type == "Point"]
42
43
  if len(df_point.index) > 0:
@@ -45,7 +46,7 @@ def rhppolyfill(df: gpd.GeoDataFrame, resolution: int) -> pd.DataFrame:
45
46
  return pd.concat(
46
47
  map(
47
48
  lambda _df: pd.DataFrame(_df.drop(columns=[_df.geometry.name])),
48
- [df_polygon, df_point],
49
+ [df_polygon, df_linestring, df_point],
49
50
  )
50
51
  )
51
52
 
@@ -98,7 +99,7 @@ def rhppolyfill(df: gpd.GeoDataFrame, resolution: int) -> pd.DataFrame:
98
99
  @click.option(
99
100
  "-s",
100
101
  "--spatial_sorting",
101
- type=click.Choice(["hilbert", "morton", "geohash"]),
102
+ type=click.Choice(const.SPATIAL_SORTING_METHODS),
102
103
  default=const.DEFAULTS["s"],
103
104
  help="Spatial sorting method when perfoming spatial partitioning.",
104
105
  )
@@ -130,12 +131,12 @@ def rhppolyfill(df: gpd.GeoDataFrame, resolution: int) -> pd.DataFrame:
130
131
  nargs=1,
131
132
  )
132
133
  @click.option(
133
- "-tbl",
134
- "--table",
134
+ "-lyr",
135
+ "--layer",
135
136
  required=False,
136
- default=const.DEFAULTS["tbl"],
137
+ default=const.DEFAULTS["lyr"],
137
138
  type=str,
138
- help="Name of the table to read when using a spatial database connection as input",
139
+ help="Name of the layer or table to read when using an input that supports layers or tables",
139
140
  nargs=1,
140
141
  )
141
142
  @click.option(
@@ -167,7 +168,7 @@ def rhp(
167
168
  cut_crs: int,
168
169
  cut_threshold: int,
169
170
  threads: int,
170
- table: str,
171
+ layer: str,
171
172
  geom_col: str,
172
173
  tempdir: Union[str, Path],
173
174
  overwrite: bool,
@@ -205,7 +206,7 @@ def rhp(
205
206
  cut_crs=cut_crs,
206
207
  id_field=id_field,
207
208
  con=con,
208
- table=table,
209
+ layer=layer,
209
210
  geom_col=geom_col,
210
211
  overwrite=overwrite,
211
212
  )
@@ -232,7 +232,7 @@ def s2_polyfill(df: gpd.GeoDataFrame, level: int) -> pd.DataFrame:
232
232
  @click.option(
233
233
  "-s",
234
234
  "--spatial_sorting",
235
- type=click.Choice(["hilbert", "morton", "geohash"]),
235
+ type=click.Choice(const.SPATIAL_SORTING_METHODS),
236
236
  default=const.DEFAULTS["s"],
237
237
  help="Spatial sorting method when perfoming spatial partitioning.",
238
238
  )
@@ -264,12 +264,12 @@ def s2_polyfill(df: gpd.GeoDataFrame, level: int) -> pd.DataFrame:
264
264
  nargs=1,
265
265
  )
266
266
  @click.option(
267
- "-tbl",
268
- "--table",
267
+ "-lyr",
268
+ "--layer",
269
269
  required=False,
270
- default=const.DEFAULTS["tbl"],
270
+ default=const.DEFAULTS["lyr"],
271
271
  type=str,
272
- help="Name of the table to read when using a spatial database connection as input",
272
+ help="Name of the layer or table to read when using an input that supports layers or tables",
273
273
  nargs=1,
274
274
  )
275
275
  @click.option(
@@ -301,7 +301,7 @@ def s2(
301
301
  cut_crs: int,
302
302
  cut_threshold: int,
303
303
  threads: int,
304
- table: str,
304
+ layer: str,
305
305
  geom_col: str,
306
306
  tempdir: Union[str, Path],
307
307
  overwrite: bool,
@@ -339,7 +339,7 @@ def s2(
339
339
  cut_crs=cut_crs,
340
340
  id_field=id_field,
341
341
  con=con,
342
- table=table,
342
+ layer=layer,
343
343
  geom_col=geom_col,
344
344
  overwrite=overwrite,
345
345
  )
@@ -1 +0,0 @@
1
- __version__: str = "0.8.0"
File without changes
File without changes