ssb-sgis 1.1.8__tar.gz → 1.1.9__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.8 → ssb_sgis-1.1.9}/PKG-INFO +1 -1
- {ssb_sgis-1.1.8 → ssb_sgis-1.1.9}/pyproject.toml +1 -1
- {ssb_sgis-1.1.8 → ssb_sgis-1.1.9}/src/sgis/geopandas_tools/overlay.py +8 -5
- {ssb_sgis-1.1.8 → ssb_sgis-1.1.9}/src/sgis/io/dapla_functions.py +11 -3
- {ssb_sgis-1.1.8 → ssb_sgis-1.1.9}/src/sgis/maps/explore.py +4 -0
- {ssb_sgis-1.1.8 → ssb_sgis-1.1.9}/src/sgis/maps/map.py +0 -4
- {ssb_sgis-1.1.8 → ssb_sgis-1.1.9}/LICENSE +0 -0
- {ssb_sgis-1.1.8 → ssb_sgis-1.1.9}/README.md +0 -0
- {ssb_sgis-1.1.8 → ssb_sgis-1.1.9}/src/sgis/__init__.py +0 -0
- {ssb_sgis-1.1.8 → ssb_sgis-1.1.9}/src/sgis/conf.py +0 -0
- {ssb_sgis-1.1.8 → ssb_sgis-1.1.9}/src/sgis/debug_config.py +0 -0
- {ssb_sgis-1.1.8 → ssb_sgis-1.1.9}/src/sgis/exceptions.py +0 -0
- {ssb_sgis-1.1.8 → ssb_sgis-1.1.9}/src/sgis/geopandas_tools/__init__.py +0 -0
- {ssb_sgis-1.1.8 → ssb_sgis-1.1.9}/src/sgis/geopandas_tools/bounds.py +0 -0
- {ssb_sgis-1.1.8 → ssb_sgis-1.1.9}/src/sgis/geopandas_tools/buffer_dissolve_explode.py +0 -0
- {ssb_sgis-1.1.8 → ssb_sgis-1.1.9}/src/sgis/geopandas_tools/centerlines.py +0 -0
- {ssb_sgis-1.1.8 → ssb_sgis-1.1.9}/src/sgis/geopandas_tools/cleaning.py +0 -0
- {ssb_sgis-1.1.8 → ssb_sgis-1.1.9}/src/sgis/geopandas_tools/conversion.py +0 -0
- {ssb_sgis-1.1.8 → ssb_sgis-1.1.9}/src/sgis/geopandas_tools/duplicates.py +0 -0
- {ssb_sgis-1.1.8 → ssb_sgis-1.1.9}/src/sgis/geopandas_tools/general.py +0 -0
- {ssb_sgis-1.1.8 → ssb_sgis-1.1.9}/src/sgis/geopandas_tools/geocoding.py +0 -0
- {ssb_sgis-1.1.8 → ssb_sgis-1.1.9}/src/sgis/geopandas_tools/geometry_types.py +0 -0
- {ssb_sgis-1.1.8 → ssb_sgis-1.1.9}/src/sgis/geopandas_tools/neighbors.py +0 -0
- {ssb_sgis-1.1.8 → ssb_sgis-1.1.9}/src/sgis/geopandas_tools/point_operations.py +0 -0
- {ssb_sgis-1.1.8 → ssb_sgis-1.1.9}/src/sgis/geopandas_tools/polygon_operations.py +0 -0
- {ssb_sgis-1.1.8 → ssb_sgis-1.1.9}/src/sgis/geopandas_tools/polygons_as_rings.py +0 -0
- {ssb_sgis-1.1.8 → ssb_sgis-1.1.9}/src/sgis/geopandas_tools/sfilter.py +0 -0
- {ssb_sgis-1.1.8 → ssb_sgis-1.1.9}/src/sgis/helpers.py +0 -0
- {ssb_sgis-1.1.8 → ssb_sgis-1.1.9}/src/sgis/io/__init__.py +0 -0
- {ssb_sgis-1.1.8 → ssb_sgis-1.1.9}/src/sgis/io/_is_dapla.py +0 -0
- {ssb_sgis-1.1.8 → ssb_sgis-1.1.9}/src/sgis/io/opener.py +0 -0
- {ssb_sgis-1.1.8 → ssb_sgis-1.1.9}/src/sgis/io/read_parquet.py +0 -0
- {ssb_sgis-1.1.8 → ssb_sgis-1.1.9}/src/sgis/maps/__init__.py +0 -0
- {ssb_sgis-1.1.8 → ssb_sgis-1.1.9}/src/sgis/maps/examine.py +0 -0
- {ssb_sgis-1.1.8 → ssb_sgis-1.1.9}/src/sgis/maps/httpserver.py +0 -0
- {ssb_sgis-1.1.8 → ssb_sgis-1.1.9}/src/sgis/maps/legend.py +0 -0
- {ssb_sgis-1.1.8 → ssb_sgis-1.1.9}/src/sgis/maps/maps.py +0 -0
- {ssb_sgis-1.1.8 → ssb_sgis-1.1.9}/src/sgis/maps/norge_i_bilder.json +0 -0
- {ssb_sgis-1.1.8 → ssb_sgis-1.1.9}/src/sgis/maps/thematicmap.py +0 -0
- {ssb_sgis-1.1.8 → ssb_sgis-1.1.9}/src/sgis/maps/tilesources.py +0 -0
- {ssb_sgis-1.1.8 → ssb_sgis-1.1.9}/src/sgis/maps/wms.py +0 -0
- {ssb_sgis-1.1.8 → ssb_sgis-1.1.9}/src/sgis/networkanalysis/__init__.py +0 -0
- {ssb_sgis-1.1.8 → ssb_sgis-1.1.9}/src/sgis/networkanalysis/_get_route.py +0 -0
- {ssb_sgis-1.1.8 → ssb_sgis-1.1.9}/src/sgis/networkanalysis/_od_cost_matrix.py +0 -0
- {ssb_sgis-1.1.8 → ssb_sgis-1.1.9}/src/sgis/networkanalysis/_points.py +0 -0
- {ssb_sgis-1.1.8 → ssb_sgis-1.1.9}/src/sgis/networkanalysis/_service_area.py +0 -0
- {ssb_sgis-1.1.8 → ssb_sgis-1.1.9}/src/sgis/networkanalysis/closing_network_holes.py +0 -0
- {ssb_sgis-1.1.8 → ssb_sgis-1.1.9}/src/sgis/networkanalysis/cutting_lines.py +0 -0
- {ssb_sgis-1.1.8 → ssb_sgis-1.1.9}/src/sgis/networkanalysis/directednetwork.py +0 -0
- {ssb_sgis-1.1.8 → ssb_sgis-1.1.9}/src/sgis/networkanalysis/finding_isolated_networks.py +0 -0
- {ssb_sgis-1.1.8 → ssb_sgis-1.1.9}/src/sgis/networkanalysis/network.py +0 -0
- {ssb_sgis-1.1.8 → ssb_sgis-1.1.9}/src/sgis/networkanalysis/networkanalysis.py +0 -0
- {ssb_sgis-1.1.8 → ssb_sgis-1.1.9}/src/sgis/networkanalysis/networkanalysisrules.py +0 -0
- {ssb_sgis-1.1.8 → ssb_sgis-1.1.9}/src/sgis/networkanalysis/nodes.py +0 -0
- {ssb_sgis-1.1.8 → ssb_sgis-1.1.9}/src/sgis/networkanalysis/traveling_salesman.py +0 -0
- {ssb_sgis-1.1.8 → ssb_sgis-1.1.9}/src/sgis/parallel/__init__.py +0 -0
- {ssb_sgis-1.1.8 → ssb_sgis-1.1.9}/src/sgis/parallel/parallel.py +0 -0
- {ssb_sgis-1.1.8 → ssb_sgis-1.1.9}/src/sgis/py.typed +0 -0
- {ssb_sgis-1.1.8 → ssb_sgis-1.1.9}/src/sgis/raster/__init__.py +0 -0
- {ssb_sgis-1.1.8 → ssb_sgis-1.1.9}/src/sgis/raster/base.py +0 -0
- {ssb_sgis-1.1.8 → ssb_sgis-1.1.9}/src/sgis/raster/image_collection.py +0 -0
- {ssb_sgis-1.1.8 → ssb_sgis-1.1.9}/src/sgis/raster/indices.py +0 -0
- {ssb_sgis-1.1.8 → ssb_sgis-1.1.9}/src/sgis/raster/regex.py +0 -0
- {ssb_sgis-1.1.8 → ssb_sgis-1.1.9}/src/sgis/raster/sentinel_config.py +0 -0
- {ssb_sgis-1.1.8 → ssb_sgis-1.1.9}/src/sgis/raster/zonal.py +0 -0
|
@@ -824,11 +824,14 @@ def make_valid_and_keep_geom_type(
|
|
|
824
824
|
geoms = GeoSeries(geoms)
|
|
825
825
|
geoms.index = range(len(geoms))
|
|
826
826
|
geoms.loc[:] = make_valid(geoms.to_numpy())
|
|
827
|
-
|
|
828
|
-
|
|
829
|
-
|
|
830
|
-
|
|
831
|
-
|
|
827
|
+
geoms_with_correct_type = geoms.explode(index_parts=False).pipe(
|
|
828
|
+
to_single_geom_type, geom_type
|
|
829
|
+
)
|
|
830
|
+
only_one = geoms_with_correct_type.groupby(level=0).transform("size") == 1
|
|
831
|
+
one_hit = geoms_with_correct_type[only_one]
|
|
832
|
+
many_hits = geoms_with_correct_type[~only_one].groupby(level=0).agg(unary_union)
|
|
833
|
+
geoms_with_wrong_type = geoms.loc[~geoms.index.isin(geoms_with_correct_type.index)]
|
|
834
|
+
return pd.concat([one_hit, many_hits, geoms_with_wrong_type]).sort_index()
|
|
832
835
|
|
|
833
836
|
|
|
834
837
|
def _agg_geoms(g: np.ndarray, grid_size: int | float | None = None) -> Geometry:
|
|
@@ -240,8 +240,13 @@ def _get_geo_metadata(file, file_system) -> dict:
|
|
|
240
240
|
try:
|
|
241
241
|
meta = pq.read_schema(file).metadata
|
|
242
242
|
except FileNotFoundError:
|
|
243
|
-
|
|
244
|
-
|
|
243
|
+
try:
|
|
244
|
+
with file_system.open(file, "rb") as f:
|
|
245
|
+
meta = pq.read_schema(f).metadata
|
|
246
|
+
except Exception as e:
|
|
247
|
+
raise e.__class__(f"{file}: {e}") from e
|
|
248
|
+
except Exception as e:
|
|
249
|
+
raise e.__class__(f"{file}: {e}") from e
|
|
245
250
|
|
|
246
251
|
return json.loads(meta[b"geo"])
|
|
247
252
|
|
|
@@ -774,7 +779,10 @@ def _read_partitioned_parquet(
|
|
|
774
779
|
|
|
775
780
|
# add columns to empty DataFrame
|
|
776
781
|
first_path = next(iter(child_paths + [path]))
|
|
777
|
-
|
|
782
|
+
df = pd.DataFrame(columns=_get_columns(first_path, file_system))
|
|
783
|
+
if "columns" in kwargs:
|
|
784
|
+
return df[list(kwargs["columns"])]
|
|
785
|
+
return df
|
|
778
786
|
|
|
779
787
|
|
|
780
788
|
def paths_are_equal(path1: Path | str, path2: Path | str) -> bool:
|
|
@@ -263,10 +263,6 @@ class Map:
|
|
|
263
263
|
self._gdfs[i][self.column] = to_string_via_int(gdf[self.column])
|
|
264
264
|
self._gdf[self.column] = to_string_via_int(self._gdf[self.column])
|
|
265
265
|
|
|
266
|
-
# def __getattr__(self, attr: str) -> Any:
|
|
267
|
-
# """Search for attribute in kwargs."""
|
|
268
|
-
# return self.kwargs.get(attr, super().__getattribute__(attr))
|
|
269
|
-
|
|
270
266
|
def __bool__(self) -> bool:
|
|
271
267
|
"""True of any gdfs with more than 0 rows."""
|
|
272
268
|
return bool(len(self._gdfs) + len(self._gdf))
|
|
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
|