# GeocoderMatch.GetCentroidWkt() throws exception "The given key was not present in the dictionary."

**URL:** <https://community.thinkgeo.com/t/geocodermatch-getcentroidwkt-throws-exception-the-given-key-was-not-present-in-the-dictionary/7274>\
**Category:** Geocoding\
**Created:** [April 3, 2013, 2:56pm UTC](https://community.thinkgeo.com/t/geocodermatch-getcentroidwkt-throws-exception-the-given-key-was-not-present-in-the-dictionary/7274 "2013-04-03T14:56:38Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![Chuck](https://community.thinkgeo.com/letter_avatar_proxy/v4/letter/c/8e7dd6/32.png) [@Chuck](https://community.thinkgeo.com/u/Chuck)\
**Post date:** [April 3, 2013, 2:56pm UTC](https://community.thinkgeo.com/t/geocodermatch-getcentroidwkt-throws-exception-the-given-key-was-not-present-in-the-dictionary/7274/1 "2013-04-03T14:56:38Z")

</div>

We're&nbsp;trying&nbsp;the&nbsp;evaluation&nbsp;version&nbsp;of&nbsp;Geocoder&nbsp;and&nbsp;run&nbsp;into&nbsp;the&nbsp;exception&nbsp;"The&nbsp;given&nbsp;key&nbsp;was&nbsp;not&nbsp;present&nbsp;in&nbsp;the&nbsp;dictionary"&nbsp;when&nbsp;calling&nbsp;GeocoderMatch.GetCentroidWkt().&nbsp;&nbsp;The&nbsp;NameValuePairs&nbsp;collection&nbsp;has&nbsp;an&nbsp;entry&nbsp;for&nbsp;"CentroidPoint"&nbsp;with&nbsp;a&nbsp;value&nbsp;of&nbsp;"POINT(-87.674574&nbsp;41.9633400000002)"&nbsp;which&nbsp;I&nbsp;thought&nbsp;would&nbsp;be&nbsp;used&nbsp;in&nbsp;the&nbsp;GetCentroidWkt()&nbsp;method&nbsp;call.&nbsp;&nbsp;Is&nbsp;that&nbsp;not&nbsp;correct?

Note&nbsp;that&nbsp;we&nbsp;can&nbsp;successfully&nbsp;create&nbsp;a&nbsp;PointShape&nbsp;using:

new&nbsp;PointShape(geocoderMatch.NameValuePairs["CentroidPoint"])

with&nbsp;the&nbsp;WKT&nbsp;listed&nbsp;above.

&nbsp;

---

<div class="post-metadata">

**Author:** ![Gary2](https://community.thinkgeo.com/letter_avatar_proxy/v4/letter/g/49beb7/32.png) [@Gary2](https://community.thinkgeo.com/u/Gary2)\
**Post date:** [April 4, 2013, 4:53am UTC](https://community.thinkgeo.com/t/geocodermatch-getcentroidwkt-throws-exception-the-given-key-was-not-present-in-the-dictionary/7274/2 "2013-04-04T04:53:23Z")

</div>

Hello&nbsp;Chuck,&nbsp;  
&nbsp;&nbsp;  
&nbsp;Thanks&nbsp;for&nbsp;your&nbsp;post,&nbsp;yes&nbsp;it&nbsp;is&nbsp;a&nbsp;bug&nbsp;of&nbsp;GetCentroidWKT(),&nbsp;we&nbsp;have&nbsp;fixed&nbsp;it&nbsp;and&nbsp;now&nbsp;it&nbsp;will&nbsp;return&nbsp;a&nbsp;correct&nbsp;value.&nbsp;You&nbsp;can&nbsp;get&nbsp;newest&nbsp;dll&nbsp;6.0.326.0&nbsp;or&nbsp;later&nbsp;and&nbsp;have&nbsp;another&nbsp;try.&nbsp;  
&nbsp;&nbsp;  
&nbsp;Regards,&nbsp;  
&nbsp;&nbsp;  
&nbsp;Gary&nbsp;
