ssb-sgis 1.0.1__py3-none-any.whl → 1.0.3__py3-none-any.whl

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 (60) hide show
  1. sgis/__init__.py +107 -121
  2. sgis/exceptions.py +5 -3
  3. sgis/geopandas_tools/__init__.py +1 -0
  4. sgis/geopandas_tools/bounds.py +86 -47
  5. sgis/geopandas_tools/buffer_dissolve_explode.py +62 -39
  6. sgis/geopandas_tools/centerlines.py +53 -44
  7. sgis/geopandas_tools/cleaning.py +87 -104
  8. sgis/geopandas_tools/conversion.py +164 -107
  9. sgis/geopandas_tools/duplicates.py +33 -19
  10. sgis/geopandas_tools/general.py +84 -52
  11. sgis/geopandas_tools/geometry_types.py +24 -10
  12. sgis/geopandas_tools/neighbors.py +23 -11
  13. sgis/geopandas_tools/overlay.py +136 -53
  14. sgis/geopandas_tools/point_operations.py +11 -10
  15. sgis/geopandas_tools/polygon_operations.py +53 -61
  16. sgis/geopandas_tools/polygons_as_rings.py +121 -78
  17. sgis/geopandas_tools/sfilter.py +17 -17
  18. sgis/helpers.py +116 -58
  19. sgis/io/dapla_functions.py +32 -23
  20. sgis/io/opener.py +13 -6
  21. sgis/io/read_parquet.py +2 -2
  22. sgis/maps/examine.py +55 -28
  23. sgis/maps/explore.py +471 -112
  24. sgis/maps/httpserver.py +12 -12
  25. sgis/maps/legend.py +285 -134
  26. sgis/maps/map.py +248 -129
  27. sgis/maps/maps.py +123 -119
  28. sgis/maps/thematicmap.py +260 -94
  29. sgis/maps/tilesources.py +3 -8
  30. sgis/networkanalysis/_get_route.py +5 -4
  31. sgis/networkanalysis/_od_cost_matrix.py +44 -1
  32. sgis/networkanalysis/_points.py +10 -4
  33. sgis/networkanalysis/_service_area.py +5 -2
  34. sgis/networkanalysis/closing_network_holes.py +22 -64
  35. sgis/networkanalysis/cutting_lines.py +58 -46
  36. sgis/networkanalysis/directednetwork.py +16 -8
  37. sgis/networkanalysis/finding_isolated_networks.py +6 -5
  38. sgis/networkanalysis/network.py +15 -13
  39. sgis/networkanalysis/networkanalysis.py +79 -61
  40. sgis/networkanalysis/networkanalysisrules.py +21 -17
  41. sgis/networkanalysis/nodes.py +2 -3
  42. sgis/networkanalysis/traveling_salesman.py +6 -3
  43. sgis/parallel/parallel.py +372 -142
  44. sgis/raster/base.py +9 -3
  45. sgis/raster/cube.py +331 -213
  46. sgis/raster/cubebase.py +15 -29
  47. sgis/raster/image_collection.py +2560 -0
  48. sgis/raster/indices.py +17 -12
  49. sgis/raster/raster.py +356 -275
  50. sgis/raster/sentinel_config.py +104 -0
  51. sgis/raster/zonal.py +38 -14
  52. {ssb_sgis-1.0.1.dist-info → ssb_sgis-1.0.3.dist-info}/LICENSE +1 -1
  53. {ssb_sgis-1.0.1.dist-info → ssb_sgis-1.0.3.dist-info}/METADATA +87 -16
  54. ssb_sgis-1.0.3.dist-info/RECORD +61 -0
  55. {ssb_sgis-1.0.1.dist-info → ssb_sgis-1.0.3.dist-info}/WHEEL +1 -1
  56. sgis/raster/bands.py +0 -48
  57. sgis/raster/gradient.py +0 -78
  58. sgis/raster/methods_as_functions.py +0 -124
  59. sgis/raster/torchgeo.py +0 -150
  60. ssb_sgis-1.0.1.dist-info/RECORD +0 -63
sgis/raster/cubebase.py CHANGED
@@ -1,39 +1,25 @@
1
- def _method_as_func(self, method, **kwargs):
2
- return getattr(self, method)(**kwargs)
3
-
4
-
5
- def _raster_from_path(path, raster_type, res, **kwargs):
6
- return raster_type.from_path(path, res=res, **kwargs)
7
-
8
-
9
- def _from_gdf_func(gdf, raster_type, **kwargs):
10
- return raster_type.from_gdf(gdf, **kwargs)
11
-
12
-
13
- def _write_func(raster, path, **kwargs):
14
- raster.write(path, **kwargs)
15
- return raster
16
-
17
-
18
- def _add(raster, scalar):
19
- return raster + scalar
1
+ from collections.abc import Callable
2
+ from pathlib import Path
20
3
 
4
+ from geopandas import GeoDataFrame
21
5
 
22
- def _mul(raster, scalar):
23
- return raster * scalar
6
+ from .raster import Raster
24
7
 
25
8
 
26
- def _sub(raster, scalar):
27
- return raster - scalar
9
+ def _from_gdf_func(gdf: GeoDataFrame, **kwargs) -> Raster:
10
+ return Raster.from_gdf(gdf, **kwargs)
28
11
 
29
12
 
30
- def _truediv(raster, scalar):
31
- return raster / scalar
13
+ def _raster_from_path(path: str, **kwargs) -> Raster:
14
+ return Raster.from_path(path, **kwargs)
32
15
 
33
16
 
34
- def _floordiv(raster, scalar):
35
- return raster // scalar
17
+ def _method_as_func(self: Raster, method: str, **kwargs) -> Callable:
18
+ return getattr(self, method)(**kwargs)
36
19
 
37
20
 
38
- def _pow(raster, scalar):
39
- return raster**scalar
21
+ def _write_func(raster: Raster, folder: str, **kwargs):
22
+ path = str(Path(folder) / Path(raster.name).stem) + ".tif"
23
+ raster.write(path, **kwargs)
24
+ raster.path = path
25
+ return raster