# Create Triangle on Point

**URL:** <https://community.thinkgeo.com/t/create-triangle-on-point/2160>\
**Category:** WinForms\
**Created:** [January 28, 2013, 12:15am UTC](https://community.thinkgeo.com/t/create-triangle-on-point/2160 "2013-01-28T00:15:37Z")\
**Posts on this page:** 12\
**Page:** 1

<div class="post-metadata">

**Author:** ![Sanjay](https://community.thinkgeo.com/letter_avatar_proxy/v4/letter/s/58956e/32.png) [@Sanjay](https://community.thinkgeo.com/u/Sanjay)\
**Post date:** [January 28, 2013, 12:15am UTC](https://community.thinkgeo.com/t/create-triangle-on-point/2160/1 "2013-01-28T00:15:37Z")

</div>

Dear&nbsp;All,

I&nbsp;have&nbsp;a&nbsp;Lat&nbsp;Long&nbsp;Point&nbsp;like&nbsp;(28.571880,77.333780).&nbsp;I&nbsp;want&nbsp;to&nbsp;create&nbsp;a&nbsp;triangle&nbsp;on&nbsp;the&nbsp;point&nbsp;which&nbsp;structure&nbsp;is&nbsp;like&nbsp;below.&nbsp;I&nbsp;also&nbsp;want&nbsp;to&nbsp;fire&nbsp;an&nbsp;event&nbsp;on&nbsp;click&nbsp;on&nbsp;triangle&nbsp;so&nbsp;that&nbsp;we&nbsp;can&nbsp;so&nbsp;the&nbsp;property&nbsp;page&nbsp;for&nbsp;triangle.&nbsp;The&nbsp;triangle&nbsp;structure&nbsp;is&nbsp;like&nbsp;below.

 ![](https://community.thinkgeo.com/uploads/default/original/1X/5429db5e638e6ae2417207adb98369568869e6c9.JPG)

Please&nbsp;suggest.

&nbsp;

---

<div class="post-metadata">

**Author:** ![Edgar](https://community.thinkgeo.com/letter_avatar_proxy/v4/letter/e/b487fb/32.png) [@Edgar](https://community.thinkgeo.com/u/Edgar)\
**Post date:** [January 29, 2013, 1:55am UTC](https://community.thinkgeo.com/t/create-triangle-on-point/2160/2 "2013-01-29T01:55:35Z")

</div>

Hi&nbsp;Sanjay,

Here&nbsp;is&nbsp;the&nbsp;code&nbsp;to&nbsp;get&nbsp;the&nbsp;polygon

`        PolygonShape GenerateTriangle(PointShape point)        {            double heightInMeter = Math.Sqrt(224);            Proj4Projection proj = new Proj4Projection();            proj.InternalProjectionParametersString = Proj4Projection.GetEpsgParametersString(4326);            proj.ExternalProjectionParametersString = Proj4Projection.GetGoogleMapParametersString();            proj.Open();            PointShape pointInMeter = proj.ConvertToExternalProjection(point) as PointShape;            PolygonShape polygon = new PolygonShape();            polygon.OuterRing.Vertices.Add(new Vertex(pointInMeter));            polygon.OuterRing.Vertices.Add(new Vertex(pointInMeter.X - 1, pointInMeter.Y - heightInMeter));            polygon.OuterRing.Vertices.Add(new Vertex(pointInMeter.X + 1, pointInMeter.Y - heightInMeter));            polygon.OuterRing.Vertices.Add(new Vertex(pointInMeter));            return polygon;        }`

And&nbsp;you&nbsp;can&nbsp;put&nbsp;it&nbsp;in&nbsp;an&nbsp;InMemoryFeatureLayer,&nbsp;and&nbsp;when&nbsp;clicking&nbsp;on&nbsp;the&nbsp;map,&nbsp;call&nbsp;the&nbsp;layer.QueryTools.GetFeaturesContaining&nbsp;to&nbsp;get&nbsp;the&nbsp;feature&nbsp;you&nbsp;clicked&nbsp;on.

Regards,

Edgar

---

<div class="post-metadata">

**Author:** ![Sanjay](https://community.thinkgeo.com/letter_avatar_proxy/v4/letter/s/58956e/32.png) [@Sanjay](https://community.thinkgeo.com/u/Sanjay)\
**Post date:** [January 29, 2013, 3:04am UTC](https://community.thinkgeo.com/t/create-triangle-on-point/2160/3 "2013-01-29T03:04:35Z")

</div>

Dear&nbsp;Edgar,

Thanks&nbsp;for&nbsp;reply,

I&nbsp;have&nbsp;worked&nbsp;according&nbsp;your&nbsp;suggestion,&nbsp;but&nbsp;its&nbsp;not&nbsp;showing&nbsp;the&nbsp;triangle,&nbsp;I&nbsp;don't&nbsp;find&nbsp;any&nbsp;reason,&nbsp;please&nbsp;check&nbsp;the&nbsp;attached&nbsp;code.&nbsp;Its&nbsp;working&nbsp;without&nbsp;error,&nbsp;but&nbsp;not&nbsp;showing&nbsp;any&nbsp;triangle

&nbsp;

Regards

&nbsp;

&nbsp;

&nbsp;

---

<div class="post-metadata">

**Author:** ![Edgar](https://community.thinkgeo.com/letter_avatar_proxy/v4/letter/e/b487fb/32.png) [@Edgar](https://community.thinkgeo.com/u/Edgar)\
**Post date:** [January 29, 2013, 3:06am UTC](https://community.thinkgeo.com/t/create-triangle-on-point/2160/4 "2013-01-29T03:06:53Z")

</div>

Sanjay,&nbsp;  
&nbsp;&nbsp;  
&nbsp;You&nbsp;map&nbsp;unit&nbsp;is&nbsp;Decimal&nbsp;degree,&nbsp;but&nbsp;the&nbsp;triangle’s&nbsp;unit&nbsp;is&nbsp;meter,&nbsp;so&nbsp;you&nbsp;have&nbsp;to&nbsp;convert&nbsp;it&nbsp;to&nbsp;decimal&nbsp;degree&nbsp;first&nbsp;and&nbsp;return&nbsp;it.&nbsp;  
&nbsp;&nbsp;  
&nbsp;Regards,&nbsp;  
&nbsp;Edgar&nbsp;

---

<div class="post-metadata">

**Author:** ![Sanjay](https://community.thinkgeo.com/letter_avatar_proxy/v4/letter/s/58956e/32.png) [@Sanjay](https://community.thinkgeo.com/u/Sanjay)\
**Post date:** [January 29, 2013, 4:00am UTC](https://community.thinkgeo.com/t/create-triangle-on-point/2160/5 "2013-01-29T04:00:58Z")

</div>

Dear&nbsp;Edgar,

Thanks&nbsp;for&nbsp;reply,

My&nbsp;Mapunit&nbsp;is&nbsp;already&nbsp;in&nbsp;Meter,&nbsp;but&nbsp;now&nbsp;the&nbsp;triangle&nbsp;is&nbsp;loaded&nbsp;on&nbsp;map,&nbsp;but&nbsp;it&nbsp;looks&nbsp;like&nbsp;very&nbsp;big,&nbsp;the&nbsp;triangle&nbsp;height&nbsp;is&nbsp;15&nbsp;m.

 ![](https://community.thinkgeo.com/uploads/default/original/2X/d/daf8068f28a41e49ce3e7fe54a61ac758ea58468.JPG)

Please&nbsp;help

Regards

Sanjay

---

<div class="post-metadata">

**Author:** ![Edgar](https://community.thinkgeo.com/letter_avatar_proxy/v4/letter/e/b487fb/32.png) [@Edgar](https://community.thinkgeo.com/u/Edgar)\
**Post date:** [January 29, 2013, 7:54pm UTC](https://community.thinkgeo.com/t/create-triangle-on-point/2160/6 "2013-01-29T19:54:18Z")

</div>

Sanjay,

Maybe&nbsp;there&nbsp;is&nbsp;something&nbsp;wrong&nbsp;with&nbsp;your&nbsp;code&nbsp;about&nbsp;the&nbsp;projection,&nbsp;could&nbsp;you&nbsp;plese&nbsp;provide&nbsp;your&nbsp;code&nbsp;to&nbsp;us&nbsp;the&nbsp;have&nbsp;a&nbsp;look?

Thanks,

Edgar

---

<div class="post-metadata">

**Author:** ![Sanjay](https://community.thinkgeo.com/letter_avatar_proxy/v4/letter/s/58956e/32.png) [@Sanjay](https://community.thinkgeo.com/u/Sanjay)\
**Post date:** [January 30, 2013, 5:03am UTC](https://community.thinkgeo.com/t/create-triangle-on-point/2160/7 "2013-01-30T05:03:17Z")

</div>

Dear&nbsp;Edgar,&nbsp;  
&nbsp;&nbsp;  
&nbsp;Thanks&nbsp;for&nbsp;reply,&nbsp;  
&nbsp;&nbsp;  
&nbsp;I&nbsp;set&nbsp;the&nbsp;value&nbsp;(height&nbsp;and&nbsp;width)&nbsp;triangle&nbsp;as&nbsp;&nbsp;per&nbsp;scale,&nbsp;now&nbsp;its&nbsp;working&nbsp;for&nbsp;me.&nbsp;  
&nbsp;&nbsp;  
&nbsp;Thanks&nbsp;for&nbsp;help.&nbsp;  
&nbsp;Sanjay

---

<div class="post-metadata">

**Author:** ![Edgar](https://community.thinkgeo.com/letter_avatar_proxy/v4/letter/e/b487fb/32.png) [@Edgar](https://community.thinkgeo.com/u/Edgar)\
**Post date:** [January 30, 2013, 7:53pm UTC](https://community.thinkgeo.com/t/create-triangle-on-point/2160/8 "2013-01-30T19:53:16Z")

</div>

Sanjay,&nbsp;  
&nbsp;&nbsp;  
&nbsp;Glad&nbsp;to&nbsp;hear&nbsp;that&nbsp;it’s&nbsp;working,&nbsp;if&nbsp;you&nbsp;have&nbsp;any&nbsp;questions&nbsp;please&nbsp;let&nbsp;us&nbsp;know.&nbsp;  
&nbsp;&nbsp;  
&nbsp;Regards,&nbsp;  
&nbsp;Edgar

---

<div class="post-metadata">

**Author:** ![Sanjay](https://community.thinkgeo.com/letter_avatar_proxy/v4/letter/s/58956e/32.png) [@Sanjay](https://community.thinkgeo.com/u/Sanjay)\
**Post date:** [January 31, 2013, 6:12am UTC](https://community.thinkgeo.com/t/create-triangle-on-point/2160/9 "2013-01-31T06:12:50Z")

</div>

Dear&nbsp;Edgar,

After&nbsp;plotting&nbsp;triangle,&nbsp;I&nbsp;plotted&nbsp;rectangle&nbsp;on&nbsp;the&nbsp;Lat,&nbsp;long&nbsp;point&nbsp;of&nbsp;triangle,&nbsp;but&nbsp;as&nbsp;per&nbsp;feature,&nbsp;when&nbsp;I&nbsp;try&nbsp;to&nbsp;plot&nbsp;rectangle,&nbsp;rectangle&nbsp;takes&nbsp;point&nbsp;(Upper&nbsp;left&nbsp;point,&nbsp;Lower&nbsp;right&nbsp;point)&nbsp;and&nbsp;plotted&nbsp;it.&nbsp;Again&nbsp;Next&nbsp;rectangle&nbsp;will&nbsp;plot&nbsp;above&nbsp;rectangle.&nbsp;The&nbsp;number&nbsp;of&nbsp;rectangle&nbsp;will&nbsp;be&nbsp;plotted,&nbsp;based&nbsp;on&nbsp;database&nbsp;value.

Here&nbsp;I&nbsp;am&nbsp;putting&nbsp;the&nbsp;resulted&nbsp;map

 ![](https://community.thinkgeo.com/uploads/default/original/2X/6/6e9f63ed24d59260a7d4173ee5c29bc908e885cd.JPG)

And&nbsp;my&nbsp;desired&nbsp;map&nbsp;will&nbsp;be

 ![](https://community.thinkgeo.com/uploads/default/original/2X/7/7303d96221c0dc2875c74dff18c44963d78680bd.JPG)

Here&nbsp;I&nbsp;am&nbsp;attaching&nbsp;my&nbsp;code,&nbsp;please&nbsp;look&nbsp;and&nbsp;guide&nbsp;me&nbsp;the&nbsp;best&nbsp;option&nbsp;to&nbsp;achieve&nbsp;the&nbsp;requirement.&nbsp;I&nbsp;also&nbsp;will&nbsp;click&nbsp;on&nbsp;each&nbsp;and&nbsp;every&nbsp;rectangle&nbsp;and&nbsp;will&nbsp;get&nbsp;value&nbsp;on&nbsp;click&nbsp;on&nbsp;rectangle.

Thanks

Sanjay

[001\_Tower.txt](https://community.thinkgeo.com/uploads/default/original/2X/2/2c9a0c73dd792bbd58da1abf6b91cee708761b22.txt) (8.54 KB)

---

<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:** [February 1, 2013, 2:21am UTC](https://community.thinkgeo.com/t/create-triangle-on-point/2160/10 "2013-02-01T02:21:22Z")

</div>

&nbsp;Hello&nbsp;&nbsp;Sanjay

&nbsp;  
Thanks&nbsp;for&nbsp;your&nbsp;further&nbsp;information,&nbsp;it's&nbsp;a&nbsp;validate&nbsp;bug&nbsp;and&nbsp;we&nbsp;have&nbsp;fixed&nbsp;it.  
&nbsp;  
Please&nbsp;get&nbsp;the&nbsp;latest&nbsp;version&nbsp;2.0.0.264&nbsp;or&nbsp;2.0.264.0&nbsp;and&nbsp;try&nbsp;the&nbsp;code&nbsp;attached.  
&nbsp;  
Hope&nbsp;it&nbsp;helps.  
&nbsp;  
Regards,  
&nbsp;  
Gary  
&nbsp;  
  
[Post10999.txt](https://community.thinkgeo.com/uploads/default/original/2X/1/18bcb6289a1b22a6d40c88b8c4ead544ad9083f0.txt) (9.11 KB)

---

<div class="post-metadata">

**Author:** ![Sanjay](https://community.thinkgeo.com/letter_avatar_proxy/v4/letter/s/58956e/32.png) [@Sanjay](https://community.thinkgeo.com/u/Sanjay)\
**Post date:** [February 2, 2013, 6:32am UTC](https://community.thinkgeo.com/t/create-triangle-on-point/2160/11 "2013-02-02T06:32:51Z")

</div>

Dear&nbsp;Gary,&nbsp;  
&nbsp;&nbsp;  
&nbsp;Thanks&nbsp;for&nbsp;reply,&nbsp;  
&nbsp;&nbsp;  
&nbsp;Actually&nbsp;currently&nbsp;I&nbsp;am&nbsp;using&nbsp;5.0.109.0&nbsp;where&nbsp;I&nbsp;will&nbsp;get&nbsp;2.0.0.264.&nbsp;  
&nbsp;&nbsp;  
&nbsp;Regards&nbsp;  
&nbsp;Sanjay

---

<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:** [February 3, 2013, 9:37pm UTC](https://community.thinkgeo.com/t/create-triangle-on-point/2160/12 "2013-02-03T21:37:08Z")

</div>

Hello&nbsp;Sanjay,&nbsp;  
&nbsp;&nbsp;  
&nbsp;Sorry&nbsp;for&nbsp;my&nbsp;mistake,&nbsp;I&nbsp;mean&nbsp;6.0.264.0&nbsp;or&nbsp;6.0.0.264,&nbsp;this&nbsp;is&nbsp;the&nbsp;newest&nbsp;version(in&nbsp;that&nbsp;day,&nbsp;now&nbsp;the&nbsp;version&nbsp;is&nbsp;266)&nbsp;and&nbsp;you&nbsp;can&nbsp;get&nbsp;it&nbsp;from&nbsp;[helpdesk.thinkgeo.com](http://helpdesk.thinkgeo.com).&nbsp;  
&nbsp;&nbsp;  
&nbsp;And&nbsp;if&nbsp;you&nbsp;are&nbsp;upgrade&nbsp;from&nbsp;5.0,&nbsp;there&nbsp;is&nbsp;something&nbsp;you&nbsp;need&nbsp;noticed,&nbsp;6.0.266.0&nbsp;is&nbsp;our&nbsp;development&nbsp;branch&nbsp;and&nbsp;6.0.0.266&nbsp;is&nbsp;our&nbsp;release&nbsp;branch,&nbsp;for&nbsp;now,&nbsp;the&nbsp;difference&nbsp;between&nbsp;these&nbsp;two&nbsp;branches&nbsp;is&nbsp;development&nbsp;branch&nbsp;using&nbsp;.net&nbsp;4.0&nbsp;and&nbsp;release&nbsp;branch&nbsp;keep&nbsp;using&nbsp;.clear&nbsp;3.5&nbsp;as&nbsp;MapSuite&nbsp;5.0,&nbsp;so&nbsp;if&nbsp;you’d&nbsp;like&nbsp;to&nbsp;upgrade&nbsp;the&nbsp;.net&nbsp;framework&nbsp;too,&nbsp;you&nbsp;can&nbsp;choose&nbsp;development&nbsp;branch&nbsp;if&nbsp;not&nbsp;you&nbsp;can&nbsp;choose&nbsp;release&nbsp;branch.&nbsp;  
&nbsp;&nbsp;  
&nbsp;Please&nbsp;feel&nbsp;free&nbsp;to&nbsp;let&nbsp;us&nbsp;know&nbsp;if&nbsp;you&nbsp;have&nbsp;any&nbsp;queries.&nbsp;  
&nbsp;&nbsp;  
&nbsp;Regards,&nbsp;  
&nbsp;&nbsp;  
&nbsp;Gary
