ssb-sgis 1.0.2__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.
- sgis/__init__.py +10 -6
- sgis/exceptions.py +2 -2
- sgis/geopandas_tools/bounds.py +17 -15
- sgis/geopandas_tools/buffer_dissolve_explode.py +24 -5
- sgis/geopandas_tools/conversion.py +15 -6
- sgis/geopandas_tools/duplicates.py +2 -2
- sgis/geopandas_tools/general.py +9 -5
- sgis/geopandas_tools/geometry_types.py +3 -3
- sgis/geopandas_tools/neighbors.py +3 -3
- sgis/geopandas_tools/point_operations.py +2 -2
- sgis/geopandas_tools/polygon_operations.py +5 -5
- sgis/geopandas_tools/sfilter.py +3 -3
- sgis/helpers.py +3 -3
- sgis/io/read_parquet.py +1 -1
- sgis/maps/examine.py +16 -2
- sgis/maps/explore.py +370 -57
- sgis/maps/legend.py +164 -72
- sgis/maps/map.py +184 -90
- sgis/maps/maps.py +92 -90
- sgis/maps/thematicmap.py +236 -83
- sgis/networkanalysis/closing_network_holes.py +2 -2
- sgis/networkanalysis/cutting_lines.py +3 -3
- sgis/networkanalysis/directednetwork.py +1 -1
- sgis/networkanalysis/finding_isolated_networks.py +2 -2
- sgis/networkanalysis/networkanalysis.py +7 -7
- sgis/networkanalysis/networkanalysisrules.py +1 -1
- sgis/networkanalysis/traveling_salesman.py +1 -1
- sgis/parallel/parallel.py +39 -19
- sgis/raster/__init__.py +0 -6
- sgis/raster/cube.py +51 -5
- sgis/raster/image_collection.py +2560 -0
- sgis/raster/indices.py +14 -5
- sgis/raster/raster.py +131 -236
- sgis/raster/sentinel_config.py +104 -0
- sgis/raster/zonal.py +0 -1
- {ssb_sgis-1.0.2.dist-info → ssb_sgis-1.0.3.dist-info}/METADATA +1 -1
- ssb_sgis-1.0.3.dist-info/RECORD +61 -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.3.dist-info}/LICENSE +0 -0
- {ssb_sgis-1.0.2.dist-info → ssb_sgis-1.0.3.dist-info}/WHEEL +0 -0
|
@@ -0,0 +1,104 @@
|
|
|
1
|
+
SENTINEL2_FILENAME_REGEX = r"""
|
|
2
|
+
^(?P<tile>T\d{2}[A-Z]{3})
|
|
3
|
+
_(?P<date>\d{8})T\d{6}
|
|
4
|
+
# _(?P<date>\d{8}T\d{6})
|
|
5
|
+
_(?P<band>B[018][\dA])
|
|
6
|
+
(?:_(?P<resolution>\d+)m)?
|
|
7
|
+
.*
|
|
8
|
+
\..*$
|
|
9
|
+
"""
|
|
10
|
+
|
|
11
|
+
SENTINEL2_MOSAIC_FILENAME_REGEX = r"""
|
|
12
|
+
^SENTINEL2X_
|
|
13
|
+
(?P<date>\d{8})
|
|
14
|
+
.*T(?P<tile>\d{2}[A-Z]{3})
|
|
15
|
+
.*(?:_(?P<resolution>{}m))?
|
|
16
|
+
.*(?P<band>B\d{1,2}A|B\d{1,2})
|
|
17
|
+
.*
|
|
18
|
+
.*\..*$
|
|
19
|
+
"""
|
|
20
|
+
|
|
21
|
+
|
|
22
|
+
SENTINEL2_CLOUD_FILENAME_REGEX = r"""
|
|
23
|
+
^(?P<tile>T\d{2}[A-Z]{3})
|
|
24
|
+
_(?P<date>\d{8})T\d{6}
|
|
25
|
+
# _(?P<date>\d{8}T\d{6})
|
|
26
|
+
_(?P<band>SCL)
|
|
27
|
+
(?:_(?P<resolution>\d+)m)?
|
|
28
|
+
.*
|
|
29
|
+
\..*$
|
|
30
|
+
"""
|
|
31
|
+
|
|
32
|
+
SENTINEL2_IMAGE_REGEX = r"""
|
|
33
|
+
^(?P<mission_id>S2[AB])
|
|
34
|
+
_MSI(?P<level>[A-Z]\d{1}[A-Z])
|
|
35
|
+
_(?P<date>\d{8})T\d{6}
|
|
36
|
+
# _(?P<date>\d{8}T\d{6})
|
|
37
|
+
_(?P<baseline>N\d{4})
|
|
38
|
+
_(?P<orbit>R\d{3})
|
|
39
|
+
_(?P<tile>T\d{2}[A-Z]{3})
|
|
40
|
+
_\d{8}T\d{6}
|
|
41
|
+
.*
|
|
42
|
+
.*$
|
|
43
|
+
"""
|
|
44
|
+
|
|
45
|
+
SENTINEL2_MOSAIC_IMAGE_REGEX = r"""
|
|
46
|
+
^SENTINEL2X_
|
|
47
|
+
(?P<date>\d{8})
|
|
48
|
+
-\d{6}
|
|
49
|
+
-\d{3}
|
|
50
|
+
_(?P<level>[A-Z]\d{1}[A-Z])
|
|
51
|
+
.*T(?P<tile>\d{2}[A-Z]{3})
|
|
52
|
+
.*.*$
|
|
53
|
+
"""
|
|
54
|
+
|
|
55
|
+
# multiple regex searches because there are different xml files with same info, but different naming
|
|
56
|
+
CLOUD_COVERAGE_REGEXES: tuple[str] = (
|
|
57
|
+
r"<Cloud_Coverage_Assessment>([\d.]+)</Cloud_Coverage_Assessment>",
|
|
58
|
+
r"<CLOUDY_PIXEL_OVER_LAND_PERCENTAGE>([\d.]+)</CLOUDY_PIXEL_OVER_LAND_PERCENTAGE>",
|
|
59
|
+
)
|
|
60
|
+
|
|
61
|
+
CRS_REGEX: tuple[str] = (r"<HORIZONTAL_CS_CODE>EPSG:(\d+)</HORIZONTAL_CS_CODE>",)
|
|
62
|
+
|
|
63
|
+
BOUNDS_REGEX: tuple[dict[str, str]] = (
|
|
64
|
+
{"minx": r"<ULX>(\d+)</ULX>", "maxy": r"<ULY>(\d+)</ULY>"},
|
|
65
|
+
)
|
|
66
|
+
|
|
67
|
+
|
|
68
|
+
SENTINEL2_L2A_BANDS = {
|
|
69
|
+
"B01": 60,
|
|
70
|
+
"B02": 10,
|
|
71
|
+
"B03": 10,
|
|
72
|
+
"B04": 10,
|
|
73
|
+
"B05": 20,
|
|
74
|
+
"B06": 20,
|
|
75
|
+
"B07": 20,
|
|
76
|
+
"B08": 10,
|
|
77
|
+
"B8A": 20,
|
|
78
|
+
"B09": 60,
|
|
79
|
+
"B11": 20,
|
|
80
|
+
"B12": 20,
|
|
81
|
+
}
|
|
82
|
+
SENTINEL2_L1C_BANDS = SENTINEL2_L2A_BANDS | {"B10": 60}
|
|
83
|
+
SENTINEL2_CLOUD_BANDS = {
|
|
84
|
+
"SCL": 20, # SCL: scene classification
|
|
85
|
+
}
|
|
86
|
+
|
|
87
|
+
SENTINEL2_SCL_CLASSES = {
|
|
88
|
+
0: "No Data (Missing data)", # 000000
|
|
89
|
+
1: "Saturated or defective pixel", # ff0000
|
|
90
|
+
2: "Topographic casted shadows", # 2f2f2f
|
|
91
|
+
3: "Cloud shadows", # 643200
|
|
92
|
+
4: "Vegetation", # 00a000
|
|
93
|
+
5: "Not-vegetated", # ffe65a
|
|
94
|
+
6: "Water", # 0000ff
|
|
95
|
+
7: "Unclassified", # 808080
|
|
96
|
+
8: "Cloud medium probability", # c0c0c0
|
|
97
|
+
9: "Cloud high probability", # ffffff
|
|
98
|
+
10: "Thin cirrus", # 64c8ff
|
|
99
|
+
11: "Snow or ice", # ff96ff
|
|
100
|
+
}
|
|
101
|
+
|
|
102
|
+
SENTINEL2_BANDS = SENTINEL2_L1C_BANDS | SENTINEL2_CLOUD_BANDS
|
|
103
|
+
SENTINEL2_RBG_BANDS = ["B02", "B03", "B04"]
|
|
104
|
+
SENTINEL2_NDVI_BANDS = ["B04", "B08"]
|
sgis/raster/zonal.py
CHANGED
|
@@ -87,7 +87,6 @@ def _clip_and_aggregate(
|
|
|
87
87
|
if not len(cube):
|
|
88
88
|
return _no_overlap_df(func_names, i, date)
|
|
89
89
|
clipped = cube.clipmerge(polygon)
|
|
90
|
-
print(list(clipped))
|
|
91
90
|
if not len(clipped) or [arr is None for arr in clipped.arrays]:
|
|
92
91
|
return _no_overlap_df(func_names, i, date)
|
|
93
92
|
assert len(clipped) == 1
|
|
@@ -0,0 +1,61 @@
|
|
|
1
|
+
sgis/__init__.py,sha256=QwGvKuOVhblqA7Vqy6haMJKl7Yjkbmzb8UnTaIY6pcU,6964
|
|
2
|
+
sgis/exceptions.py,sha256=WNaEBPNNx0rmz-YDzlFX4vIE7ocJQruUTqS2RNAu2zU,660
|
|
3
|
+
sgis/geopandas_tools/__init__.py,sha256=bo8lFMcltOz7TtWAi52_ekR2gd3mjfBfKeMDV5zuqFY,28
|
|
4
|
+
sgis/geopandas_tools/bounds.py,sha256=F1w0V50iMYoBkFmDqyZsOsls2KMeM5DbYWdtEoNkqLI,23975
|
|
5
|
+
sgis/geopandas_tools/buffer_dissolve_explode.py,sha256=w2xApXs8sZoZ9U2FF_4kpQJYZWrgBQ20O2Cw7dXEIFg,18814
|
|
6
|
+
sgis/geopandas_tools/centerlines.py,sha256=qTLUWOAgLT_E7ow4cZjWgwgH2BqaEh-hSQivXQbxWcc,14435
|
|
7
|
+
sgis/geopandas_tools/cleaning.py,sha256=w0puDL7RfIZwWy_wRxXkgfYTHQKZVBxKvAhbjsnAqSY,23772
|
|
8
|
+
sgis/geopandas_tools/conversion.py,sha256=stfaJwRsatF_kyC43NExBSh6h8ChDoM4M7DUc8PIolM,24248
|
|
9
|
+
sgis/geopandas_tools/duplicates.py,sha256=tOepI3dC2fc2N7jJjIESmpgTJtIGGKwTaZwHF1zESFg,13599
|
|
10
|
+
sgis/geopandas_tools/general.py,sha256=ibIaHI6gB3g5ur7FEBKIB-aSv9IbJJ9nO6Fd8d8-vkU,25987
|
|
11
|
+
sgis/geopandas_tools/geocoding.py,sha256=n47aFQMm4yX1MsPnTM4dFjwegCA1ZmGUDj1uyu7OJV4,691
|
|
12
|
+
sgis/geopandas_tools/geometry_types.py,sha256=8iN6bvLOvT8yxfq85hlYBk6OAgTE-sy7N75ZpqjSYKI,7589
|
|
13
|
+
sgis/geopandas_tools/neighbors.py,sha256=6nzuD2A2-Zb8eTlSk1MMt70MH2n7ue_Moa_LEATlGeo,16366
|
|
14
|
+
sgis/geopandas_tools/overlay.py,sha256=yAIpM1Yq9JBjRMhoetxiJXdwpjHF_q4tkYNhatYJQS0,25509
|
|
15
|
+
sgis/geopandas_tools/point_operations.py,sha256=6bzJNJREJFrAVoS8IyjYVOhyjqCakCoBo17v_CDC6sc,6961
|
|
16
|
+
sgis/geopandas_tools/polygon_operations.py,sha256=59Bg4OzbShJD6Ry2To8g_nis1RcW4T5PeS__ctX2XxU,37229
|
|
17
|
+
sgis/geopandas_tools/polygons_as_rings.py,sha256=26_TSB3dyzsPHc4h2RVzhwFVBa9qG1mw9xLGZbNKOMU,13558
|
|
18
|
+
sgis/geopandas_tools/sfilter.py,sha256=Memz45Yqyx2ZeWacYxIbUJyHYdno7v1amVLDhBJXDHo,8656
|
|
19
|
+
sgis/helpers.py,sha256=dscvGAbZyyncZbTL9qdsAHN6tb_T7SbNH7vM4ZrTeJw,8326
|
|
20
|
+
sgis/io/_is_dapla.py,sha256=o_qFD5GOi3dsSGOKmW6R8wZU0htVwFgRbGX7ppJCqT4,431
|
|
21
|
+
sgis/io/dapla_functions.py,sha256=IHB8Nhg90ui_o6IvKx-BjAS3mciruCClL-v-JQNfg4M,8807
|
|
22
|
+
sgis/io/opener.py,sha256=BHyH7L8Ubh9C4Lsb8eBzGI6FLWg8UQFu-1bg3NEy_2k,862
|
|
23
|
+
sgis/io/read_parquet.py,sha256=FvZYv1rLkUlrSaUY6QW6E1yntmntTeQuZ9ZRgCDO4IM,3776
|
|
24
|
+
sgis/maps/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
25
|
+
sgis/maps/examine.py,sha256=En5EdNLle88_Sx3uA0VibMApHFZipezH4sMVP5cqwlc,9263
|
|
26
|
+
sgis/maps/explore.py,sha256=gWBnQCUTQtHK9rkWHErlT4_JjdKdom99i-KLh8otNKc,42853
|
|
27
|
+
sgis/maps/httpserver.py,sha256=7Od9JMCtntcIQKk_TchetojMHzFHT9sPw7GANahI97c,1982
|
|
28
|
+
sgis/maps/legend.py,sha256=pNJ2e_yzoIli69ciggvO6rl6EWf7u7aR3B9TsJokBCA,25974
|
|
29
|
+
sgis/maps/map.py,sha256=RfSoq14PxlYH4Zj6o6HXhRauSrqkrcBat-7cuuNiD1Y,28932
|
|
30
|
+
sgis/maps/maps.py,sha256=7XWm3aEQZl0k9ttMsXULnyHyTldTLlvPWCVPmU0JApo,20497
|
|
31
|
+
sgis/maps/thematicmap.py,sha256=ixogDK_AvBnX87zMtJKqOac4vfEYYl1gVC5BMah5zbs,20568
|
|
32
|
+
sgis/maps/tilesources.py,sha256=aSci-0JURxnqqirIXQS5bHfNEIg3xfCM_B4gXs7GslM,2772
|
|
33
|
+
sgis/networkanalysis/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
34
|
+
sgis/networkanalysis/_get_route.py,sha256=9I3t9pnccUPr4mozy3TJCOpGCCf3UOIojmsbifubZbA,6368
|
|
35
|
+
sgis/networkanalysis/_od_cost_matrix.py,sha256=zkyPX7ObT996ahaFJ2oI0D0SqQWbWyfy_qLtXwValPg,3434
|
|
36
|
+
sgis/networkanalysis/_points.py,sha256=ajCy17dAmRq3bWRkNu_0LHreCVJ5Uh8DzAKWxyw7ipw,4481
|
|
37
|
+
sgis/networkanalysis/_service_area.py,sha256=BzqB8X5X5CGexUwbpP379jEj-ad4mgCzFr8mOa-BsnY,5385
|
|
38
|
+
sgis/networkanalysis/closing_network_holes.py,sha256=EyhsLnjD6omTVgH9HIznukIX-vIOTtkv8_pwUnR6Pvk,12095
|
|
39
|
+
sgis/networkanalysis/cutting_lines.py,sha256=_IHopMhdRgyRKijNZttF07H6rsZoiHzlVBTRO7HJK2Q,15194
|
|
40
|
+
sgis/networkanalysis/directednetwork.py,sha256=Mrc2zHip4P5RNxnyffKm-xU832AVQeSHz-YZueAc0pM,11413
|
|
41
|
+
sgis/networkanalysis/finding_isolated_networks.py,sha256=9WGV7ABv1GE8NFxCUU08wziotjoFUV5Xf_MmTIh1wz4,3384
|
|
42
|
+
sgis/networkanalysis/network.py,sha256=zV9bAbVdTgTohg2o2RFGy2uhOJrd3Ma57hwIAStxMAQ,7847
|
|
43
|
+
sgis/networkanalysis/networkanalysis.py,sha256=hGfjLULCA6VDrabGoKv1_a_wooX4FM0v-27Bqzu6Lv4,68451
|
|
44
|
+
sgis/networkanalysis/networkanalysisrules.py,sha256=9sXigaCzvKhXFwpeVNMtOiIK3_Hzp9yDpFklmEEAPak,12956
|
|
45
|
+
sgis/networkanalysis/nodes.py,sha256=Yo0oWlsZO0Ex2_7lzGGUEiS2Ltfnm5kuCl5MkE2qJhA,6863
|
|
46
|
+
sgis/networkanalysis/traveling_salesman.py,sha256=Jjo6bHY4KJ-eK0LycyTy0sWxZjgITs5MBllZ_G9FhTE,5655
|
|
47
|
+
sgis/parallel/parallel.py,sha256=aK624cE-auJV6dOMBfueBjxiFBXIDC3O5GBGW_02HY8,36711
|
|
48
|
+
sgis/py.typed,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
49
|
+
sgis/raster/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
50
|
+
sgis/raster/base.py,sha256=POu3uZJqygubLGh9t_lQJe8pNKQ9MD9wHubFHC8_nck,1192
|
|
51
|
+
sgis/raster/cube.py,sha256=-GTFS_wJciXoooz8JvqReBdNboqmJIytLeHFonXCn1A,41768
|
|
52
|
+
sgis/raster/cubebase.py,sha256=nao5huLer-nzy792PTZc0CKAMlmedZCe3siWnOf7Duw,639
|
|
53
|
+
sgis/raster/image_collection.py,sha256=yEXvnR4vDTHN_7w7gEzoEnes7k6nzBNmu6q3UBCb8K4,85395
|
|
54
|
+
sgis/raster/indices.py,sha256=AqV3m1qy_sFr6wQKmETatjO6rD68KV1m9WLzx82U4I0,2953
|
|
55
|
+
sgis/raster/raster.py,sha256=kf93A3NIymT4thBQhD5JZ7aPjdchcSfm93pXu4DESPc,50572
|
|
56
|
+
sgis/raster/sentinel_config.py,sha256=-9gL-00uRQkp9-F-PcKLSThDR4TV4hx2iRbVj3DWUaI,2483
|
|
57
|
+
sgis/raster/zonal.py,sha256=st2mWiUcdxeEiHBOZSgFOnVcP6pc4EMPJBPw537Z4V8,3837
|
|
58
|
+
ssb_sgis-1.0.3.dist-info/LICENSE,sha256=np3IfD5m0ZUofn_kVzDZqliozuiO6wrktw3LRPjyEiI,1073
|
|
59
|
+
ssb_sgis-1.0.3.dist-info/METADATA,sha256=XRHE7esl_qnQOw6XZvhlZfuF72cNaRmLVedLvDwqJDg,11780
|
|
60
|
+
ssb_sgis-1.0.3.dist-info/WHEEL,sha256=sP946D7jFCHeNz5Iq4fL4Lu-PrWrFsgfLXbbkciIZwg,88
|
|
61
|
+
ssb_sgis-1.0.3.dist-info/RECORD,,
|
|
File without changes
|
sgis/raster/torchgeo.py
DELETED
|
@@ -1,171 +0,0 @@
|
|
|
1
|
-
import glob
|
|
2
|
-
import os
|
|
3
|
-
import warnings
|
|
4
|
-
from collections.abc import Callable
|
|
5
|
-
from collections.abc import Iterable
|
|
6
|
-
from typing import ClassVar
|
|
7
|
-
|
|
8
|
-
import rasterio
|
|
9
|
-
import rasterio.merge
|
|
10
|
-
from rasterio.io import DatasetReader
|
|
11
|
-
from rasterio.vrt import WarpedVRT
|
|
12
|
-
from torchgeo.datasets.geo import RasterDataset
|
|
13
|
-
from torchgeo.datasets.sentinel import Sentinel2 as TorchgeoSentinel2
|
|
14
|
-
|
|
15
|
-
try:
|
|
16
|
-
import dapla as dp
|
|
17
|
-
except ImportError:
|
|
18
|
-
pass
|
|
19
|
-
|
|
20
|
-
try:
|
|
21
|
-
from dapla.gcs import GCSFileSystem
|
|
22
|
-
except ImportError:
|
|
23
|
-
|
|
24
|
-
class GCSFileSystem:
|
|
25
|
-
"""Placeholder."""
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
try:
|
|
29
|
-
from gcsfs.core import GCSFile
|
|
30
|
-
except ImportError:
|
|
31
|
-
|
|
32
|
-
class GCSFile:
|
|
33
|
-
"""Placeholder."""
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
from ..io._is_dapla import is_dapla
|
|
37
|
-
from ..io.opener import opener
|
|
38
|
-
|
|
39
|
-
SENTINEL2_FILENAME_REGEX = r"""
|
|
40
|
-
^SENTINEL2X_
|
|
41
|
-
(?P<date>\d{8})
|
|
42
|
-
.*T(?P<tile>\d{2}[A-Z]{3})
|
|
43
|
-
.*(?:_(?P<resolution>{}m))?
|
|
44
|
-
.*(?P<band>B\d{1,2}A|B\d{1,2})
|
|
45
|
-
.*\..*$
|
|
46
|
-
"""
|
|
47
|
-
|
|
48
|
-
SENTINEL_2_BANDS = [
|
|
49
|
-
# "B1",
|
|
50
|
-
"B2",
|
|
51
|
-
"B3",
|
|
52
|
-
"B4",
|
|
53
|
-
"B5",
|
|
54
|
-
"B6",
|
|
55
|
-
"B7",
|
|
56
|
-
"B8",
|
|
57
|
-
"B8A",
|
|
58
|
-
# "B9",
|
|
59
|
-
# "B10",
|
|
60
|
-
"B11",
|
|
61
|
-
"B12",
|
|
62
|
-
]
|
|
63
|
-
SENTINEL_2_RBG_BANDS = ["B4", "B3", "B2"]
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
class GCSRasterDataset(RasterDataset):
|
|
67
|
-
"""Wrapper around torchgeo's RasterDataset that works in and outside of Dapla (stat norway)."""
|
|
68
|
-
|
|
69
|
-
def __init__(self, *args, **kwargs) -> None:
|
|
70
|
-
"""Initialiser. Args and kwargs passed to torchgeo.datasets.geo.RasterDataset."""
|
|
71
|
-
super().__init__(*args, **kwargs)
|
|
72
|
-
if is_dapla():
|
|
73
|
-
[file.close() for file in self.files]
|
|
74
|
-
|
|
75
|
-
@property
|
|
76
|
-
def files(self) -> set[GCSFile] | set[str]:
|
|
77
|
-
"""A list of all files in the dataset.
|
|
78
|
-
|
|
79
|
-
Returns:
|
|
80
|
-
All files in the dataset.
|
|
81
|
-
"""
|
|
82
|
-
if isinstance(self.paths, str):
|
|
83
|
-
paths: list[str] = [self.paths]
|
|
84
|
-
else:
|
|
85
|
-
paths = self.paths
|
|
86
|
-
|
|
87
|
-
if is_dapla():
|
|
88
|
-
fs = dp.FileClient.get_gcs_file_system()
|
|
89
|
-
files: set[GCSFile] = {
|
|
90
|
-
fs.open(x)
|
|
91
|
-
for x in _get_gcs_paths(
|
|
92
|
-
paths, filename_glob=self.filename_glob, file_system=fs
|
|
93
|
-
)
|
|
94
|
-
}
|
|
95
|
-
return files
|
|
96
|
-
|
|
97
|
-
# Using set to remove any duplicates if directories are overlapping
|
|
98
|
-
files: set[str] = set()
|
|
99
|
-
for path in paths:
|
|
100
|
-
if os.path.isdir(path):
|
|
101
|
-
pathname = os.path.join(path, "**", self.filename_glob)
|
|
102
|
-
files |= {
|
|
103
|
-
x for x in glob.iglob(pathname, recursive=True) if os.path.isfile(x)
|
|
104
|
-
}
|
|
105
|
-
elif os.path.isfile(path):
|
|
106
|
-
files.add(path)
|
|
107
|
-
else:
|
|
108
|
-
warnings.warn(
|
|
109
|
-
f"Could not find any relevant files for provided path '{path}'. "
|
|
110
|
-
f"Path was ignored.",
|
|
111
|
-
UserWarning,
|
|
112
|
-
stacklevel=1,
|
|
113
|
-
)
|
|
114
|
-
|
|
115
|
-
return files
|
|
116
|
-
|
|
117
|
-
def _load_warp_file(self, filepath: str) -> DatasetReader:
|
|
118
|
-
"""Load and warp a file to the correct CRS and resolution.
|
|
119
|
-
|
|
120
|
-
Args:
|
|
121
|
-
filepath: file to load and warp.
|
|
122
|
-
|
|
123
|
-
Returns:
|
|
124
|
-
file handle of warped VRT.
|
|
125
|
-
"""
|
|
126
|
-
with opener(filepath) as f:
|
|
127
|
-
src = rasterio.open(f)
|
|
128
|
-
|
|
129
|
-
# Only warp if necessary
|
|
130
|
-
if src.crs != self.crs:
|
|
131
|
-
vrt = WarpedVRT(src, crs=self.crs)
|
|
132
|
-
src.close()
|
|
133
|
-
return vrt
|
|
134
|
-
else:
|
|
135
|
-
return src
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
def _get_gcs_paths(
|
|
139
|
-
paths: str | Iterable[str],
|
|
140
|
-
filename_glob: str,
|
|
141
|
-
file_system: GCSFileSystem | None = None,
|
|
142
|
-
) -> set[str]:
|
|
143
|
-
if file_system is None:
|
|
144
|
-
file_system = dp.FileClient.get_gcs_file_system()
|
|
145
|
-
|
|
146
|
-
# Using set to remove any duplicates if directories are overlapping
|
|
147
|
-
out_paths: set[str] = set()
|
|
148
|
-
for path in paths:
|
|
149
|
-
pathname = os.path.join(path, "**", filename_glob)
|
|
150
|
-
if is_dapla():
|
|
151
|
-
out_paths |= {
|
|
152
|
-
x for x in file_system.glob(pathname, recursive=True) if "." in x
|
|
153
|
-
}
|
|
154
|
-
return out_paths
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
class Sentinel2(GCSRasterDataset):
|
|
158
|
-
"""Works like torchgeo's Sentinel2, with custom regexes."""
|
|
159
|
-
|
|
160
|
-
date_format: ClassVar[str] = "%Y%m%d"
|
|
161
|
-
filename_glob: ClassVar[str] = "SENTINEL2X_*_*.*"
|
|
162
|
-
|
|
163
|
-
filename_regex: ClassVar[str] = SENTINEL2_FILENAME_REGEX
|
|
164
|
-
all_bands: ClassVar[list[str]] = SENTINEL_2_BANDS
|
|
165
|
-
rgb_bands: ClassVar[list[str]] = SENTINEL_2_RBG_BANDS
|
|
166
|
-
|
|
167
|
-
separate_files: ClassVar[bool] = True
|
|
168
|
-
|
|
169
|
-
cmap: ClassVar[dict[int, tuple[int, int, int, int]]] = {}
|
|
170
|
-
|
|
171
|
-
plot: Callable = TorchgeoSentinel2.plot
|
ssb_sgis-1.0.2.dist-info/RECORD
DELETED
|
@@ -1,61 +0,0 @@
|
|
|
1
|
-
sgis/__init__.py,sha256=z78RVVd1xmvTVndEHOs3TUK-8kYf95t0rEkKY8fVuE8,6519
|
|
2
|
-
sgis/exceptions.py,sha256=A5Jtx_AtIUaTuWQ2wJh7y1it6-HbXHXip5PTrl6l0dk,658
|
|
3
|
-
sgis/geopandas_tools/__init__.py,sha256=bo8lFMcltOz7TtWAi52_ekR2gd3mjfBfKeMDV5zuqFY,28
|
|
4
|
-
sgis/geopandas_tools/bounds.py,sha256=60gtB83tyyTq4fayTgya-KocsRts6XXZQVfoHQ4FDGc,23846
|
|
5
|
-
sgis/geopandas_tools/buffer_dissolve_explode.py,sha256=b17S4-4VxSCnRp76fsObgWCcfUQU3hfHf3YZ1gnXEqE,18303
|
|
6
|
-
sgis/geopandas_tools/centerlines.py,sha256=qTLUWOAgLT_E7ow4cZjWgwgH2BqaEh-hSQivXQbxWcc,14435
|
|
7
|
-
sgis/geopandas_tools/cleaning.py,sha256=w0puDL7RfIZwWy_wRxXkgfYTHQKZVBxKvAhbjsnAqSY,23772
|
|
8
|
-
sgis/geopandas_tools/conversion.py,sha256=BSyc4sp36CB8fYEgspAJY2gJPvgukL-75FX0vjdzkPI,24062
|
|
9
|
-
sgis/geopandas_tools/duplicates.py,sha256=TIOxfyK3KflwixxOo6cVaYDoo_jFXEwdMiTAW8Js4bw,13596
|
|
10
|
-
sgis/geopandas_tools/general.py,sha256=MryYBJQ-pU8jbllLx1iXhbHXv6dqhd_5AjK6buGeBuc,25944
|
|
11
|
-
sgis/geopandas_tools/geocoding.py,sha256=n47aFQMm4yX1MsPnTM4dFjwegCA1ZmGUDj1uyu7OJV4,691
|
|
12
|
-
sgis/geopandas_tools/geometry_types.py,sha256=-bFKz0j4WHWv0bTP8emcP8RrYBMtlKX7VpniukX7f14,7586
|
|
13
|
-
sgis/geopandas_tools/neighbors.py,sha256=Ox3efpTeR7rtmD1tZtCi6xMiSYUhUvYBzMFrlCR5ZhQ,16363
|
|
14
|
-
sgis/geopandas_tools/overlay.py,sha256=yAIpM1Yq9JBjRMhoetxiJXdwpjHF_q4tkYNhatYJQS0,25509
|
|
15
|
-
sgis/geopandas_tools/point_operations.py,sha256=kwbJAG7sKnPns4_L-xI3fZ04dlWr6Gu3cGtYtivetSY,6959
|
|
16
|
-
sgis/geopandas_tools/polygon_operations.py,sha256=ueOoB96TYUSYMTWDLhSfVvUef6AHq1CsvzytZV-0M4s,37224
|
|
17
|
-
sgis/geopandas_tools/polygons_as_rings.py,sha256=26_TSB3dyzsPHc4h2RVzhwFVBa9qG1mw9xLGZbNKOMU,13558
|
|
18
|
-
sgis/geopandas_tools/sfilter.py,sha256=hj-RpGIawjxlf1n780aJZ6UHPHJ3W8WE6BZJqLYKOzs,8653
|
|
19
|
-
sgis/helpers.py,sha256=iWsVzypu92kQ89t3Og5BO1w2T4sYhseExVH0i0VzPFI,8294
|
|
20
|
-
sgis/io/_is_dapla.py,sha256=o_qFD5GOi3dsSGOKmW6R8wZU0htVwFgRbGX7ppJCqT4,431
|
|
21
|
-
sgis/io/dapla_functions.py,sha256=IHB8Nhg90ui_o6IvKx-BjAS3mciruCClL-v-JQNfg4M,8807
|
|
22
|
-
sgis/io/opener.py,sha256=BHyH7L8Ubh9C4Lsb8eBzGI6FLWg8UQFu-1bg3NEy_2k,862
|
|
23
|
-
sgis/io/read_parquet.py,sha256=1mQ-c9zHC91DWAMS2a7tU7xzx3aa4-USoMhChNK3ryU,3775
|
|
24
|
-
sgis/maps/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
25
|
-
sgis/maps/examine.py,sha256=WVCRYqDULnqyiGJS01XYpsdZI8FklLJuzE9RVcK1Bgk,8708
|
|
26
|
-
sgis/maps/explore.py,sha256=cyLD7Ix0vacHdYB6Q93yjcan_rTbXlNJGosRh4E0zOE,33284
|
|
27
|
-
sgis/maps/httpserver.py,sha256=7Od9JMCtntcIQKk_TchetojMHzFHT9sPw7GANahI97c,1982
|
|
28
|
-
sgis/maps/legend.py,sha256=55PtIr4GUQSObKfAd2XLUTUTSbxrQ6PEafZUosjiOL0,24329
|
|
29
|
-
sgis/maps/map.py,sha256=b2LYY4lZ0wN73yvuYKw2TNweB0NapbF2XywvgoyXY48,25234
|
|
30
|
-
sgis/maps/maps.py,sha256=EshVwPVnjTQMbOeWTVmdFn-Ep2NMHztXNadqcHAVjJU,20582
|
|
31
|
-
sgis/maps/thematicmap.py,sha256=uhg6WLx5-RJD0qSxnp5HYP9r3PvhWbmEu8CCHYz-HG8,14764
|
|
32
|
-
sgis/maps/tilesources.py,sha256=aSci-0JURxnqqirIXQS5bHfNEIg3xfCM_B4gXs7GslM,2772
|
|
33
|
-
sgis/networkanalysis/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
34
|
-
sgis/networkanalysis/_get_route.py,sha256=9I3t9pnccUPr4mozy3TJCOpGCCf3UOIojmsbifubZbA,6368
|
|
35
|
-
sgis/networkanalysis/_od_cost_matrix.py,sha256=zkyPX7ObT996ahaFJ2oI0D0SqQWbWyfy_qLtXwValPg,3434
|
|
36
|
-
sgis/networkanalysis/_points.py,sha256=ajCy17dAmRq3bWRkNu_0LHreCVJ5Uh8DzAKWxyw7ipw,4481
|
|
37
|
-
sgis/networkanalysis/_service_area.py,sha256=BzqB8X5X5CGexUwbpP379jEj-ad4mgCzFr8mOa-BsnY,5385
|
|
38
|
-
sgis/networkanalysis/closing_network_holes.py,sha256=R6NFm97eWiIN0K_HfOd8ytI9maBRXEe2kAmfKpvFTi4,12093
|
|
39
|
-
sgis/networkanalysis/cutting_lines.py,sha256=E2cwS4aAgap37uls_qfDR-I8p5IVrH1foRpBmTB_nVo,15191
|
|
40
|
-
sgis/networkanalysis/directednetwork.py,sha256=FVxaSKSeWoeJSI_mMU6SA5ZIqsvBlI7dZynqsbGeGSU,11412
|
|
41
|
-
sgis/networkanalysis/finding_isolated_networks.py,sha256=xoDmJBBNp53oo8zh5818vNrkpEbF4MJZup4PsTVTBJE,3382
|
|
42
|
-
sgis/networkanalysis/network.py,sha256=zV9bAbVdTgTohg2o2RFGy2uhOJrd3Ma57hwIAStxMAQ,7847
|
|
43
|
-
sgis/networkanalysis/networkanalysis.py,sha256=u86cApLFW1hYYz4YyDz5629_vKBbCwoQsHiz5A_pV5E,68444
|
|
44
|
-
sgis/networkanalysis/networkanalysisrules.py,sha256=20Xkawv7vs-YnTKTXJbW3gVgxqD3OFrVn0nFBBx7uRY,12955
|
|
45
|
-
sgis/networkanalysis/nodes.py,sha256=Yo0oWlsZO0Ex2_7lzGGUEiS2Ltfnm5kuCl5MkE2qJhA,6863
|
|
46
|
-
sgis/networkanalysis/traveling_salesman.py,sha256=pzEurmons3_SaFH_zbQ5sRyE27L86XkvPTFEyLeOXZ0,5654
|
|
47
|
-
sgis/parallel/parallel.py,sha256=WU55duAf_RKaBbk6pzkMDfw3ZakkHPvqPD6399FxOYA,36002
|
|
48
|
-
sgis/py.typed,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
49
|
-
sgis/raster/__init__.py,sha256=q7AWZko7RvC3eFnpejrnU7HF5jCyJDmoiOrI11DD32E,175
|
|
50
|
-
sgis/raster/base.py,sha256=POu3uZJqygubLGh9t_lQJe8pNKQ9MD9wHubFHC8_nck,1192
|
|
51
|
-
sgis/raster/cube.py,sha256=UZ_fcQAsSmk9YkHx6ldy7199jPqaly6mReRgkl0WE6k,40419
|
|
52
|
-
sgis/raster/cubebase.py,sha256=nao5huLer-nzy792PTZc0CKAMlmedZCe3siWnOf7Duw,639
|
|
53
|
-
sgis/raster/indices.py,sha256=pEtfTsfH6IKGAT1R_x-rrqx10yoqLaB73uRWRiDjy_Y,2703
|
|
54
|
-
sgis/raster/methods_as_functions.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
55
|
-
sgis/raster/raster.py,sha256=1hXBy2JPVC80ymjvj51o9MaeHCWsugv_ld1x3VLPHoA,53765
|
|
56
|
-
sgis/raster/torchgeo.py,sha256=KpPb91bFzbqcm089NHtiWwyUyz1uBG5KxwGFZfiNhu4,4523
|
|
57
|
-
sgis/raster/zonal.py,sha256=UJkCC93_UfJ113HmWt9lnlsR1mfs1d7Lioh-dK8fj7o,3862
|
|
58
|
-
ssb_sgis-1.0.2.dist-info/LICENSE,sha256=np3IfD5m0ZUofn_kVzDZqliozuiO6wrktw3LRPjyEiI,1073
|
|
59
|
-
ssb_sgis-1.0.2.dist-info/METADATA,sha256=5DDIE7r1tXk1WVgrDMQSdh6FOVRstx-WS0waNN0hhBM,11780
|
|
60
|
-
ssb_sgis-1.0.2.dist-info/WHEEL,sha256=sP946D7jFCHeNz5Iq4fL4Lu-PrWrFsgfLXbbkciIZwg,88
|
|
61
|
-
ssb_sgis-1.0.2.dist-info/RECORD,,
|
|
File without changes
|
|
File without changes
|