ssb-sgis 1.1.10__py3-none-any.whl → 1.1.12__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.
@@ -212,19 +212,24 @@ 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
- minx, miny = self.bounds[:2]
218
217
  resx, resy = _res_as_tuple(self.res)
219
218
 
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)
219
+ # work ourselves inwards from the bottom left and top right corners
220
+ minx, _, _, maxy = self.bounds
221
+ minxs = np.full(self.col_indices.shape, minx) + (self.col_indices * resx)
222
+ maxys = np.full(self.row_indices.shape, maxy) - (self.row_indices * resy)
222
223
  maxxs = minxs + resx
223
- maxys = minys + resy
224
+ minys = maxys - resy
224
225
 
225
226
  return GeoDataFrame(
226
227
  {
227
- column: self.results,
228
+ **(
229
+ {col: [x[i] for x in self.results] for i, col in enumerate(column)}
230
+ if not isinstance(column, str)
231
+ else {column: self.results}
232
+ ),
228
233
  "geometry": [
229
234
  box(minx, miny, maxx, maxy)
230
235
  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.10
3
+ Version: 1.1.12
4
4
  Summary: GIS functions used at Statistics Norway.
5
5
  Home-page: https://github.com/statisticsnorway/ssb-sgis
6
6
  License: MIT
@@ -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=hpIVKBizlhn5YyxXoSpXHNVo0eVy5PfTnJCwpw2V1rQ,123152
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.10.dist-info/LICENSE,sha256=np3IfD5m0ZUofn_kVzDZqliozuiO6wrktw3LRPjyEiI,1073
63
- ssb_sgis-1.1.10.dist-info/METADATA,sha256=TBZyISEqjWgban-cpg_xc0ohMB-Resq36r-1NY-s7V8,11741
64
- ssb_sgis-1.1.10.dist-info/WHEEL,sha256=sP946D7jFCHeNz5Iq4fL4Lu-PrWrFsgfLXbbkciIZwg,88
65
- ssb_sgis-1.1.10.dist-info/RECORD,,
62
+ ssb_sgis-1.1.12.dist-info/LICENSE,sha256=np3IfD5m0ZUofn_kVzDZqliozuiO6wrktw3LRPjyEiI,1073
63
+ ssb_sgis-1.1.12.dist-info/METADATA,sha256=UMYFkb-iBAu40ktwp9hVhdXoQ4MHvO4osBaCwCG5xHU,11741
64
+ ssb_sgis-1.1.12.dist-info/WHEEL,sha256=sP946D7jFCHeNz5Iq4fL4Lu-PrWrFsgfLXbbkciIZwg,88
65
+ ssb_sgis-1.1.12.dist-info/RECORD,,