Skip to content

Commit 4ac5ecc

Browse files
committed
Rebase
1 parent ce55ece commit 4ac5ecc

File tree

2 files changed

+0
-56
lines changed

2 files changed

+0
-56
lines changed

knime_extension/geospatial_env.yml

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,6 +34,5 @@ dependencies:
3434
- pip=23.2.1
3535
- pygeoda=0.0.8
3636
- pointpats=2.3.0
37-
- h3-py=3.7.6
3837
- pip:
3938
- ipinfo==4.4.3

knime_extension/src/nodes/spatialtool.py

Lines changed: 0 additions & 55 deletions
Original file line numberDiff line numberDiff line change
@@ -1209,7 +1209,6 @@ def execute(self, exec_context: knext.ExecutionContext, input_table):
12091209
)
12101210
@knext.input_table(
12111211
name="Input Table",
1212-
<<<<<<< Upstream, based on main
12131212
description="Input table with the geometry to fill with the H3 grid.",
12141213
)
12151214
@knext.output_table(
@@ -1286,60 +1285,6 @@ def execute(self, exec_context: knext.ExecutionContext, input_table):
12861285
geometry=[
12871286
Polygon(h3.h3_to_geo_boundary(h3_hex, geo_json=True))
12881287
for h3_hex in h3_hexes
1289-
=======
1290-
description="Input table of Create H3 Grid, should be a polygon with WGS-84/EPSG:4326 projection",
1291-
)
1292-
@knext.output_table(
1293-
name="Output Table",
1294-
description="Output table of Created H3 Grid",
1295-
)
1296-
class CreateH3Grid:
1297-
"""Create H3 Grid node.
1298-
This node creates hexagonal grid inside the input polygon using [H3](https://h3geo.org/).
1299-
"""
1300-
1301-
geo_col = knut.geo_col_parameter()
1302-
1303-
zoom = knext.IntParameter(
1304-
"Zoom",
1305-
"The zoom level of the grid from 0 to 15. Default value is 8, the bigger the zoom level, the smaller the hexagon. If the zoom level is too small, the hexagon will be too big to fit in the input polygon, and it can cause error.",
1306-
default_value=8,
1307-
)
1308-
1309-
_COL_ID = "Grid ID"
1310-
_COL_GEOMETRY = "geometry"
1311-
1312-
def configure(self, configure_context, input_schema):
1313-
self.geo_col = knut.column_exists_or_preset(
1314-
configure_context, self.geo_col, input_schema, knut.is_geo
1315-
)
1316-
return None
1317-
1318-
def execute(self, exec_context: knext.ExecutionContext, input_table):
1319-
import h3
1320-
from shapely.geometry import Polygon
1321-
import geopandas as gpd
1322-
import pandas as pd
1323-
1324-
gdf_boundary = knut.load_geo_data_frame(input_table, self.geo_col, exec_context)
1325-
1326-
h3_hexes = h3.polyfill_geojson(
1327-
gdf_boundary.geometry.__geo_interface__["features"][0]["geometry"],
1328-
self.zoom,
1329-
)
1330-
grid = gpd.GeoDataFrame(
1331-
pd.DataFrame(h3_hexes, columns=["h3_hex"]),
1332-
geometry=[
1333-
Polygon(h3.h3_to_geo_boundary(h3_hex, geo_json=True))
1334-
<<<<<<< Upstream, based on main
1335-
for h3_hex in h3.polyfill_geojson(
1336-
gdf_boundary.geometry.__geo_interface__["features"][0]["geometry"],
1337-
self.zoom,
1338-
)
1339-
>>>>>>> 3b2b1a2 add h3 grid
1340-
=======
1341-
for h3_hex in h3_hexes
1342-
>>>>>>> 65cd1d3 add h3 hex
13431288
],
13441289
crs=gdf_boundary.crs,
13451290
)

0 commit comments

Comments
 (0)