Skip to content

Commit 959e9d5

Browse files
Rebase with main and add commented excluded basemaps in _compress_providers
1 parent 117c3d2 commit 959e9d5

File tree

3 files changed

+70
-8
lines changed

3 files changed

+70
-8
lines changed

provider_sources/_compress_providers.py

Lines changed: 38 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -123,18 +123,50 @@
123123
max_zoom = int((TileMatrixSetLimits[-1]["TileMatrix"]))
124124
TileMatrixSet = layer["TileMatrixSetLink"]["TileMatrixSet"]
125125
format = layer["Format"]
126-
bounding_lowerleft_corner = layer["ows:WGS84BoundingBox"]["ows:LowerCorner"]# given with lon/lat order
127-
bounding_upperright_corner = layer["ows:WGS84BoundingBox"]["ows:UpperCorner"]# given with lon/lat order
128-
lowerleft_corner_lon, lowerleft_corner_lat = bounding_lowerleft_corner.split(" ")
129-
upperright_corner_lon, upperright_corner_lat = bounding_upperright_corner.split(" ")
130-
bounds = [[float(lowerleft_corner_lat), float(lowerleft_corner_lon)], [float(upperright_corner_lat), float(upperright_corner_lon)]]
131-
126+
bounding_lowerleft_corner = layer["ows:WGS84BoundingBox"][
127+
"ows:LowerCorner"
128+
] # given with lon/lat order
129+
bounding_upperright_corner = layer["ows:WGS84BoundingBox"][
130+
"ows:UpperCorner"
131+
] # given with lon/lat order
132+
lowerleft_corner_lon, lowerleft_corner_lat = bounding_lowerleft_corner.split(
133+
" "
134+
)
135+
upperright_corner_lon, upperright_corner_lat = bounding_upperright_corner.split(
136+
" "
137+
)
138+
bounds = [
139+
[float(lowerleft_corner_lat), float(lowerleft_corner_lon)],
140+
[float(upperright_corner_lat), float(upperright_corner_lon)],
141+
]
142+
#excluded_list = [
143+
#"PROTECTEDAREAS.APG",
144+
#"PROTECTEDAREAS.GP",
145+
#"PROTECTEDAREAS.PRSF",
146+
#"PROTECTEDAREAS.RIPN",
147+
#"PROTECTEDAREAS.RNC",
148+
#"OCSGE.CONSTRUCTIONS.2002",
149+
#"OCSGE.CONSTRUCTIONS.2014",
150+
#"OCSGE.COUVERTURE.2002",
151+
#"OCSGE.COUVERTURE.2014",
152+
#"OCSGE.USAGE.2002",
153+
#"OCSGE.USAGE.2014",
154+
#"ORTHOIMAGERY.ORTHOPHOTOS.COAST2000",
155+
#"PCRS.LAMB93",
156+
#"ORTHOIMAGERY.ORTHO-SAT.SPOT.2013",
157+
#"SECUROUTE.TE.ALL",
158+
#"SECUROUTE.TE.OA",
159+
#"SECUROUTE.TE.PN",
160+
#"SECUROUTE.TE.PND",
161+
#]
132162
if format == "application/x-protobuf":
133163
pass
134164
elif format == "image/x-bil;bits=32":
135165
pass
136166
elif apikey == "lambert93":
137167
pass
168+
#elif variant in excluded_list:
169+
#pass
138170
else:
139171
tilelayers_list.append("GeoportailFrance." + name)
140172
leaflet["GeoportailFrance"][name] = {

xyzservices/data/providers.json

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8409,6 +8409,29 @@
84098409
"name": "GeoportailFrance.Hydrography_Hydrography",
84108410
"TileMatrixSet": "PM"
84118411
},
8412+
"Transportnetwork_Commontransportelements_Markerpost": {
8413+
"url": "https://wxs.ign.fr/{apikey}/geoportail/wmts?REQUEST=GetTile&SERVICE=WMTS&VERSION=1.0.0&STYLE={style}&TILEMATRIXSET={TileMatrixSet}&FORMAT={format}&LAYER={variant}&TILEMATRIX={z}&TILEROW={y}&TILECOL={x}",
8414+
"html_attribution": "<a target=\"_blank\"href=\"https://www.geoportail.gouv.fr/\">Geoportail France</a>",
8415+
"attribution": "Geoportail France",
8416+
"bounds": [
8417+
[
8418+
41.3252,
8419+
-5.15047
8420+
],
8421+
[
8422+
51.0991,
8423+
9.57054
8424+
]
8425+
],
8426+
"min_zoom": 10,
8427+
"max_zoom": 18,
8428+
"apikey": "topographie",
8429+
"format": "image/png",
8430+
"style": "normal",
8431+
"variant": "TRANSPORTNETWORK.COMMONTRANSPORTELEMENTS.MARKERPOST",
8432+
"name": "GeoportailFrance.Transportnetwork_Commontransportelements_Markerpost",
8433+
"TileMatrixSet": "PM"
8434+
},
84128435
"Transportnetworks_Railways": {
84138436
"url": "https://wxs.ign.fr/{apikey}/geoportail/wmts?REQUEST=GetTile&SERVICE=WMTS&VERSION=1.0.0&STYLE={style}&TILEMATRIXSET={TileMatrixSet}&FORMAT={format}&LAYER={variant}&TILEMATRIX={z}&TILEROW={y}&TILECOL={x}",
84148437
"html_attribution": "<a target=\"_blank\"href=\"https://www.geoportail.gouv.fr/\">Geoportail France</a>",

xyzservices/tests/test_providers.py

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -68,8 +68,15 @@ def get_test_result(provider, allow_403=True):
6868
(16, 33149, 22973),
6969
(0, 0, 0),
7070
(2, 6, 7),
71-
(9, 181, 259),
72-
(14, 8298, 5636),
71+
(6, 21, 31),
72+
(6, 21, 32),
73+
(6, 21, 33),
74+
(6, 22, 31),
75+
(6, 22, 32),
76+
(6, 22, 33),
77+
(6, 23, 31),
78+
(6, 23, 32),
79+
(6, 23, 33),
7380
]
7481
results = []
7582
for o in options:

0 commit comments

Comments
 (0)