ssb-sgis 1.2.14__tar.gz → 1.2.15__tar.gz

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.
Files changed (67) hide show
  1. {ssb_sgis-1.2.14 → ssb_sgis-1.2.15}/PKG-INFO +25 -10
  2. {ssb_sgis-1.2.14 → ssb_sgis-1.2.15}/README.md +24 -9
  3. {ssb_sgis-1.2.14 → ssb_sgis-1.2.15}/pyproject.toml +1 -1
  4. {ssb_sgis-1.2.14 → ssb_sgis-1.2.15}/src/sgis/io/dapla_functions.py +11 -1
  5. {ssb_sgis-1.2.14 → ssb_sgis-1.2.15}/src/sgis/maps/legend.py +1 -1
  6. {ssb_sgis-1.2.14 → ssb_sgis-1.2.15}/LICENSE +0 -0
  7. {ssb_sgis-1.2.14 → ssb_sgis-1.2.15}/src/sgis/__init__.py +0 -0
  8. {ssb_sgis-1.2.14 → ssb_sgis-1.2.15}/src/sgis/conf.py +0 -0
  9. {ssb_sgis-1.2.14 → ssb_sgis-1.2.15}/src/sgis/debug_config.py +0 -0
  10. {ssb_sgis-1.2.14 → ssb_sgis-1.2.15}/src/sgis/exceptions.py +0 -0
  11. {ssb_sgis-1.2.14 → ssb_sgis-1.2.15}/src/sgis/geopandas_tools/__init__.py +0 -0
  12. {ssb_sgis-1.2.14 → ssb_sgis-1.2.15}/src/sgis/geopandas_tools/bounds.py +0 -0
  13. {ssb_sgis-1.2.14 → ssb_sgis-1.2.15}/src/sgis/geopandas_tools/buffer_dissolve_explode.py +0 -0
  14. {ssb_sgis-1.2.14 → ssb_sgis-1.2.15}/src/sgis/geopandas_tools/centerlines.py +0 -0
  15. {ssb_sgis-1.2.14 → ssb_sgis-1.2.15}/src/sgis/geopandas_tools/cleaning.py +0 -0
  16. {ssb_sgis-1.2.14 → ssb_sgis-1.2.15}/src/sgis/geopandas_tools/conversion.py +0 -0
  17. {ssb_sgis-1.2.14 → ssb_sgis-1.2.15}/src/sgis/geopandas_tools/duplicates.py +0 -0
  18. {ssb_sgis-1.2.14 → ssb_sgis-1.2.15}/src/sgis/geopandas_tools/general.py +0 -0
  19. {ssb_sgis-1.2.14 → ssb_sgis-1.2.15}/src/sgis/geopandas_tools/geocoding.py +0 -0
  20. {ssb_sgis-1.2.14 → ssb_sgis-1.2.15}/src/sgis/geopandas_tools/geometry_types.py +0 -0
  21. {ssb_sgis-1.2.14 → ssb_sgis-1.2.15}/src/sgis/geopandas_tools/neighbors.py +0 -0
  22. {ssb_sgis-1.2.14 → ssb_sgis-1.2.15}/src/sgis/geopandas_tools/overlay.py +0 -0
  23. {ssb_sgis-1.2.14 → ssb_sgis-1.2.15}/src/sgis/geopandas_tools/point_operations.py +0 -0
  24. {ssb_sgis-1.2.14 → ssb_sgis-1.2.15}/src/sgis/geopandas_tools/polygon_operations.py +0 -0
  25. {ssb_sgis-1.2.14 → ssb_sgis-1.2.15}/src/sgis/geopandas_tools/polygons_as_rings.py +0 -0
  26. {ssb_sgis-1.2.14 → ssb_sgis-1.2.15}/src/sgis/geopandas_tools/runners.py +0 -0
  27. {ssb_sgis-1.2.14 → ssb_sgis-1.2.15}/src/sgis/geopandas_tools/sfilter.py +0 -0
  28. {ssb_sgis-1.2.14 → ssb_sgis-1.2.15}/src/sgis/geopandas_tools/utils.py +0 -0
  29. {ssb_sgis-1.2.14 → ssb_sgis-1.2.15}/src/sgis/helpers.py +0 -0
  30. {ssb_sgis-1.2.14 → ssb_sgis-1.2.15}/src/sgis/io/__init__.py +0 -0
  31. {ssb_sgis-1.2.14 → ssb_sgis-1.2.15}/src/sgis/io/_is_dapla.py +0 -0
  32. {ssb_sgis-1.2.14 → ssb_sgis-1.2.15}/src/sgis/io/opener.py +0 -0
  33. {ssb_sgis-1.2.14 → ssb_sgis-1.2.15}/src/sgis/io/read_parquet.py +0 -0
  34. {ssb_sgis-1.2.14 → ssb_sgis-1.2.15}/src/sgis/maps/__init__.py +0 -0
  35. {ssb_sgis-1.2.14 → ssb_sgis-1.2.15}/src/sgis/maps/examine.py +0 -0
  36. {ssb_sgis-1.2.14 → ssb_sgis-1.2.15}/src/sgis/maps/explore.py +0 -0
  37. {ssb_sgis-1.2.14 → ssb_sgis-1.2.15}/src/sgis/maps/httpserver.py +0 -0
  38. {ssb_sgis-1.2.14 → ssb_sgis-1.2.15}/src/sgis/maps/map.py +0 -0
  39. {ssb_sgis-1.2.14 → ssb_sgis-1.2.15}/src/sgis/maps/maps.py +0 -0
  40. {ssb_sgis-1.2.14 → ssb_sgis-1.2.15}/src/sgis/maps/norge_i_bilder.json +0 -0
  41. {ssb_sgis-1.2.14 → ssb_sgis-1.2.15}/src/sgis/maps/thematicmap.py +0 -0
  42. {ssb_sgis-1.2.14 → ssb_sgis-1.2.15}/src/sgis/maps/tilesources.py +0 -0
  43. {ssb_sgis-1.2.14 → ssb_sgis-1.2.15}/src/sgis/maps/wms.py +0 -0
  44. {ssb_sgis-1.2.14 → ssb_sgis-1.2.15}/src/sgis/networkanalysis/__init__.py +0 -0
  45. {ssb_sgis-1.2.14 → ssb_sgis-1.2.15}/src/sgis/networkanalysis/_get_route.py +0 -0
  46. {ssb_sgis-1.2.14 → ssb_sgis-1.2.15}/src/sgis/networkanalysis/_od_cost_matrix.py +0 -0
  47. {ssb_sgis-1.2.14 → ssb_sgis-1.2.15}/src/sgis/networkanalysis/_points.py +0 -0
  48. {ssb_sgis-1.2.14 → ssb_sgis-1.2.15}/src/sgis/networkanalysis/_service_area.py +0 -0
  49. {ssb_sgis-1.2.14 → ssb_sgis-1.2.15}/src/sgis/networkanalysis/closing_network_holes.py +0 -0
  50. {ssb_sgis-1.2.14 → ssb_sgis-1.2.15}/src/sgis/networkanalysis/cutting_lines.py +0 -0
  51. {ssb_sgis-1.2.14 → ssb_sgis-1.2.15}/src/sgis/networkanalysis/directednetwork.py +0 -0
  52. {ssb_sgis-1.2.14 → ssb_sgis-1.2.15}/src/sgis/networkanalysis/finding_isolated_networks.py +0 -0
  53. {ssb_sgis-1.2.14 → ssb_sgis-1.2.15}/src/sgis/networkanalysis/network.py +0 -0
  54. {ssb_sgis-1.2.14 → ssb_sgis-1.2.15}/src/sgis/networkanalysis/networkanalysis.py +0 -0
  55. {ssb_sgis-1.2.14 → ssb_sgis-1.2.15}/src/sgis/networkanalysis/networkanalysisrules.py +0 -0
  56. {ssb_sgis-1.2.14 → ssb_sgis-1.2.15}/src/sgis/networkanalysis/nodes.py +0 -0
  57. {ssb_sgis-1.2.14 → ssb_sgis-1.2.15}/src/sgis/networkanalysis/traveling_salesman.py +0 -0
  58. {ssb_sgis-1.2.14 → ssb_sgis-1.2.15}/src/sgis/parallel/__init__.py +0 -0
  59. {ssb_sgis-1.2.14 → ssb_sgis-1.2.15}/src/sgis/parallel/parallel.py +0 -0
  60. {ssb_sgis-1.2.14 → ssb_sgis-1.2.15}/src/sgis/py.typed +0 -0
  61. {ssb_sgis-1.2.14 → ssb_sgis-1.2.15}/src/sgis/raster/__init__.py +0 -0
  62. {ssb_sgis-1.2.14 → ssb_sgis-1.2.15}/src/sgis/raster/base.py +0 -0
  63. {ssb_sgis-1.2.14 → ssb_sgis-1.2.15}/src/sgis/raster/image_collection.py +0 -0
  64. {ssb_sgis-1.2.14 → ssb_sgis-1.2.15}/src/sgis/raster/indices.py +0 -0
  65. {ssb_sgis-1.2.14 → ssb_sgis-1.2.15}/src/sgis/raster/regex.py +0 -0
  66. {ssb_sgis-1.2.14 → ssb_sgis-1.2.15}/src/sgis/raster/sentinel_config.py +0 -0
  67. {ssb_sgis-1.2.14 → ssb_sgis-1.2.15}/src/sgis/raster/zonal.py +0 -0
@@ -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
 
@@ -126,9 +126,13 @@ weights["weight"] = 10
126
126
  frequencies = nwa.get_route_frequencies(origins, destinations, weight_df=weights)
127
127
 
128
128
  # plot the results
129
- m = sg.ThematicMap(sg.buff(frequencies, 15), column="frequency", black=True)
130
- m.cmap = "plasma"
131
- m.title = "Number of times each road was used,\nweighted * 10"
129
+ m = sg.ThematicMap(
130
+ sg.buff(frequencies, 15),
131
+ column="frequency",
132
+ black=True,
133
+ cmap="plasma",
134
+ title="Number of times each road was used,\nweighted * 10",
135
+ )
132
136
  m.plot()
133
137
  ```
134
138
 
@@ -143,9 +147,14 @@ service_areas = nwa.service_area(
143
147
  )
144
148
 
145
149
  # plot the results
146
- m = sg.ThematicMap(service_areas, column="minutes", black=True, size=10)
147
- m.k = 10
148
- m.title = "Roads that can be reached within 1 to 10 minutes"
150
+ m = sg.ThematicMap(
151
+ service_areas,
152
+ column="minutes",
153
+ black=True,
154
+ size=10,
155
+ k=10,
156
+ title="Roads that can be reached within 1 to 10 minutes",
157
+ )
149
158
  m.plot()
150
159
  ```
151
160
 
@@ -158,9 +167,15 @@ routes = nwa.get_k_routes(
158
167
  points.iloc[[0]], points.iloc[[1]], k=4, drop_middle_percent=50
159
168
  )
160
169
 
161
- m = sg.ThematicMap(sg.buff(routes, 15), column="k", black=True)
162
- m.title = "Four fastest routes from A to B"
163
- m.legend.title = "Rank"
170
+ m = sg.ThematicMap(
171
+ sg.buff(routes, 15),
172
+ column="k",
173
+ black=True,
174
+ title="Four fastest routes from A to B",
175
+ legend_kwargs=dict(
176
+ title="Rank",
177
+ ),
178
+ )
164
179
  m.plot()
165
180
  ```
166
181
 
@@ -1,6 +1,6 @@
1
1
  [tool.poetry]
2
2
  name = "ssb-sgis"
3
- version = "1.2.14"
3
+ version = "1.2.15"
4
4
  description = "GIS functions used at Statistics Norway."
5
5
  authors = ["Morten Letnes <morten.letnes@ssb.no>"]
6
6
  license = "MIT"
@@ -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
@@ -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,
File without changes
File without changes
File without changes
File without changes