# Selection of a line of a polygon

**URL:** <https://community.thinkgeo.com/t/selection-of-a-line-of-a-polygon/3265>\
**Category:** WPF\
**Created:** [August 2, 2012, 10:48am UTC](https://community.thinkgeo.com/t/selection-of-a-line-of-a-polygon/3265 "2012-08-02T10:48:10Z")\
**Posts on this page:** 8\
**Page:** 1

<div class="post-metadata">

**Author:** ![Steph](https://community.thinkgeo.com/letter_avatar_proxy/v4/letter/s/22d042/32.png) [@Steph](https://community.thinkgeo.com/u/Steph)\
**Post date:** [August 2, 2012, 10:48am UTC](https://community.thinkgeo.com/t/selection-of-a-line-of-a-polygon/3265/1 "2012-08-02T10:48:10Z")

</div>

&nbsp;

Hi,&nbsp;  
&nbsp;  
I&nbsp;have&nbsp;a&nbsp;question&nbsp;about&nbsp;the&nbsp;selection&nbsp;of&nbsp;a&nbsp;line&nbsp;of&nbsp;a&nbsp;polygon.  
&nbsp;  
I&nbsp;would&nbsp;like&nbsp;to&nbsp;do&nbsp;this&nbsp;:&nbsp;  
&nbsp;  
1)&nbsp;All&nbsp;the&nbsp;lines&nbsp;of&nbsp;the&nbsp;polygon&nbsp;are&nbsp;blue&nbsp;and&nbsp;not&nbsp;selected.  
&nbsp;  
2)&nbsp;The&nbsp;user&nbsp;clicks&nbsp;on&nbsp;a&nbsp;line&nbsp;of&nbsp;a&nbsp;polygon&nbsp;and&nbsp;this&nbsp;line&nbsp;is&nbsp;marked&nbsp;as&nbsp;selected&nbsp;with&nbsp;a&nbsp;particular&nbsp;picture  
(for&nbsp;example,&nbsp;the&nbsp;color&nbsp;of&nbsp;the&nbsp;line&nbsp;becomes&nbsp;red&nbsp;and&nbsp;the&nbsp;other&nbsp;lines&nbsp;of&nbsp;the&nbsp;polygon&nbsp;remain&nbsp;blue)  
&nbsp;  
Is&nbsp;it&nbsp;possible&nbsp;to&nbsp;do&nbsp;this&nbsp;?  
&nbsp;  
Thanks&nbsp;a&nbsp;lot&nbsp;for&nbsp;your&nbsp;help  
&nbsp;  
Regards.  
&nbsp;  
Stéphanie.  
&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:** [August 2, 2012, 5:46pm UTC](https://community.thinkgeo.com/t/selection-of-a-line-of-a-polygon/3265/2 "2012-08-02T17:46:17Z")

</div>

Hello&nbsp;Steph,&nbsp;  
&nbsp;&nbsp;  
&nbsp;You&nbsp;can&nbsp;refer&nbsp;HowDoISamples—\>Feature&nbsp;Layers—\>Hightlight&nbsp;a&nbsp;feature&nbsp;on&nbsp;the&nbsp;map.&nbsp;  
&nbsp;&nbsp;  
&nbsp;The&nbsp;key&nbsp;is&nbsp;using&nbsp;another&nbsp;InMemoryFeatureLayer,&nbsp;and&nbsp;add&nbsp;the&nbsp;feature&nbsp;you&nbsp;want&nbsp;to&nbsp;highlight(or&nbsp;some&nbsp;other&nbsp;way&nbsp;to&nbsp;mark&nbsp;out)&nbsp;into&nbsp;that&nbsp;layer.&nbsp;  
&nbsp;&nbsp;  
&nbsp;Regards,&nbsp;  
&nbsp;&nbsp;  
&nbsp;Gary

---

<div class="post-metadata">

**Author:** ![Steph](https://community.thinkgeo.com/letter_avatar_proxy/v4/letter/s/22d042/32.png) [@Steph](https://community.thinkgeo.com/u/Steph)\
**Post date:** [August 3, 2012, 4:42am UTC](https://community.thinkgeo.com/t/selection-of-a-line-of-a-polygon/3265/3 "2012-08-03T04:42:13Z")

</div>

&nbsp;Hi&nbsp;Gary,&nbsp;

Thank&nbsp;you&nbsp;for&nbsp;your&nbsp;answer.  
&nbsp;  
If&nbsp;fact,&nbsp;that&nbsp;I&nbsp;want&nbsp;to&nbsp;do&nbsp;is&nbsp;this&nbsp;:&nbsp;  
&nbsp;  
I&nbsp;want&nbsp;to&nbsp;create&nbsp;a&nbsp;polygon&nbsp;which&nbsp;is&nbsp;5&nbsp;m&nbsp;(for&nbsp;example)&nbsp;on&nbsp;one&nbsp;side&nbsp;of&nbsp;the&nbsp;selected&nbsp;polygon.  
I&nbsp;joined&nbsp;some&nbsp;&nbsp;screens&nbsp;shot&nbsp;so&nbsp;that&nbsp;it&nbsp;is&nbsp;more&nbsp;explicit.  
&nbsp;  
1)&nbsp;I&nbsp;have&nbsp;a&nbsp;polygon&nbsp;and&nbsp;I&nbsp;select&nbsp;it&nbsp;(ie&nbsp;:&nbsp;Polygon1.png&nbsp;in&nbsp;the&nbsp;file&nbsp;Fic1.png)  
&nbsp;  
2)&nbsp;I&nbsp;edit&nbsp;the&nbsp;polygon,&nbsp;the&nbsp;user&nbsp;clicks&nbsp;on&nbsp;vertices,&nbsp;and&nbsp;then&nbsp;they&nbsp;are&nbsp;marked&nbsp;as&nbsp;selected&nbsp;(ie&nbsp;&nbsp;:&nbsp;PolygonSelectVertice.PNG&nbsp;..&nbsp;green&nbsp;vertices&nbsp;in&nbsp;the&nbsp;file&nbsp;Fic1.png).&nbsp;  
&nbsp;  
3)&nbsp;I&nbsp;use&nbsp;a&nbsp;buffer&nbsp;to&nbsp;create&nbsp;the&nbsp;polygon&nbsp;which&nbsp;is&nbsp;5&nbsp;m&nbsp;of&nbsp;the&nbsp;line&nbsp;(=select&nbsp;vertices)&nbsp;(ie.&nbsp;:&nbsp;&nbsp;PolygonBuffer.png&nbsp;in&nbsp;the&nbsp;file&nbsp;Fic1.png)  
The&nbsp;user&nbsp;can&nbsp;select&nbsp;more&nbsp;than&nbsp;2&nbsp;vertices,&nbsp;and&nbsp;the&nbsp;buffer&nbsp;is&nbsp;built&nbsp;according&nbsp;to&nbsp;the&nbsp;selected&nbsp;vertices&nbsp;(ie.&nbsp;PolygonBufffer1.png&nbsp;in&nbsp;the&nbsp;file&nbsp;Fic2.png)  
&nbsp;  
4)&nbsp;And&nbsp;the&nbsp;last&nbsp;step&nbsp;is&nbsp;to&nbsp;create&nbsp;the&nbsp;2&nbsp;polygons&nbsp;(ie&nbsp;PolygonResult.png&nbsp;in&nbsp;the&nbsp;file&nbsp;Fic2.png)  
&nbsp;  
These&nbsp;differents&nbsp;steps&nbsp;work.&nbsp;  
&nbsp;  
But&nbsp;the&nbsp;last&nbsp;thing&nbsp;&nbsp;which&nbsp;I&nbsp;want&nbsp;to&nbsp;make&nbsp;and&nbsp;which&nbsp;I&nbsp;did&nbsp;not&nbsp;succeed&nbsp;is&nbsp;Instead&nbsp;of&nbsp;selecting&nbsp;vertices&nbsp;to&nbsp;define&nbsp;where&nbsp;the&nbsp;buffer&nbsp;is&nbsp;applied,&nbsp;the&nbsp;user&nbsp;selects&nbsp;the&nbsp;side&nbsp;of&nbsp;the&nbsp;polygon&nbsp;and&nbsp;the&nbsp;side&nbsp;of&nbsp;the&nbsp;polygon&nbsp;is&nbsp;marked&nbsp;as&nbsp;selected&nbsp;or&nbsp;the&nbsp;click&nbsp;on&nbsp;the&nbsp;side&nbsp;of&nbsp;the&nbsp;polygon&nbsp;select&nbsp;the&nbsp;vertices.  
&nbsp;  
I&nbsp;hope&nbsp;I&nbsp;describe&nbsp;enough&nbsp;my&nbsp;problem,&nbsp;and&nbsp;let&nbsp;me&nbsp;know&nbsp;if&nbsp;you&nbsp;want&nbsp;more&nbsp;information.  
&nbsp;  
Thanks.  
&nbsp;  
Regards.  
&nbsp;  
Stéph.  
&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:** [August 3, 2012, 4:24pm UTC](https://community.thinkgeo.com/t/selection-of-a-line-of-a-polygon/3265/4 "2012-08-03T16:24:51Z")

</div>

Hello&nbsp;Steph,&nbsp;  
&nbsp;&nbsp;  
&nbsp;Thanks&nbsp;for&nbsp;your&nbsp;further&nbsp;information,&nbsp;sounds&nbsp;like&nbsp;you&nbsp;have&nbsp;attached&nbsp;some&nbsp;images&nbsp;to&nbsp;show&nbsp;your&nbsp;purpose,&nbsp;but&nbsp;I&nbsp;don’t&nbsp;see&nbsp;any&nbsp;attachment&nbsp;in&nbsp;this&nbsp;post,&nbsp;could&nbsp;you&nbsp;please&nbsp;check&nbsp;that?&nbsp;  
&nbsp;&nbsp;  
&nbsp;Regards,&nbsp;  
&nbsp;&nbsp;  
&nbsp;Gary

---

<div class="post-metadata">

**Author:** ![Steph](https://community.thinkgeo.com/letter_avatar_proxy/v4/letter/s/22d042/32.png) [@Steph](https://community.thinkgeo.com/u/Steph)\
**Post date:** [August 6, 2012, 2:37am UTC](https://community.thinkgeo.com/t/selection-of-a-line-of-a-polygon/3265/5 "2012-08-06T02:37:23Z")

</div>

&nbsp;Hi&nbsp;Gary,&nbsp;

Sorry&nbsp;&nbsp;....&nbsp;yes&nbsp;I&nbsp;forgot&nbsp;to&nbsp;"add&nbsp;file&nbsp;to&nbsp;the&nbsp;post"&nbsp;&nbsp;;-(,

Regards.

Stéphanie.

Stéphanie

 ![](https://community.thinkgeo.com/uploads/default/original/2X/0/012afa9de4df353f6f73ad361f0e922df0f6c6bb.png) ![](https://community.thinkgeo.com/uploads/default/original/2X/d/de20cbde8b4d09a038c33e7ab7e32f3bca3ec464.png)

&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:** [August 6, 2012, 10:05pm UTC](https://community.thinkgeo.com/t/selection-of-a-line-of-a-polygon/3265/6 "2012-08-06T22:05:05Z")

</div>

Hi&nbsp;Steph,

Here&nbsp;is&nbsp;the&nbsp;sample&nbsp;code,&nbsp;please&nbsp;get&nbsp;it&nbsp;and&nbsp;have&nbsp;a&nbsp;try.&nbsp;

Regards,

Edgar

[sampleCode.txt](https://community.thinkgeo.com/uploads/default/original/2X/f/f9d9366fd7e19945da2e2bd8466dca0874b8fe39.txt) (4.86 KB)

---

<div class="post-metadata">

**Author:** ![Steph](https://community.thinkgeo.com/letter_avatar_proxy/v4/letter/s/22d042/32.png) [@Steph](https://community.thinkgeo.com/u/Steph)\
**Post date:** [August 9, 2012, 11:04am UTC](https://community.thinkgeo.com/t/selection-of-a-line-of-a-polygon/3265/7 "2012-08-09T11:04:56Z")

</div>

&nbsp;Hi&nbsp;Edgard,&nbsp;

Thanks&nbsp;a&nbsp;lot.

I'm&nbsp;going&nbsp;to&nbsp;try&nbsp;it

Regards.

Stéphanie.

---

<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:** [August 9, 2012, 10:00pm UTC](https://community.thinkgeo.com/t/selection-of-a-line-of-a-polygon/3265/8 "2012-08-09T22:00:24Z")

</div>

Steph,&nbsp;  
&nbsp;&nbsp;  
&nbsp;You’re&nbsp;welcome,&nbsp;hope&nbsp;that&nbsp;code&nbsp;helps.&nbsp;  
&nbsp;&nbsp;  
&nbsp;Regards,&nbsp;  
&nbsp;&nbsp;  
&nbsp;Edgar
