@@ -241,8 +241,9 @@ def gather_layers(parent_elem, parent_metadata):
241
241
parse_remote_metadata = parse_remote_metadata )
242
242
if cm .id :
243
243
if cm .id in self .contents :
244
- raise KeyError ('Content metadata for layer "%s" '
244
+ msg = ('Content metadata for layer "%s" '
245
245
'already exists' % cm .id )
246
+ warnings .warn (msg , RuntimeWarning )
246
247
self .contents [cm .id ] = cm
247
248
gather_layers (elem , cm )
248
249
gather_layers (caps , None )
@@ -252,17 +253,19 @@ def gather_layers(parent_elem, parent_metadata):
252
253
tms = TileMatrixSet (elem )
253
254
if tms .identifier :
254
255
if tms .identifier in self .tilematrixsets :
255
- raise KeyError ('TileMatrixSet with identifier "%s" '
256
+ msg = ('TileMatrixSet with identifier "%s" '
256
257
'already exists' % tms .identifier )
258
+ warnings .warn (msg , RuntimeWarning )
257
259
self .tilematrixsets [tms .identifier ] = tms
258
260
259
261
self .themes = {}
260
262
for elem in self ._capabilities .findall (_THEMES_TAG + '/' + _THEME_TAG ):
261
263
theme = Theme (elem )
262
264
if theme .identifier :
263
265
if theme .identifier in self .themes :
264
- raise KeyError ('Theme with identifier "%s" already exists'
266
+ msg = ('Theme with identifier "%s" already exists'
265
267
% theme .identifier )
268
+ warnings .warn (msg , RuntimeWarning )
266
269
self .themes [theme .identifier ] = theme
267
270
268
271
serviceMetadataURL = self ._capabilities .find (_SERVICE_METADATA_URL_TAG )
@@ -519,8 +522,9 @@ def __init__(self, elem):
519
522
tm = TileMatrix (tilematrix )
520
523
if tm .identifier :
521
524
if tm .identifier in self .tilematrix :
522
- raise KeyError ('TileMatrix with identifier "%s" '
525
+ msg = ('TileMatrix with identifier "%s" '
523
526
'already exists' % tm .identifier )
527
+ warnings .warn (msg , RuntimeWarning )
524
528
self .tilematrix [tm .identifier ] = tm
525
529
526
530
@@ -748,9 +752,10 @@ def __init__(self, elem, parent=None, index=0, parse_remote_metadata=False):
748
752
for tmsl in tile_matrix_set_links :
749
753
if tmsl .tilematrixset :
750
754
if tmsl .tilematrixset in self .tilematrixsetlinks :
751
- raise KeyError ('TileMatrixSetLink with tilematrixset "%s"'
755
+ msg = ('TileMatrixSetLink with tilematrixset "%s"'
752
756
' already exists' %
753
757
tmsl .tilematrixset )
758
+ warnings .warn (msg , RuntimeWarning )
754
759
self .tilematrixsetlinks [tmsl .tilematrixset ] = tmsl
755
760
756
761
self .resourceURLs = []
0 commit comments