ssb-sgis 1.1.9__py3-none-any.whl → 1.1.11__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.
@@ -780,7 +780,7 @@ def _read_partitioned_parquet(
780
780
  # add columns to empty DataFrame
781
781
  first_path = next(iter(child_paths + [path]))
782
782
  df = pd.DataFrame(columns=_get_columns(first_path, file_system))
783
- if "columns" in kwargs:
783
+ if kwargs.get("columns"):
784
784
  return df[list(kwargs["columns"])]
785
785
  return df
786
786
 
@@ -212,19 +212,23 @@ class PixelwiseResults:
212
212
  )
213
213
  }
214
214
 
215
- def to_geopandas(self, column: str = "value") -> GeoDataFrame:
215
+ def to_geopandas(self, column: str | list[str] = "value") -> GeoDataFrame:
216
216
  """Return GeoDataFrame with pixel geometries and values from the pixelwise operation."""
217
217
  minx, miny = self.bounds[:2]
218
218
  resx, resy = _res_as_tuple(self.res)
219
219
 
220
- minxs = np.full(self.row_indices.shape, minx) + (minx * self.row_indices * resx)
221
- minys = np.full(self.col_indices.shape, miny) + (miny * self.col_indices * resy)
220
+ minxs = np.full(self.row_indices.shape, minx) + (self.row_indices * resx)
221
+ minys = np.full(self.col_indices.shape, miny) + (self.col_indices * resy)
222
222
  maxxs = minxs + resx
223
223
  maxys = minys + resy
224
224
 
225
225
  return GeoDataFrame(
226
226
  {
227
- column: self.results,
227
+ **(
228
+ {col: [x[i] for x in self.results] for i, col in enumerate(column)}
229
+ if not isinstance(column, str)
230
+ else {column: self.results}
231
+ ),
228
232
  "geometry": [
229
233
  box(minx, miny, maxx, maxy)
230
234
  for minx, miny, maxx, maxy in zip(
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: ssb-sgis
3
- Version: 1.1.9
3
+ Version: 1.1.11
4
4
  Summary: GIS functions used at Statistics Norway.
5
5
  Home-page: https://github.com/statisticsnorway/ssb-sgis
6
6
  License: MIT
@@ -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=1jg-OOGRMceJO4b_r9NH9tNRuj3ve352rCec3hRrdAY,30287
24
+ sgis/io/dapla_functions.py,sha256=Dp2oimCDY9L2_FBoAgDttqG9nd9aU06v5tXA1iB_aDc,30289
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
@@ -54,12 +54,12 @@ sgis/parallel/parallel.py,sha256=CzHetSAr9wvSrEDFTqDq2xAsNuG1ig22-vcEOIoUVv4,396
54
54
  sgis/py.typed,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
55
55
  sgis/raster/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
56
56
  sgis/raster/base.py,sha256=tiZEuMcVK6hOm_aIjWhQ1WGshcjsxT1fFkuBSLFiMC0,7785
57
- sgis/raster/image_collection.py,sha256=FfsBgLtne9_pcCm6FynrMx90NpHLulcshj5ALT08zOA,122888
57
+ sgis/raster/image_collection.py,sha256=BfXkt05MoWLUNe_rqSW0uuX8YFqTXl2CDLa5y1ifgIk,123074
58
58
  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.9.dist-info/LICENSE,sha256=np3IfD5m0ZUofn_kVzDZqliozuiO6wrktw3LRPjyEiI,1073
63
- ssb_sgis-1.1.9.dist-info/METADATA,sha256=BVkpmYvkcTxMKuyy6ixUsIRrasOpKsgYAMm2Y5qwM9o,11740
64
- ssb_sgis-1.1.9.dist-info/WHEEL,sha256=sP946D7jFCHeNz5Iq4fL4Lu-PrWrFsgfLXbbkciIZwg,88
65
- ssb_sgis-1.1.9.dist-info/RECORD,,
62
+ ssb_sgis-1.1.11.dist-info/LICENSE,sha256=np3IfD5m0ZUofn_kVzDZqliozuiO6wrktw3LRPjyEiI,1073
63
+ ssb_sgis-1.1.11.dist-info/METADATA,sha256=P7MbctOE50tjm1zeAGSEBcZENurWg2eb_qGaN_sokU0,11741
64
+ ssb_sgis-1.1.11.dist-info/WHEEL,sha256=sP946D7jFCHeNz5Iq4fL4Lu-PrWrFsgfLXbbkciIZwg,88
65
+ ssb_sgis-1.1.11.dist-info/RECORD,,