# Problem finding features with RotateProjection

**URL:** <https://community.thinkgeo.com/t/problem-finding-features-with-rotateprojection/1719>\
**Category:** WinForms\
**Created:** [May 30, 2011, 6:46am UTC](https://community.thinkgeo.com/t/problem-finding-features-with-rotateprojection/1719 "2011-05-30T06:46:30Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![Oleg](https://community.thinkgeo.com/letter_avatar_proxy/v4/letter/o/ebca7d/32.png) [@Oleg](https://community.thinkgeo.com/u/Oleg)\
**Post date:** [May 30, 2011, 6:46am UTC](https://community.thinkgeo.com/t/problem-finding-features-with-rotateprojection/1719/1 "2011-05-30T06:46:30Z")

</div>

Hi,

&nbsp;

I'm&nbsp;trying&nbsp;to&nbsp;get&nbsp;features&nbsp;from&nbsp;the&nbsp;map&nbsp;with&nbsp;a&nbsp;mouse&nbsp;click.&nbsp;I&nbsp;use&nbsp;GetFeaturesNearestTo&nbsp;method.&nbsp;It&nbsp;used&nbsp;to&nbsp;work&nbsp;fine&nbsp;until&nbsp;I&nbsp;added&nbsp;a&nbsp;RotateProjection.&nbsp;&nbsp;Now&nbsp;when&nbsp;I&nbsp;click&nbsp;the&nbsp;item&nbsp;on&nbsp;the&nbsp;map&nbsp;and&nbsp;try&nbsp;to&nbsp;get&nbsp;its&nbsp;feature&nbsp;I&nbsp;get&nbsp;InvalidoperationException:&nbsp;Cannot&nbsp;get&nbsp;the&nbsp;projection’s&nbsp;InternalGeographyUnit,&nbsp;please&nbsp;provide&nbsp;it&nbsp;by&nbsp;overriding&nbsp;the&nbsp;Projection’s&nbsp;GetInternalGeographyUnitCore()&nbsp;method.&nbsp;I&nbsp;found&nbsp;that&nbsp;rotateProjection.GetInternalGeographyUnit&nbsp;method&nbsp;returns&nbsp;'Unknown'&nbsp;and&nbsp;that's&nbsp;apparently&nbsp;is&nbsp;the&nbsp;source&nbsp;of&nbsp;the&nbsp;problem.&nbsp;There&nbsp;seems&nbsp;to&nbsp;be&nbsp;very&nbsp;similar&nbsp;bug&nbsp;fixed&nbsp;in&nbsp;version&nbsp;5.0.0.0&nbsp;of&nbsp;ThinkGeo.MapSuite.Core&nbsp;Namespace:&nbsp;"Fixed&nbsp;a&nbsp;bug&nbsp;where&nbsp;the&nbsp;GetInternalGeographyUnit&nbsp;always&nbsp;return&nbsp;Unknown&nbsp;&nbsp;when&nbsp;using&nbsp;FeatureSource.GetFeaturesWithinDistance&nbsp;with&nbsp;the&nbsp;&nbsp;RotationProjection".&nbsp;However&nbsp;it's&nbsp;only&nbsp;listed&nbsp;in&nbsp;release&nbsp;notes&nbsp;of&nbsp;WMS&nbsp;server,&nbsp;Silverlight&nbsp;and&nbsp;Services&nbsp;editions.&nbsp;And&nbsp;I&nbsp;use&nbsp;Desktop&nbsp;edition.&nbsp;I&nbsp;downloaded&nbsp;the&nbsp;latest&nbsp;daily&nbsp;build&nbsp;libraries&nbsp;(5.0.0.19)&nbsp;but&nbsp;the&nbsp;problem&nbsp;still&nbsp;persists.&nbsp;Is&nbsp;it&nbsp;not&nbsp;fixed&nbsp;yet&nbsp;in&nbsp;the&nbsp;Desktop&nbsp;edition&nbsp;or&nbsp;am&nbsp;I&nbsp;doing&nbsp;something&nbsp;wrong?&nbsp;Should&nbsp;I&nbsp;set&nbsp;the&nbsp;geography&nbsp;unit&nbsp;of&nbsp;rotate&nbsp;projection&nbsp;manually&nbsp;or&nbsp;something?

Here's&nbsp;some&nbsp;sample&nbsp;code:

InMemoryFeatureLayer&nbsp;dirLayer&nbsp;=&nbsp;(InMemoryFeatureLayer)winformsMap.FindFeatureLayer(LayerName);  
  
Collection\<string\>&nbsp;columnNames&nbsp;=&nbsp;new&nbsp;Collection\<string\>();  
  
columnNames.Add("Id");  
  
Collection\<Feature\>&nbsp;features&nbsp;=&nbsp;dirLayer.FeatureSource.GetFeaturesNearestTo(new&nbsp;PointShape(e.WorldX,&nbsp;e.WorldY),&nbsp;  
  
winformsMap.MapUnit,&nbsp;1,&nbsp;columnNames,&nbsp;distanceBuffer,&nbsp;DistanceUnit.Meter);  
  
&nbsp;

&nbsp;

Regards,

Oleg

---

<div class="post-metadata">

**Author:** ![Oleg](https://community.thinkgeo.com/letter_avatar_proxy/v4/letter/o/ebca7d/32.png) [@Oleg](https://community.thinkgeo.com/u/Oleg)\
**Post date:** [May 30, 2011, 7:46am UTC](https://community.thinkgeo.com/t/problem-finding-features-with-rotateprojection/1719/2 "2011-05-30T07:46:22Z")

</div>

One&nbsp;more&nbsp;thing&nbsp;I&nbsp;noticed:&nbsp;when&nbsp;using&nbsp;libraries&nbsp;of&nbsp;version&nbsp;4.5.0.0&nbsp;everything&nbsp;works&nbsp;fine&nbsp;with&nbsp;the&nbsp;same&nbsp;exact&nbsp;code.&nbsp;However&nbsp;version&nbsp;4.5.&nbsp;has&nbsp;bug&nbsp;with&nbsp;rotating&nbsp;InMemoryFeatureLayer,&nbsp;which&nbsp;is&nbsp;fixed&nbsp;in&nbsp;version&nbsp;5.0.&nbsp;So&nbsp;I'm&nbsp;in&nbsp;a&nbsp;kind&nbsp;of&nbsp;deadlock&nbsp;situation.

Oleg

---

<div class="post-metadata">

**Author:** ![ThinkGeo](https://community.thinkgeo.com/user_avatar/community.thinkgeo.com/thinkgeo/32/25029_2.png) [@ThinkGeo](https://community.thinkgeo.com/u/ThinkGeo)\
**Post date:** [May 30, 2011, 10:00am UTC](https://community.thinkgeo.com/t/problem-finding-features-with-rotateprojection/1719/3 "2011-05-30T10:00:17Z")

</div>

Oleg,&nbsp;  
&nbsp;&nbsp;  
&nbsp;Thanks&nbsp;for&nbsp;your&nbsp;post,&nbsp;I&nbsp;believe&nbsp;this&nbsp;problem&nbsp;had&nbsp;been&nbsp;fixed&nbsp;for&nbsp;Desktop&nbsp;Edition&nbsp;if&nbsp;it&nbsp;was&nbsp;fixed&nbsp;in&nbsp;the&nbsp;other&nbsp;products,&nbsp;because&nbsp;this&nbsp;ability&nbsp;is&nbsp;from&nbsp;our&nbsp;core&nbsp;code,&nbsp;all&nbsp;products&nbsp;depend&nbsp;on&nbsp;it.&nbsp;Also&nbsp;the&nbsp;posted&nbsp;code&nbsp;is&nbsp;not&nbsp;enough&nbsp;for&nbsp;me&nbsp;to&nbsp;reproduce&nbsp;your&nbsp;problem,&nbsp;as&nbsp;your&nbsp;descriptions,&nbsp;I&nbsp;think&nbsp;the&nbsp;problem&nbsp;is&nbsp;from&nbsp;your&nbsp;rotate&nbsp;projection,&nbsp;can&nbsp;you&nbsp;give&nbsp;us&nbsp;a&nbsp;simple&nbsp;sample&nbsp;that&nbsp;can&nbsp;reproduce&nbsp;your&nbsp;problem&nbsp;properly&nbsp;so&nbsp;that&nbsp;we&nbsp;can&nbsp;help&nbsp;you&nbsp;fix&nbsp;your&nbsp;problem&nbsp;as&nbsp;soon&nbsp;as&nbsp;possible?&nbsp;  
&nbsp;&nbsp;  
&nbsp;Thanks,&nbsp;  
&nbsp;&nbsp;  
&nbsp;Scott,

---

<div class="post-metadata">

**Author:** ![Oleg](https://community.thinkgeo.com/letter_avatar_proxy/v4/letter/o/ebca7d/32.png) [@Oleg](https://community.thinkgeo.com/u/Oleg)\
**Post date:** [May 31, 2011, 6:38am UTC](https://community.thinkgeo.com/t/problem-finding-features-with-rotateprojection/1719/4 "2011-05-31T06:38:12Z")

</div>

Apparently&nbsp;in&nbsp;version&nbsp;5&nbsp;you&nbsp;need&nbsp;to&nbsp;set&nbsp;the&nbsp;GeographyUnit&nbsp;manually&nbsp;like&nbsp;this:

rotateProjection.SourceUnit&nbsp;=&nbsp;GeographyUnit.DecimalDegree;

I&nbsp;missed&nbsp;it&nbsp;somehow,&nbsp;so&nbsp;the&nbsp;problem&nbsp;is&nbsp;solved.

There&nbsp;was&nbsp;actually&nbsp;another&nbsp;problem,&nbsp;I&nbsp;created&nbsp;a&nbsp;support&nbsp;ticket&nbsp;but&nbsp;for&nbsp;some&nbsp;reason&nbsp;can't&nbsp;open&nbsp;it.&nbsp;Every&nbsp;time&nbsp;I&nbsp;try&nbsp;to&nbsp;open&nbsp;it&nbsp;it&nbsp;says:

### Sorry,&nbsp;an&nbsp;error&nbsp;occurred&nbsp;while&nbsp;processing&nbsp;your&nbsp;request.&nbsp;Please&nbsp;contact&nbsp;our&nbsp;support.
  

Same&nbsp;happens&nbsp;if&nbsp;I&nbsp;click&nbsp;the&nbsp;link&nbsp;I&nbsp;got&nbsp;by&nbsp;email&nbsp;or&nbsp;by&nbsp;clicking&nbsp;it&nbsp;in&nbsp;the&nbsp;customer&nbsp;portal.

&nbsp;

Regards,

Oleg

---

<div class="post-metadata">

**Author:** ![ThinkGeo](https://community.thinkgeo.com/user_avatar/community.thinkgeo.com/thinkgeo/32/25029_2.png) [@ThinkGeo](https://community.thinkgeo.com/u/ThinkGeo)\
**Post date:** [May 31, 2011, 11:18am UTC](https://community.thinkgeo.com/t/problem-finding-features-with-rotateprojection/1719/5 "2011-05-31T11:18:18Z")

</div>

Oleg,&nbsp;  
&nbsp;&nbsp;  
&nbsp;This&nbsp;issue&nbsp;has&nbsp;been&nbsp;resolved&nbsp;and&nbsp;now&nbsp;you&nbsp;can&nbsp;access&nbsp;the&nbsp;customer&nbsp;portal&nbsp;tickets&nbsp;properly,&nbsp;  
&nbsp;&nbsp;  
&nbsp;Any&nbsp;more&nbsp;questions&nbsp;please&nbsp;let&nbsp;me&nbsp;know,&nbsp;  
&nbsp;&nbsp;  
&nbsp;Thanks,&nbsp;  
&nbsp;&nbsp;  
&nbsp;Scott,
