ssb-sgis 1.2.14__py3-none-any.whl → 1.2.15__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.
@@ -92,7 +92,11 @@ def read_geopandas(
92
92
  if isinstance(gcs_path, (Path | os.PathLike)):
93
93
  gcs_path = str(gcs_path)
94
94
 
95
- if not isinstance(gcs_path, (str | Path | os.PathLike)):
95
+ if isinstance(gcs_path, str):
96
+ gcs_path = _maybe_strip_prefix(gcs_path, file_system)
97
+ else:
98
+ gcs_path = [_maybe_strip_prefix(str(path), file_system) for path in gcs_path]
99
+
96
100
  return _read_geopandas_from_iterable(
97
101
  gcs_path,
98
102
  mask=mask,
@@ -925,3 +929,9 @@ def _get_files_in_subfolders(folderinfo: list[dict]) -> list[tuple]:
925
929
  folderinfo = new_folderinfo
926
930
 
927
931
  return fileinfo
932
+
933
+
934
+ def _maybe_strip_prefix(path, file_system):
935
+ if isinstance(file_system, GCSFileSystem) and path.startswith("gs://"):
936
+ return path.replace("gs://", "")
937
+ return path
sgis/maps/legend.py CHANGED
@@ -523,7 +523,7 @@ class ContinousLegend(Legend):
523
523
  def __init__(
524
524
  self,
525
525
  labels: list[str] | None = None,
526
- pretty_labels: bool = True,
526
+ pretty_labels: bool = False,
527
527
  label_suffix: str | None = None,
528
528
  label_sep: str = "-",
529
529
  rounding: int | None = None,
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: ssb-sgis
3
- Version: 1.2.14
3
+ Version: 1.2.15
4
4
  Summary: GIS functions used at Statistics Norway.
5
5
  Home-page: https://github.com/statisticsnorway/ssb-sgis
6
6
  License: MIT
@@ -182,9 +182,13 @@ weights["weight"] = 10
182
182
  frequencies = nwa.get_route_frequencies(origins, destinations, weight_df=weights)
183
183
 
184
184
  # plot the results
185
- m = sg.ThematicMap(sg.buff(frequencies, 15), column="frequency", black=True)
186
- m.cmap = "plasma"
187
- m.title = "Number of times each road was used,\nweighted * 10"
185
+ m = sg.ThematicMap(
186
+ sg.buff(frequencies, 15),
187
+ column="frequency",
188
+ black=True,
189
+ cmap="plasma",
190
+ title="Number of times each road was used,\nweighted * 10",
191
+ )
188
192
  m.plot()
189
193
  ```
190
194
 
@@ -199,9 +203,14 @@ service_areas = nwa.service_area(
199
203
  )
200
204
 
201
205
  # plot the results
202
- m = sg.ThematicMap(service_areas, column="minutes", black=True, size=10)
203
- m.k = 10
204
- m.title = "Roads that can be reached within 1 to 10 minutes"
206
+ m = sg.ThematicMap(
207
+ service_areas,
208
+ column="minutes",
209
+ black=True,
210
+ size=10,
211
+ k=10,
212
+ title="Roads that can be reached within 1 to 10 minutes",
213
+ )
205
214
  m.plot()
206
215
  ```
207
216
 
@@ -214,9 +223,15 @@ routes = nwa.get_k_routes(
214
223
  points.iloc[[0]], points.iloc[[1]], k=4, drop_middle_percent=50
215
224
  )
216
225
 
217
- m = sg.ThematicMap(sg.buff(routes, 15), column="k", black=True)
218
- m.title = "Four fastest routes from A to B"
219
- m.legend.title = "Rank"
226
+ m = sg.ThematicMap(
227
+ sg.buff(routes, 15),
228
+ column="k",
229
+ black=True,
230
+ title="Four fastest routes from A to B",
231
+ legend_kwargs=dict(
232
+ title="Rank",
233
+ ),
234
+ )
220
235
  m.plot()
221
236
  ```
222
237
 
@@ -23,14 +23,14 @@ sgis/geopandas_tools/utils.py,sha256=X0pRvB1tWgV_0BCrRS1HU9LtLGnZCpvVPxyqM9JGb0Y
23
23
  sgis/helpers.py,sha256=4N6vFWQ3TYVzRHNcWY_fNa_GkFuaZB3vtCkkFND-qs0,9628
24
24
  sgis/io/__init__.py,sha256=uyBr20YDqB2bQttrd5q1JuGOvX32A-MSvS7Wmw5f5qg,177
25
25
  sgis/io/_is_dapla.py,sha256=wmfkSe98IrLhUg3dtXZusV6OVC8VlY1kbc5EQDf3P-Q,358
26
- sgis/io/dapla_functions.py,sha256=9NqkL67WdJJHczIWNdChHZp8T5hlXhcYucX7GWN1mCA,31430
26
+ sgis/io/dapla_functions.py,sha256=_Q2MLQ4KjI4rMGlaj9wobBZuaeqkfpl5dz8_37gpvZI,31741
27
27
  sgis/io/opener.py,sha256=HWO3G1NB6bpXKM94JadCD513vjat1o1TFjWGWzyVasg,898
28
28
  sgis/io/read_parquet.py,sha256=FvZYv1rLkUlrSaUY6QW6E1yntmntTeQuZ9ZRgCDO4IM,3776
29
29
  sgis/maps/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
30
30
  sgis/maps/examine.py,sha256=69nPtMChKmso7Yy8X--UoTWJjKmjMF1VHsdLpPKFbA0,9233
31
31
  sgis/maps/explore.py,sha256=ANbhScthhwznLEUDDjRUBmniGmkdF9zftbzp9dYHu-U,48210
32
32
  sgis/maps/httpserver.py,sha256=I7tTn3hFaTCc-E-T_o9v0nXwMGaS2Xqd4MlWbq8k-J4,3014
33
- sgis/maps/legend.py,sha256=6L6KspAoYuQbOcs-0vWzMDEL_9qvmGuRR7VIL1wsBMI,26898
33
+ sgis/maps/legend.py,sha256=gTEWCVIZH1cw6ULVVrJqRR4__uOZvrT3xxQ5lhZMVR4,26899
34
34
  sgis/maps/map.py,sha256=07YK_oHa2z_yw_es06pd-80dV8YTI5mkTyJxyud707Y,30758
35
35
  sgis/maps/maps.py,sha256=fLK5WUlQ2YTm7t-8260lYxCFvpZN6j0Y-bVYCyv8NAY,23249
36
36
  sgis/maps/norge_i_bilder.json,sha256=G9DIN_2vyn-18UF5wUC-koZxFCbiNxMu0BbCJhMFJUk,15050340
@@ -61,7 +61,7 @@ sgis/raster/indices.py,sha256=efJmgfPg_VuSzXFosXV661IendF8CwPFWtMhyP4TMUg,222
61
61
  sgis/raster/regex.py,sha256=4idTJ9vFtsGtbxcjJrx2VrpJJuDMP3bLdqF93Vc_cmY,3752
62
62
  sgis/raster/sentinel_config.py,sha256=nySDqn2R8M6W8jguoBeSAK_zzbAsqmaI59i32446FwY,1268
63
63
  sgis/raster/zonal.py,sha256=D4Gyptw-yOLTCO41peIuYbY-DANsJCG19xXDlf1QAz4,2299
64
- ssb_sgis-1.2.14.dist-info/LICENSE,sha256=np3IfD5m0ZUofn_kVzDZqliozuiO6wrktw3LRPjyEiI,1073
65
- ssb_sgis-1.2.14.dist-info/METADATA,sha256=Hhvwb5ydmsvVBuINCUdiElVrH2SZaZ-XThmYG_rtGA4,11741
66
- ssb_sgis-1.2.14.dist-info/WHEEL,sha256=sP946D7jFCHeNz5Iq4fL4Lu-PrWrFsgfLXbbkciIZwg,88
67
- ssb_sgis-1.2.14.dist-info/RECORD,,
64
+ ssb_sgis-1.2.15.dist-info/LICENSE,sha256=np3IfD5m0ZUofn_kVzDZqliozuiO6wrktw3LRPjyEiI,1073
65
+ ssb_sgis-1.2.15.dist-info/METADATA,sha256=bM09JKOFG_Upamrd5IZOdfMcqEu-sHSTkkh_RExYiIQ,11824
66
+ ssb_sgis-1.2.15.dist-info/WHEEL,sha256=sP946D7jFCHeNz5Iq4fL4Lu-PrWrFsgfLXbbkciIZwg,88
67
+ ssb_sgis-1.2.15.dist-info/RECORD,,