ssb-sgis 1.3.0__py3-none-any.whl → 1.3.1__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/maps/wms.py CHANGED
@@ -27,11 +27,6 @@ from ..geopandas_tools.conversion import to_shapely
27
27
  from ..geopandas_tools.sfilter import sfilter
28
28
  from ..raster.image_collection import Band
29
29
 
30
- JSON_PATH = Path(__file__).parent / "norge_i_bilder.json"
31
-
32
- # JSON_YEARS = tuple(range(1900, datetime.datetime.now().year + 1))
33
- JSON_YEARS = tuple(range(2006, datetime.datetime.now().year + 1))
34
-
35
30
  DEFAULT_YEARS: tuple[int] = tuple(
36
31
  range(
37
32
  int(datetime.datetime.now().year) - 10,
@@ -100,6 +95,8 @@ class NorgeIBilderWms(WmsLoader):
100
95
  """
101
96
 
102
97
  url: str = "https://wms.geonorge.no/skwms1/wms.nib-prosjekter"
98
+ _min_year: int = 1935
99
+ _json_path = Path(__file__).parent / "norge_i_bilder.json"
103
100
 
104
101
  def __init__(
105
102
  self,
@@ -116,7 +113,7 @@ class NorgeIBilderWms(WmsLoader):
116
113
  self.show = show
117
114
  self._use_json = _use_json
118
115
 
119
- if self._use_json and all(year in JSON_YEARS for year in self.years):
116
+ if self._use_json:
120
117
  self._load_from_json()
121
118
  else:
122
119
  self._tiles = None
@@ -132,8 +129,12 @@ class NorgeIBilderWms(WmsLoader):
132
129
  r"<northBoundLatitude>(.*?)</northBoundLatitude>.*?</EX_GeographicBoundingBox>"
133
130
  )
134
131
 
132
+ url: str = (
133
+ "https://wms.geonorge.no/skwms1/wms.nib-prosjekter?SERVICE=WMS&REQUEST=GetCapabilities"
134
+ )
135
+
135
136
  all_tiles: list[dict] = []
136
- with urlopen(self.url) as file:
137
+ with urlopen(url) as file:
137
138
  xml_data: str = file.read().decode("utf-8")
138
139
 
139
140
  for text in xml_data.split('<Layer queryable="1">')[1:]:
@@ -333,7 +334,7 @@ class NorgeIBilderWms(WmsLoader):
333
334
  def _load_from_json(self) -> None:
334
335
  """Load tiles from json file."""
335
336
  try:
336
- with open(JSON_PATH, encoding="utf-8") as file:
337
+ with open(self._json_path, encoding="utf-8") as file:
337
338
  self._tiles = json.load(file)
338
339
  except FileNotFoundError:
339
340
  self._tiles = None
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: ssb-sgis
3
- Version: 1.3.0
3
+ Version: 1.3.1
4
4
  Summary: GIS functions used at Statistics Norway.
5
5
  Home-page: https://github.com/statisticsnorway/ssb-sgis
6
6
  License: MIT
@@ -23,7 +23,7 @@ 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=sFx-RODoYkuag0ECeeJetj3u9wm-eFoYq40aId_j5dk,31840
26
+ sgis/io/dapla_functions.py,sha256=YkS2QqNyZ_OcZXXUKnHEItvnO9vZ22k7RK30p-kGl0E,31861
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
@@ -33,10 +33,10 @@ sgis/maps/httpserver.py,sha256=I7tTn3hFaTCc-E-T_o9v0nXwMGaS2Xqd4MlWbq8k-J4,3014
33
33
  sgis/maps/legend.py,sha256=gTEWCVIZH1cw6ULVVrJqRR4__uOZvrT3xxQ5lhZMVR4,26899
34
34
  sgis/maps/map.py,sha256=iGa0o7NlUMErJCYJpVzkpDvuWJc8iDN_-tH2X2WcBlI,30802
35
35
  sgis/maps/maps.py,sha256=fLK5WUlQ2YTm7t-8260lYxCFvpZN6j0Y-bVYCyv8NAY,23249
36
- sgis/maps/norge_i_bilder.json,sha256=G9DIN_2vyn-18UF5wUC-koZxFCbiNxMu0BbCJhMFJUk,15050340
36
+ sgis/maps/norge_i_bilder.json,sha256=wUYY8VTanI-C4bpNk7bmnQb8S-S3CBUIRLgdOoydnoQ,20197311
37
37
  sgis/maps/thematicmap.py,sha256=ZtV4Hfylr1ST_cPzi11_lFIsTdY3D1o1EZQbPXZLwyM,25187
38
38
  sgis/maps/tilesources.py,sha256=F4mFHxPwkiPJdVKzNkScTX6xbJAMIUtlTq4mQ83oguw,1746
39
- sgis/maps/wms.py,sha256=wKRZUd3YEwZnMBKmH2YuQCvILrzTl1hq-NMauQz4rs8,12505
39
+ sgis/maps/wms.py,sha256=sCVpKxH1Rsd14GECW7BFh8yaWngpVWYvw9Yhuez1yW8,12482
40
40
  sgis/networkanalysis/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
41
41
  sgis/networkanalysis/_get_route.py,sha256=3m5xQdQqGtt51vcI5fcmYQAOQCeBtL6sorDoPxBNf84,7818
42
42
  sgis/networkanalysis/_od_cost_matrix.py,sha256=zkyPX7ObT996ahaFJ2oI0D0SqQWbWyfy_qLtXwValPg,3434
@@ -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.3.0.dist-info/LICENSE,sha256=np3IfD5m0ZUofn_kVzDZqliozuiO6wrktw3LRPjyEiI,1073
65
- ssb_sgis-1.3.0.dist-info/METADATA,sha256=Nt_je5z3VZ4nVzhpURSXYj2Q252Dg515qry_xZMxndE,11624
66
- ssb_sgis-1.3.0.dist-info/WHEEL,sha256=sP946D7jFCHeNz5Iq4fL4Lu-PrWrFsgfLXbbkciIZwg,88
67
- ssb_sgis-1.3.0.dist-info/RECORD,,
64
+ ssb_sgis-1.3.1.dist-info/LICENSE,sha256=np3IfD5m0ZUofn_kVzDZqliozuiO6wrktw3LRPjyEiI,1073
65
+ ssb_sgis-1.3.1.dist-info/METADATA,sha256=mDvP7_0YnM5lKhKcu3IsX3OYwc-vMIL8mT09tBR_u6o,11624
66
+ ssb_sgis-1.3.1.dist-info/WHEEL,sha256=sP946D7jFCHeNz5Iq4fL4Lu-PrWrFsgfLXbbkciIZwg,88
67
+ ssb_sgis-1.3.1.dist-info/RECORD,,