04-12-2020 09:56 PM
I am getting following error while adding Public accessible WMS in the apollo Geospatial Portal. error message: "An item with same key has already been added"
Software products installed in the Machine.
GeoMedia WebMap 2018 - Version: 16.5.0200.00016
ERDAS APOLLO 2018 - Version: 16.05.01.0044
ERDAS Apollo Data Manager – version – 16.5.1.Build37
Geospatial SDI 2018 - Version: 16.5.0200.00014
Geospatial Licensing Administrator 2018
GeoMedia Desktop 2018 - version: 16.5.0 Build 4108
Find the attached screenshot of error for your reference. Thanks in advance for your solution.
04-21-2020 10:41 AM - edited 04-21-2020 10:42 AM
I can see this issue in my Apollo 2020 update 1 portal, same error when add WMS.
I tried Gaia, and Gaia could not list all images in this WMS.
Also tried ERDAS IMAGINE, IMAGINE can populate list of images in the WMS, and rendering is also working.
Please file a support ticket.
04-22-2020 04:35 AM
The Portal log says the following:
ERROR Intergraph.WebSolutions.Core.WebClient.Platform.MapServices.MapServiceManagerHandler [(null)] - Processing ended with exception. System.ArgumentException: An item with the same key has already been added. at System.ThrowHelper.ThrowArgumentException(ExceptionResource resource) at System.Collections.Generic.Dictionary`2.Insert(TKey key, TValue value, Boolean add) at Intergraph.WebSolutions.Core.WebClient.Platform.Serialization.MapServiceSerializer.GetLegendItemDefaultPrioritiesStubs(LegendDefinition legendDefinition, IEnumerable`1 legendItemDefinitions)
Which means it failed during loading legend entries - in particular legend entry names are retrieved and being stored into a dictionary object. The exception says that it found same WMS legend entry name.
Here's a simple way how to find the duplicate using Notepad++ (XMLTools plug-in required):
As per the OGC - the Name element, although generally considered a unique identifier, can have same values across the Capabilities document. But for obvious reasons, this is not a good practice. Portal was developed in order to disallow duplicate layer Names because the consequent GetMap requests could be ambiguous.
Portal currently doesn't allow duplicate layer names as it was designed like that.
You can work around the issue by removing one of the duplicate layers. To do so on the client side:
1) Save the Capabilities XML into an IIS folder on your server.
2) Edit the file and remove one of the Layers named 'disaster:AM_LS'.
3) Register your local XML version in Portal.