ssb-sgis 1.1.6__py3-none-any.whl → 1.1.7__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/geopandas_tools/duplicates.py +2 -0
- sgis/io/dapla_functions.py +5 -3
- sgis/maps/map.py +6 -11
- {ssb_sgis-1.1.6.dist-info → ssb_sgis-1.1.7.dist-info}/METADATA +1 -1
- {ssb_sgis-1.1.6.dist-info → ssb_sgis-1.1.7.dist-info}/RECORD +7 -7
- {ssb_sgis-1.1.6.dist-info → ssb_sgis-1.1.7.dist-info}/LICENSE +0 -0
- {ssb_sgis-1.1.6.dist-info → ssb_sgis-1.1.7.dist-info}/WHEEL +0 -0
|
@@ -164,6 +164,8 @@ def update_geometries(
|
|
|
164
164
|
|
|
165
165
|
copied.index = copied.index.map(index_mapper)
|
|
166
166
|
|
|
167
|
+
copied = make_all_singlepart(copied)
|
|
168
|
+
|
|
167
169
|
# TODO check why polygons dissappear in rare cases. For now, just add back the missing
|
|
168
170
|
dissapeared = sfilter_inverse(gdf, copied.buffer(-PRECISION))
|
|
169
171
|
copied = pd.concat([copied, dissapeared])
|
sgis/io/dapla_functions.py
CHANGED
|
@@ -99,12 +99,14 @@ def read_geopandas(
|
|
|
99
99
|
**kwargs,
|
|
100
100
|
)
|
|
101
101
|
|
|
102
|
-
|
|
102
|
+
single_eq_filter = (
|
|
103
103
|
isinstance(filters, Iterable)
|
|
104
104
|
and len(filters) == 1
|
|
105
105
|
and ("=" in next(iter(filters)) or "==" in next(iter(filters)))
|
|
106
|
-
)
|
|
107
|
-
|
|
106
|
+
)
|
|
107
|
+
# try to read files in subfolder path / "column=value"
|
|
108
|
+
# because glob is slow without GCSFileSystem from the root partition
|
|
109
|
+
if single_eq_filter:
|
|
108
110
|
try:
|
|
109
111
|
expression = "".join(next(iter(filters))).replace("==", "=")
|
|
110
112
|
glob_func = _get_glob(file_system)
|
sgis/maps/map.py
CHANGED
|
@@ -128,6 +128,8 @@ class Map:
|
|
|
128
128
|
categorical: Set to True to convert 'column' to string values.
|
|
129
129
|
**kwargs: Arbitrary keyword arguments.
|
|
130
130
|
"""
|
|
131
|
+
self.kwargs = {}
|
|
132
|
+
|
|
131
133
|
gdfs, column, kwargs = self._separate_args(gdfs, column, kwargs)
|
|
132
134
|
|
|
133
135
|
self._column = column
|
|
@@ -175,7 +177,6 @@ class Map:
|
|
|
175
177
|
self.labels = new_labels
|
|
176
178
|
|
|
177
179
|
# pop all geometry-like items from kwargs into self._gdfs
|
|
178
|
-
self.kwargs = {}
|
|
179
180
|
i = 0
|
|
180
181
|
for key, value in kwargs.items():
|
|
181
182
|
try:
|
|
@@ -237,8 +238,8 @@ class Map:
|
|
|
237
238
|
self._gdf = pd.concat(self._gdfs, ignore_index=True)
|
|
238
239
|
|
|
239
240
|
self._nan_idx = self._gdf[self._column].isna()
|
|
240
|
-
self._get_unique_values()
|
|
241
241
|
self._to_categorical()
|
|
242
|
+
self._get_unique_values()
|
|
242
243
|
|
|
243
244
|
def _to_categorical(self):
|
|
244
245
|
if not (self._is_categorical and self.column is not None):
|
|
@@ -262,9 +263,9 @@ class Map:
|
|
|
262
263
|
self._gdfs[i][self.column] = to_string_via_int(gdf[self.column])
|
|
263
264
|
self._gdf[self.column] = to_string_via_int(self._gdf[self.column])
|
|
264
265
|
|
|
265
|
-
def __getattr__(self, attr: str) -> Any:
|
|
266
|
-
|
|
267
|
-
|
|
266
|
+
# def __getattr__(self, attr: str) -> Any:
|
|
267
|
+
# """Search for attribute in kwargs."""
|
|
268
|
+
# return self.kwargs.get(attr, super().__getattribute__(attr))
|
|
268
269
|
|
|
269
270
|
def __bool__(self) -> bool:
|
|
270
271
|
"""True of any gdfs with more than 0 rows."""
|
|
@@ -554,12 +555,6 @@ class Map:
|
|
|
554
555
|
)
|
|
555
556
|
n = n + maybe_area + maybe_length
|
|
556
557
|
|
|
557
|
-
if n == 0:
|
|
558
|
-
raise ValueError(
|
|
559
|
-
f"The column {self._column!r} is not present in any "
|
|
560
|
-
"of the passed GeoDataFrames."
|
|
561
|
-
)
|
|
562
|
-
|
|
563
558
|
def _check_if_categorical(self) -> bool:
|
|
564
559
|
"""Quite messy this..."""
|
|
565
560
|
if not self._column or not self._gdfs:
|
|
@@ -8,7 +8,7 @@ sgis/geopandas_tools/buffer_dissolve_explode.py,sha256=t9GJqRMDsHEU74RIlqeMr4QBg
|
|
|
8
8
|
sgis/geopandas_tools/centerlines.py,sha256=Q65Sx01SeAlulBEd9oaZkB2maBBNdLcJwAbTILg4SPU,11848
|
|
9
9
|
sgis/geopandas_tools/cleaning.py,sha256=0j7_bfuAjWVBUImbPTXuwNdYRJ_By6HAwaOdw5Dh4vc,24315
|
|
10
10
|
sgis/geopandas_tools/conversion.py,sha256=o3QJZLfaqqpJNdWWNKfQn_dS77uJxxRxWZxhf18vPXs,25505
|
|
11
|
-
sgis/geopandas_tools/duplicates.py,sha256=
|
|
11
|
+
sgis/geopandas_tools/duplicates.py,sha256=p9OCYWtwkWE7i-kZX_dRqAiczsUoWEWl5I8GeYIjQOM,14968
|
|
12
12
|
sgis/geopandas_tools/general.py,sha256=UPtmgEMhTZw-qMiCCjeTtyBlJWoVE96SSanufPK8MLs,39976
|
|
13
13
|
sgis/geopandas_tools/geocoding.py,sha256=n47aFQMm4yX1MsPnTM4dFjwegCA1ZmGUDj1uyu7OJV4,691
|
|
14
14
|
sgis/geopandas_tools/geometry_types.py,sha256=ijQDbQaZPqPGjBl707H4yooNXpk21RXyatI7itnvqLk,7603
|
|
@@ -21,7 +21,7 @@ sgis/geopandas_tools/sfilter.py,sha256=SLcMYprQwnY5DNo0R7TGXk4m6u26H8o4PRn-RPhme
|
|
|
21
21
|
sgis/helpers.py,sha256=_h7ke9hJrRNhHW-ZX3gA95fOrX2s1ADKBMxc94p2F4Q,9627
|
|
22
22
|
sgis/io/__init__.py,sha256=uyBr20YDqB2bQttrd5q1JuGOvX32A-MSvS7Wmw5f5qg,177
|
|
23
23
|
sgis/io/_is_dapla.py,sha256=wmfkSe98IrLhUg3dtXZusV6OVC8VlY1kbc5EQDf3P-Q,358
|
|
24
|
-
sgis/io/dapla_functions.py,sha256=
|
|
24
|
+
sgis/io/dapla_functions.py,sha256=JrMmgdFPgXYUDMCzZcWLv2NyDuzUjwxCkHUC8QiBazQ,30067
|
|
25
25
|
sgis/io/opener.py,sha256=HWO3G1NB6bpXKM94JadCD513vjat1o1TFjWGWzyVasg,898
|
|
26
26
|
sgis/io/read_parquet.py,sha256=FvZYv1rLkUlrSaUY6QW6E1yntmntTeQuZ9ZRgCDO4IM,3776
|
|
27
27
|
sgis/maps/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
@@ -29,7 +29,7 @@ sgis/maps/examine.py,sha256=Pb0dH8JazU5E2svfQrzHO1Bi-sjy5SeyY6zoeMO34jE,9369
|
|
|
29
29
|
sgis/maps/explore.py,sha256=Vdt1-vFKWkJxL-odh3rn2YlKpWw6Ew0bu8U3KURThNc,47797
|
|
30
30
|
sgis/maps/httpserver.py,sha256=eCDoB9x74kSLiGEj2X3O91t3oscY_ia17UNuaaJ6tCc,2472
|
|
31
31
|
sgis/maps/legend.py,sha256=lVRVCkhPmJRjGK23obFJZAO3qp6du1LYnobkkN7DPkc,26279
|
|
32
|
-
sgis/maps/map.py,sha256=
|
|
32
|
+
sgis/maps/map.py,sha256=bvEQqHgdi8ZGQaKxIy1yIYVOKZ7sPIWo6zoWgo0IpwU,30570
|
|
33
33
|
sgis/maps/maps.py,sha256=gxu0rgcVygjudRtM1dVRmsUMilMUIg3vG-UgvASM91E,23072
|
|
34
34
|
sgis/maps/norge_i_bilder.json,sha256=W_mFfte3DxugWbEudZ5fadZ2JeFYb0hyab2Quf4oJME,481311
|
|
35
35
|
sgis/maps/thematicmap.py,sha256=w6q4_gIr8BubQgsPJkc6WXk-tmplDLGcKyjphhFp7ng,21873
|
|
@@ -59,7 +59,7 @@ sgis/raster/indices.py,sha256=-J1HYmnT240iozvgagvyis6K0_GHZHRuUrPOgyoeIrY,223
|
|
|
59
59
|
sgis/raster/regex.py,sha256=kYhVpRYzoXutx1dSYmqMoselWXww7MMEsTPmLZwHjbM,3759
|
|
60
60
|
sgis/raster/sentinel_config.py,sha256=nySDqn2R8M6W8jguoBeSAK_zzbAsqmaI59i32446FwY,1268
|
|
61
61
|
sgis/raster/zonal.py,sha256=D4Gyptw-yOLTCO41peIuYbY-DANsJCG19xXDlf1QAz4,2299
|
|
62
|
-
ssb_sgis-1.1.
|
|
63
|
-
ssb_sgis-1.1.
|
|
64
|
-
ssb_sgis-1.1.
|
|
65
|
-
ssb_sgis-1.1.
|
|
62
|
+
ssb_sgis-1.1.7.dist-info/LICENSE,sha256=np3IfD5m0ZUofn_kVzDZqliozuiO6wrktw3LRPjyEiI,1073
|
|
63
|
+
ssb_sgis-1.1.7.dist-info/METADATA,sha256=c-fXSCy0eK6NKycntm8iC0GpuM_J2xTnXcdTV8tnmzM,11740
|
|
64
|
+
ssb_sgis-1.1.7.dist-info/WHEEL,sha256=sP946D7jFCHeNz5Iq4fL4Lu-PrWrFsgfLXbbkciIZwg,88
|
|
65
|
+
ssb_sgis-1.1.7.dist-info/RECORD,,
|
|
File without changes
|
|
File without changes
|