ssb-sgis 1.1.14__tar.gz → 1.1.16__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.
Files changed (65) hide show
  1. {ssb_sgis-1.1.14 → ssb_sgis-1.1.16}/PKG-INFO +1 -1
  2. {ssb_sgis-1.1.14 → ssb_sgis-1.1.16}/pyproject.toml +1 -1
  3. {ssb_sgis-1.1.14 → ssb_sgis-1.1.16}/src/sgis/geopandas_tools/cleaning.py +7 -2
  4. {ssb_sgis-1.1.14 → ssb_sgis-1.1.16}/src/sgis/geopandas_tools/polygon_operations.py +8 -7
  5. {ssb_sgis-1.1.14 → ssb_sgis-1.1.16}/src/sgis/maps/maps.py +1 -1
  6. {ssb_sgis-1.1.14 → ssb_sgis-1.1.16}/src/sgis/raster/image_collection.py +0 -7
  7. {ssb_sgis-1.1.14 → ssb_sgis-1.1.16}/LICENSE +0 -0
  8. {ssb_sgis-1.1.14 → ssb_sgis-1.1.16}/README.md +0 -0
  9. {ssb_sgis-1.1.14 → ssb_sgis-1.1.16}/src/sgis/__init__.py +0 -0
  10. {ssb_sgis-1.1.14 → ssb_sgis-1.1.16}/src/sgis/conf.py +0 -0
  11. {ssb_sgis-1.1.14 → ssb_sgis-1.1.16}/src/sgis/debug_config.py +0 -0
  12. {ssb_sgis-1.1.14 → ssb_sgis-1.1.16}/src/sgis/exceptions.py +0 -0
  13. {ssb_sgis-1.1.14 → ssb_sgis-1.1.16}/src/sgis/geopandas_tools/__init__.py +0 -0
  14. {ssb_sgis-1.1.14 → ssb_sgis-1.1.16}/src/sgis/geopandas_tools/bounds.py +0 -0
  15. {ssb_sgis-1.1.14 → ssb_sgis-1.1.16}/src/sgis/geopandas_tools/buffer_dissolve_explode.py +0 -0
  16. {ssb_sgis-1.1.14 → ssb_sgis-1.1.16}/src/sgis/geopandas_tools/centerlines.py +0 -0
  17. {ssb_sgis-1.1.14 → ssb_sgis-1.1.16}/src/sgis/geopandas_tools/conversion.py +0 -0
  18. {ssb_sgis-1.1.14 → ssb_sgis-1.1.16}/src/sgis/geopandas_tools/duplicates.py +0 -0
  19. {ssb_sgis-1.1.14 → ssb_sgis-1.1.16}/src/sgis/geopandas_tools/general.py +0 -0
  20. {ssb_sgis-1.1.14 → ssb_sgis-1.1.16}/src/sgis/geopandas_tools/geocoding.py +0 -0
  21. {ssb_sgis-1.1.14 → ssb_sgis-1.1.16}/src/sgis/geopandas_tools/geometry_types.py +0 -0
  22. {ssb_sgis-1.1.14 → ssb_sgis-1.1.16}/src/sgis/geopandas_tools/neighbors.py +0 -0
  23. {ssb_sgis-1.1.14 → ssb_sgis-1.1.16}/src/sgis/geopandas_tools/overlay.py +0 -0
  24. {ssb_sgis-1.1.14 → ssb_sgis-1.1.16}/src/sgis/geopandas_tools/point_operations.py +0 -0
  25. {ssb_sgis-1.1.14 → ssb_sgis-1.1.16}/src/sgis/geopandas_tools/polygons_as_rings.py +0 -0
  26. {ssb_sgis-1.1.14 → ssb_sgis-1.1.16}/src/sgis/geopandas_tools/sfilter.py +0 -0
  27. {ssb_sgis-1.1.14 → ssb_sgis-1.1.16}/src/sgis/helpers.py +0 -0
  28. {ssb_sgis-1.1.14 → ssb_sgis-1.1.16}/src/sgis/io/__init__.py +0 -0
  29. {ssb_sgis-1.1.14 → ssb_sgis-1.1.16}/src/sgis/io/_is_dapla.py +0 -0
  30. {ssb_sgis-1.1.14 → ssb_sgis-1.1.16}/src/sgis/io/dapla_functions.py +0 -0
  31. {ssb_sgis-1.1.14 → ssb_sgis-1.1.16}/src/sgis/io/opener.py +0 -0
  32. {ssb_sgis-1.1.14 → ssb_sgis-1.1.16}/src/sgis/io/read_parquet.py +0 -0
  33. {ssb_sgis-1.1.14 → ssb_sgis-1.1.16}/src/sgis/maps/__init__.py +0 -0
  34. {ssb_sgis-1.1.14 → ssb_sgis-1.1.16}/src/sgis/maps/examine.py +0 -0
  35. {ssb_sgis-1.1.14 → ssb_sgis-1.1.16}/src/sgis/maps/explore.py +0 -0
  36. {ssb_sgis-1.1.14 → ssb_sgis-1.1.16}/src/sgis/maps/httpserver.py +0 -0
  37. {ssb_sgis-1.1.14 → ssb_sgis-1.1.16}/src/sgis/maps/legend.py +0 -0
  38. {ssb_sgis-1.1.14 → ssb_sgis-1.1.16}/src/sgis/maps/map.py +0 -0
  39. {ssb_sgis-1.1.14 → ssb_sgis-1.1.16}/src/sgis/maps/norge_i_bilder.json +0 -0
  40. {ssb_sgis-1.1.14 → ssb_sgis-1.1.16}/src/sgis/maps/thematicmap.py +0 -0
  41. {ssb_sgis-1.1.14 → ssb_sgis-1.1.16}/src/sgis/maps/tilesources.py +0 -0
  42. {ssb_sgis-1.1.14 → ssb_sgis-1.1.16}/src/sgis/maps/wms.py +0 -0
  43. {ssb_sgis-1.1.14 → ssb_sgis-1.1.16}/src/sgis/networkanalysis/__init__.py +0 -0
  44. {ssb_sgis-1.1.14 → ssb_sgis-1.1.16}/src/sgis/networkanalysis/_get_route.py +0 -0
  45. {ssb_sgis-1.1.14 → ssb_sgis-1.1.16}/src/sgis/networkanalysis/_od_cost_matrix.py +0 -0
  46. {ssb_sgis-1.1.14 → ssb_sgis-1.1.16}/src/sgis/networkanalysis/_points.py +0 -0
  47. {ssb_sgis-1.1.14 → ssb_sgis-1.1.16}/src/sgis/networkanalysis/_service_area.py +0 -0
  48. {ssb_sgis-1.1.14 → ssb_sgis-1.1.16}/src/sgis/networkanalysis/closing_network_holes.py +0 -0
  49. {ssb_sgis-1.1.14 → ssb_sgis-1.1.16}/src/sgis/networkanalysis/cutting_lines.py +0 -0
  50. {ssb_sgis-1.1.14 → ssb_sgis-1.1.16}/src/sgis/networkanalysis/directednetwork.py +0 -0
  51. {ssb_sgis-1.1.14 → ssb_sgis-1.1.16}/src/sgis/networkanalysis/finding_isolated_networks.py +0 -0
  52. {ssb_sgis-1.1.14 → ssb_sgis-1.1.16}/src/sgis/networkanalysis/network.py +0 -0
  53. {ssb_sgis-1.1.14 → ssb_sgis-1.1.16}/src/sgis/networkanalysis/networkanalysis.py +0 -0
  54. {ssb_sgis-1.1.14 → ssb_sgis-1.1.16}/src/sgis/networkanalysis/networkanalysisrules.py +0 -0
  55. {ssb_sgis-1.1.14 → ssb_sgis-1.1.16}/src/sgis/networkanalysis/nodes.py +0 -0
  56. {ssb_sgis-1.1.14 → ssb_sgis-1.1.16}/src/sgis/networkanalysis/traveling_salesman.py +0 -0
  57. {ssb_sgis-1.1.14 → ssb_sgis-1.1.16}/src/sgis/parallel/__init__.py +0 -0
  58. {ssb_sgis-1.1.14 → ssb_sgis-1.1.16}/src/sgis/parallel/parallel.py +0 -0
  59. {ssb_sgis-1.1.14 → ssb_sgis-1.1.16}/src/sgis/py.typed +0 -0
  60. {ssb_sgis-1.1.14 → ssb_sgis-1.1.16}/src/sgis/raster/__init__.py +0 -0
  61. {ssb_sgis-1.1.14 → ssb_sgis-1.1.16}/src/sgis/raster/base.py +0 -0
  62. {ssb_sgis-1.1.14 → ssb_sgis-1.1.16}/src/sgis/raster/indices.py +0 -0
  63. {ssb_sgis-1.1.14 → ssb_sgis-1.1.16}/src/sgis/raster/regex.py +0 -0
  64. {ssb_sgis-1.1.14 → ssb_sgis-1.1.16}/src/sgis/raster/sentinel_config.py +0 -0
  65. {ssb_sgis-1.1.14 → ssb_sgis-1.1.16}/src/sgis/raster/zonal.py +0 -0
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: ssb-sgis
3
- Version: 1.1.14
3
+ Version: 1.1.16
4
4
  Summary: GIS functions used at Statistics Norway.
5
5
  Home-page: https://github.com/statisticsnorway/ssb-sgis
6
6
  License: MIT
@@ -1,6 +1,6 @@
1
1
  [tool.poetry]
2
2
  name = "ssb-sgis"
3
- version = "1.1.14"
3
+ version = "1.1.16"
4
4
  description = "GIS functions used at Statistics Norway."
5
5
  authors = ["Morten Letnes <morten.letnes@ssb.no>"]
6
6
  license = "MIT"
@@ -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(sort_small_first)
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(df, buffered, how="identity", grid_size=grid_size)
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]:
@@ -205,9 +205,9 @@ def get_polygon_clusters(
205
205
 
206
206
  def get_cluster_mapper(
207
207
  gdf: GeoDataFrame | GeoSeries, predicate: str = "intersects"
208
- ) -> dict[int, int]:
209
- if not gdf.index.is_unique:
210
- raise ValueError("Index must be unique")
208
+ ) -> list[int]:
209
+ """Returns a list of cluster indices corresponding to the order of the input GeoDataFrame or GeoSeries."""
210
+ gdf = gdf.reset_index(drop=True)
211
211
  neighbors = get_neighbor_indices(gdf, gdf, predicate=predicate)
212
212
 
213
213
  edges = [(source, target) for source, target in neighbors.items()]
@@ -215,11 +215,12 @@ def get_cluster_mapper(
215
215
  graph = nx.Graph()
216
216
  graph.add_edges_from(edges)
217
217
 
218
- return {
219
- j: i
220
- for i, component in enumerate(nx.connected_components(graph))
221
- for j in component
218
+ mapper = {
219
+ i: cluster_index
220
+ for cluster_index, component in enumerate(nx.connected_components(graph))
221
+ for i in component
222
222
  }
223
+ return list(dict(sorted(mapper.items())).values())
223
224
 
224
225
 
225
226
  def eliminate_by_longest(
@@ -164,7 +164,7 @@ def explore(
164
164
 
165
165
  mask = kwargs.pop("mask", loc_mask)
166
166
 
167
- if mask is not None:
167
+ if mask is not None and center is None:
168
168
  return clipmap(
169
169
  *gdfs,
170
170
  column=column,
@@ -897,9 +897,6 @@ class Band(_ImageBandBase):
897
897
  if self._bounds is None:
898
898
  raise ValueError("Must specify bounds when data is an array.")
899
899
  if not (res is None or (callable(res) and res() is None)):
900
- # if not (res is None or (callable(res) and res() is None)) and _res_as_tuple(
901
- # res
902
- # ) != _get_res_from_bounds(self._bounds, data.shape):
903
900
  raise ValueError(
904
901
  f"Cannot specify 'res' when data is an array. {res} and {_get_res_from_bounds(self._bounds, data.shape)}"
905
902
  )
@@ -934,10 +931,6 @@ class Band(_ImageBandBase):
934
931
 
935
932
  if self.metadata:
936
933
  parent = _fix_path(str(Path(self.path).parent))
937
- if self.path is not None:
938
- self.metadata = {
939
- key: value for key, value in self.metadata.items() if key == parent
940
- }
941
934
  for key, value in self.metadata.get(parent, {}).items():
942
935
  if key == "bands" and self.band_id in value:
943
936
  band_metadata = value[self.band_id]
File without changes
File without changes
File without changes
File without changes
File without changes