ssb-sgis 1.0.2__py3-none-any.whl → 1.0.4__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.
- sgis/__init__.py +20 -9
- sgis/debug_config.py +24 -0
- sgis/exceptions.py +2 -2
- sgis/geopandas_tools/bounds.py +33 -36
- sgis/geopandas_tools/buffer_dissolve_explode.py +136 -35
- sgis/geopandas_tools/centerlines.py +4 -91
- sgis/geopandas_tools/cleaning.py +1576 -583
- sgis/geopandas_tools/conversion.py +38 -19
- sgis/geopandas_tools/duplicates.py +29 -8
- sgis/geopandas_tools/general.py +263 -100
- sgis/geopandas_tools/geometry_types.py +4 -4
- sgis/geopandas_tools/neighbors.py +19 -15
- sgis/geopandas_tools/overlay.py +2 -2
- sgis/geopandas_tools/point_operations.py +5 -5
- sgis/geopandas_tools/polygon_operations.py +510 -105
- sgis/geopandas_tools/polygons_as_rings.py +40 -8
- sgis/geopandas_tools/sfilter.py +29 -12
- sgis/helpers.py +3 -3
- sgis/io/dapla_functions.py +238 -19
- sgis/io/read_parquet.py +1 -1
- sgis/maps/examine.py +27 -12
- sgis/maps/explore.py +450 -65
- sgis/maps/legend.py +177 -76
- sgis/maps/map.py +206 -103
- sgis/maps/maps.py +178 -105
- sgis/maps/thematicmap.py +243 -83
- sgis/networkanalysis/_service_area.py +6 -1
- sgis/networkanalysis/closing_network_holes.py +2 -2
- sgis/networkanalysis/cutting_lines.py +15 -8
- sgis/networkanalysis/directednetwork.py +1 -1
- sgis/networkanalysis/finding_isolated_networks.py +15 -8
- sgis/networkanalysis/networkanalysis.py +17 -19
- sgis/networkanalysis/networkanalysisrules.py +1 -1
- sgis/networkanalysis/traveling_salesman.py +1 -1
- sgis/parallel/parallel.py +64 -27
- sgis/raster/__init__.py +0 -6
- sgis/raster/base.py +208 -0
- sgis/raster/cube.py +54 -8
- sgis/raster/image_collection.py +3257 -0
- sgis/raster/indices.py +17 -5
- sgis/raster/raster.py +138 -243
- sgis/raster/sentinel_config.py +120 -0
- sgis/raster/zonal.py +0 -1
- {ssb_sgis-1.0.2.dist-info → ssb_sgis-1.0.4.dist-info}/METADATA +6 -7
- ssb_sgis-1.0.4.dist-info/RECORD +62 -0
- sgis/raster/methods_as_functions.py +0 -0
- sgis/raster/torchgeo.py +0 -171
- ssb_sgis-1.0.2.dist-info/RECORD +0 -61
- {ssb_sgis-1.0.2.dist-info → ssb_sgis-1.0.4.dist-info}/LICENSE +0 -0
- {ssb_sgis-1.0.2.dist-info → ssb_sgis-1.0.4.dist-info}/WHEEL +0 -0
sgis/raster/indices.py
CHANGED
|
@@ -7,7 +7,19 @@ from .raster import Raster
|
|
|
7
7
|
|
|
8
8
|
|
|
9
9
|
def ndvi(red: np.ndarray, nir: np.ndarray) -> np.ndarray:
|
|
10
|
-
|
|
10
|
+
# normalize red and nir arrays to 0-1 scale if needed
|
|
11
|
+
# if red.max() > 1 and nir.max() > 1:
|
|
12
|
+
# red = red / 255
|
|
13
|
+
# nir = nir / 255
|
|
14
|
+
# elif red.max() > 1 or nir.max() > 1:
|
|
15
|
+
# raise ValueError()
|
|
16
|
+
red = red / 255
|
|
17
|
+
nir = nir / 255
|
|
18
|
+
|
|
19
|
+
ndvi_values = (nir - red) / (nir + red)
|
|
20
|
+
ndvi_values[(red + nir) == 0] = 0
|
|
21
|
+
|
|
22
|
+
return ndvi_values
|
|
11
23
|
|
|
12
24
|
|
|
13
25
|
def gndvi(green: np.ndarray, nir: np.ndarray) -> np.ndarray:
|
|
@@ -70,13 +82,13 @@ def index_calc_pair(
|
|
|
70
82
|
assert isinstance(r1, Raster), r1
|
|
71
83
|
assert isinstance(r2, Raster), r2
|
|
72
84
|
|
|
73
|
-
if r1.
|
|
85
|
+
if r1.values is None:
|
|
74
86
|
r1 = r1.load()
|
|
75
|
-
if r2.
|
|
87
|
+
if r2.values is None:
|
|
76
88
|
r2 = r2.load()
|
|
77
89
|
|
|
78
|
-
r1_arr: np.ndarray = r1.
|
|
79
|
-
r2_arr: np.ndarray = r2.
|
|
90
|
+
r1_arr: np.ndarray = r1.values.astype(np.float16)
|
|
91
|
+
r2_arr: np.ndarray = r2.values.astype(np.float16)
|
|
80
92
|
|
|
81
93
|
out_array = index_formula(r1_arr, r2_arr)
|
|
82
94
|
|