ssb-sgis 1.1.15__tar.gz → 1.1.17__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.
- {ssb_sgis-1.1.15 → ssb_sgis-1.1.17}/PKG-INFO +1 -1
- {ssb_sgis-1.1.15 → ssb_sgis-1.1.17}/pyproject.toml +1 -1
- {ssb_sgis-1.1.15 → ssb_sgis-1.1.17}/src/sgis/geopandas_tools/cleaning.py +7 -2
- {ssb_sgis-1.1.15 → ssb_sgis-1.1.17}/src/sgis/geopandas_tools/duplicates.py +3 -0
- {ssb_sgis-1.1.15 → ssb_sgis-1.1.17}/src/sgis/geopandas_tools/overlay.py +13 -4
- {ssb_sgis-1.1.15 → ssb_sgis-1.1.17}/src/sgis/maps/maps.py +1 -1
- {ssb_sgis-1.1.15 → ssb_sgis-1.1.17}/LICENSE +0 -0
- {ssb_sgis-1.1.15 → ssb_sgis-1.1.17}/README.md +0 -0
- {ssb_sgis-1.1.15 → ssb_sgis-1.1.17}/src/sgis/__init__.py +0 -0
- {ssb_sgis-1.1.15 → ssb_sgis-1.1.17}/src/sgis/conf.py +0 -0
- {ssb_sgis-1.1.15 → ssb_sgis-1.1.17}/src/sgis/debug_config.py +0 -0
- {ssb_sgis-1.1.15 → ssb_sgis-1.1.17}/src/sgis/exceptions.py +0 -0
- {ssb_sgis-1.1.15 → ssb_sgis-1.1.17}/src/sgis/geopandas_tools/__init__.py +0 -0
- {ssb_sgis-1.1.15 → ssb_sgis-1.1.17}/src/sgis/geopandas_tools/bounds.py +0 -0
- {ssb_sgis-1.1.15 → ssb_sgis-1.1.17}/src/sgis/geopandas_tools/buffer_dissolve_explode.py +0 -0
- {ssb_sgis-1.1.15 → ssb_sgis-1.1.17}/src/sgis/geopandas_tools/centerlines.py +0 -0
- {ssb_sgis-1.1.15 → ssb_sgis-1.1.17}/src/sgis/geopandas_tools/conversion.py +0 -0
- {ssb_sgis-1.1.15 → ssb_sgis-1.1.17}/src/sgis/geopandas_tools/general.py +0 -0
- {ssb_sgis-1.1.15 → ssb_sgis-1.1.17}/src/sgis/geopandas_tools/geocoding.py +0 -0
- {ssb_sgis-1.1.15 → ssb_sgis-1.1.17}/src/sgis/geopandas_tools/geometry_types.py +0 -0
- {ssb_sgis-1.1.15 → ssb_sgis-1.1.17}/src/sgis/geopandas_tools/neighbors.py +0 -0
- {ssb_sgis-1.1.15 → ssb_sgis-1.1.17}/src/sgis/geopandas_tools/point_operations.py +0 -0
- {ssb_sgis-1.1.15 → ssb_sgis-1.1.17}/src/sgis/geopandas_tools/polygon_operations.py +0 -0
- {ssb_sgis-1.1.15 → ssb_sgis-1.1.17}/src/sgis/geopandas_tools/polygons_as_rings.py +0 -0
- {ssb_sgis-1.1.15 → ssb_sgis-1.1.17}/src/sgis/geopandas_tools/sfilter.py +0 -0
- {ssb_sgis-1.1.15 → ssb_sgis-1.1.17}/src/sgis/helpers.py +0 -0
- {ssb_sgis-1.1.15 → ssb_sgis-1.1.17}/src/sgis/io/__init__.py +0 -0
- {ssb_sgis-1.1.15 → ssb_sgis-1.1.17}/src/sgis/io/_is_dapla.py +0 -0
- {ssb_sgis-1.1.15 → ssb_sgis-1.1.17}/src/sgis/io/dapla_functions.py +0 -0
- {ssb_sgis-1.1.15 → ssb_sgis-1.1.17}/src/sgis/io/opener.py +0 -0
- {ssb_sgis-1.1.15 → ssb_sgis-1.1.17}/src/sgis/io/read_parquet.py +0 -0
- {ssb_sgis-1.1.15 → ssb_sgis-1.1.17}/src/sgis/maps/__init__.py +0 -0
- {ssb_sgis-1.1.15 → ssb_sgis-1.1.17}/src/sgis/maps/examine.py +0 -0
- {ssb_sgis-1.1.15 → ssb_sgis-1.1.17}/src/sgis/maps/explore.py +0 -0
- {ssb_sgis-1.1.15 → ssb_sgis-1.1.17}/src/sgis/maps/httpserver.py +0 -0
- {ssb_sgis-1.1.15 → ssb_sgis-1.1.17}/src/sgis/maps/legend.py +0 -0
- {ssb_sgis-1.1.15 → ssb_sgis-1.1.17}/src/sgis/maps/map.py +0 -0
- {ssb_sgis-1.1.15 → ssb_sgis-1.1.17}/src/sgis/maps/norge_i_bilder.json +0 -0
- {ssb_sgis-1.1.15 → ssb_sgis-1.1.17}/src/sgis/maps/thematicmap.py +0 -0
- {ssb_sgis-1.1.15 → ssb_sgis-1.1.17}/src/sgis/maps/tilesources.py +0 -0
- {ssb_sgis-1.1.15 → ssb_sgis-1.1.17}/src/sgis/maps/wms.py +0 -0
- {ssb_sgis-1.1.15 → ssb_sgis-1.1.17}/src/sgis/networkanalysis/__init__.py +0 -0
- {ssb_sgis-1.1.15 → ssb_sgis-1.1.17}/src/sgis/networkanalysis/_get_route.py +0 -0
- {ssb_sgis-1.1.15 → ssb_sgis-1.1.17}/src/sgis/networkanalysis/_od_cost_matrix.py +0 -0
- {ssb_sgis-1.1.15 → ssb_sgis-1.1.17}/src/sgis/networkanalysis/_points.py +0 -0
- {ssb_sgis-1.1.15 → ssb_sgis-1.1.17}/src/sgis/networkanalysis/_service_area.py +0 -0
- {ssb_sgis-1.1.15 → ssb_sgis-1.1.17}/src/sgis/networkanalysis/closing_network_holes.py +0 -0
- {ssb_sgis-1.1.15 → ssb_sgis-1.1.17}/src/sgis/networkanalysis/cutting_lines.py +0 -0
- {ssb_sgis-1.1.15 → ssb_sgis-1.1.17}/src/sgis/networkanalysis/directednetwork.py +0 -0
- {ssb_sgis-1.1.15 → ssb_sgis-1.1.17}/src/sgis/networkanalysis/finding_isolated_networks.py +0 -0
- {ssb_sgis-1.1.15 → ssb_sgis-1.1.17}/src/sgis/networkanalysis/network.py +0 -0
- {ssb_sgis-1.1.15 → ssb_sgis-1.1.17}/src/sgis/networkanalysis/networkanalysis.py +0 -0
- {ssb_sgis-1.1.15 → ssb_sgis-1.1.17}/src/sgis/networkanalysis/networkanalysisrules.py +0 -0
- {ssb_sgis-1.1.15 → ssb_sgis-1.1.17}/src/sgis/networkanalysis/nodes.py +0 -0
- {ssb_sgis-1.1.15 → ssb_sgis-1.1.17}/src/sgis/networkanalysis/traveling_salesman.py +0 -0
- {ssb_sgis-1.1.15 → ssb_sgis-1.1.17}/src/sgis/parallel/__init__.py +0 -0
- {ssb_sgis-1.1.15 → ssb_sgis-1.1.17}/src/sgis/parallel/parallel.py +0 -0
- {ssb_sgis-1.1.15 → ssb_sgis-1.1.17}/src/sgis/py.typed +0 -0
- {ssb_sgis-1.1.15 → ssb_sgis-1.1.17}/src/sgis/raster/__init__.py +0 -0
- {ssb_sgis-1.1.15 → ssb_sgis-1.1.17}/src/sgis/raster/base.py +0 -0
- {ssb_sgis-1.1.15 → ssb_sgis-1.1.17}/src/sgis/raster/image_collection.py +0 -0
- {ssb_sgis-1.1.15 → ssb_sgis-1.1.17}/src/sgis/raster/indices.py +0 -0
- {ssb_sgis-1.1.15 → ssb_sgis-1.1.17}/src/sgis/raster/regex.py +0 -0
- {ssb_sgis-1.1.15 → ssb_sgis-1.1.17}/src/sgis/raster/sentinel_config.py +0 -0
- {ssb_sgis-1.1.15 → ssb_sgis-1.1.17}/src/sgis/raster/zonal.py +0 -0
|
@@ -480,7 +480,9 @@ def _dissolve_thick_double_and_update(gdf, double, thin_double):
|
|
|
480
480
|
.pipe(update_geometries, geom_type="polygon")
|
|
481
481
|
)
|
|
482
482
|
return (
|
|
483
|
-
clean_overlay(gdf, large, how="update").pipe(
|
|
483
|
+
clean_overlay(gdf, large, how="update", geom_type="polygon").pipe(
|
|
484
|
+
sort_small_first
|
|
485
|
+
)
|
|
484
486
|
# .sort_values("_poly_idx")
|
|
485
487
|
.pipe(update_geometries, geom_type="polygon")
|
|
486
488
|
)
|
|
@@ -601,6 +603,7 @@ def split_by_neighbors(df, split_by, tolerance, grid_size=None) -> GeoDataFrame:
|
|
|
601
603
|
buff(df, tolerance),
|
|
602
604
|
how="identity",
|
|
603
605
|
grid_size=grid_size,
|
|
606
|
+
geom_type="polygon",
|
|
604
607
|
)
|
|
605
608
|
.pipe(get_line_segments)
|
|
606
609
|
.reset_index(drop=True)
|
|
@@ -621,7 +624,9 @@ def split_by_neighbors(df, split_by, tolerance, grid_size=None) -> GeoDataFrame:
|
|
|
621
624
|
|
|
622
625
|
buffered = buff(extended_lines, tolerance, single_sided=True)
|
|
623
626
|
|
|
624
|
-
return clean_overlay(
|
|
627
|
+
return clean_overlay(
|
|
628
|
+
df, buffered, how="identity", geom_type="polygon", grid_size=grid_size
|
|
629
|
+
)
|
|
625
630
|
|
|
626
631
|
|
|
627
632
|
def extend_lines(arr1, arr2, distance) -> NDArray[LineString]:
|
|
@@ -98,6 +98,9 @@ def update_geometries(
|
|
|
98
98
|
if len(gdf) <= 1:
|
|
99
99
|
return gdf
|
|
100
100
|
|
|
101
|
+
if geom_type == "polygon" or get_geom_type(gdf) == "polygon":
|
|
102
|
+
gdf.geometry = gdf.buffer(0)
|
|
103
|
+
|
|
101
104
|
copied = make_all_singlepart(clean_geoms(gdf))
|
|
102
105
|
|
|
103
106
|
copied, geom_type, keep_geom_type = _determine_geom_type_args(
|
|
@@ -119,6 +119,11 @@ def clean_overlay(
|
|
|
119
119
|
df1.geometry.geom_type.value_counts(),
|
|
120
120
|
)
|
|
121
121
|
|
|
122
|
+
if geom_type == "polygon" or get_geom_type(df1) == "polygon":
|
|
123
|
+
df1.geometry = df1.buffer(0)
|
|
124
|
+
if geom_type == "polygon" or get_geom_type(df2) == "polygon":
|
|
125
|
+
df2.geometry = df2.buffer(0)
|
|
126
|
+
|
|
122
127
|
df1 = clean_geoms(df1)
|
|
123
128
|
df2 = clean_geoms(df2)
|
|
124
129
|
|
|
@@ -131,10 +136,14 @@ def clean_overlay(
|
|
|
131
136
|
if geom_type and get_geom_type(df1) == get_geom_type(df2):
|
|
132
137
|
df2 = to_single_geom_type(df2, geom_type)
|
|
133
138
|
|
|
134
|
-
assert df1.is_valid.all(),
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
assert df2.
|
|
139
|
+
assert df1.is_valid.all(), [
|
|
140
|
+
geom.wkt for geom in df1[lambda x: x.is_valid == False].geometry
|
|
141
|
+
]
|
|
142
|
+
assert df2.is_valid.all(), [
|
|
143
|
+
geom.wkt for geom in df2[lambda x: x.is_valid == False].geometry
|
|
144
|
+
]
|
|
145
|
+
assert df1.geometry.notna().all(), df1[lambda x: x.isna()]
|
|
146
|
+
assert df2.geometry.notna().all(), df2[lambda x: x.isna()]
|
|
138
147
|
|
|
139
148
|
box1 = box(*df1.total_bounds)
|
|
140
149
|
box2 = box(*df2.total_bounds)
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|