ThinkGeo.com    |     Documentation    |     Premium Support

Error opening some GPX layers

Hi Guys,

I’ve been working on a utility to convert GPX files to Shapefiles. When the GPX layer is opened, sometimes I get an exception:

“An item with the same key has already been added.”

I took a closer look at the GPX file contents and found there were multiple links defined right after the opening tag for the track:

<trk>
<name>Jura Route 7 / 2011 on GPSies.com</name>
<link href=“http://www.gpsies.com/map.do?fileId=klbbhppyykgoeivn”>
<type>trackOnWeb</type>
</link>
<link href=“http://www.gpsies.com/charts/kl/map/klbbhppyykgoeivn_map.png”>
<type>elevationChartUrlMap</type>
</link>
<link href=“http://www.gpsies.com/charts/kl/mapThumb/klbbhppyykgoeivn_mapThumb.png”>
<type>elevationChartUrlMapThumb
</link>
<link href=“http://www.gpsies.com/charts/kl/tab/klbbhppyykgoeivn_tab.png”>
<type>elevationChartUrlTab
</link>

It looks like the GPX layer is trying to create multiple columns with the name ‘link’, I believe that is what is causing the error.

I have attached the file so you can have a look.

Thanks!

Steve
JuraRoute72011.zip (22.7 KB)

Hey @Steven1,

It was exactly what you thought. We added a check to make sure another attribute of the same name doesn’t get added twice. That change will be available in about 6 hours from this posting on our beta package channel in Nuget.

Since I know you are working on GPX if you send an e-mail support@thinkgeo.com, we can send out the source for the GPX class and if you make changes feel free to share them back to us.

Thanks,
Kyle