# First and last vertices are the same

**URL:** <https://community.thinkgeo.com/t/first-and-last-vertices-are-the-same/9225>\
**Category:** WinForms\
**Created:** [July 27, 2018, 12:44pm UTC](https://community.thinkgeo.com/t/first-and-last-vertices-are-the-same/9225 "2018-07-27T12:44:51Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![Dan\_Weaver](https://community.thinkgeo.com/letter_avatar_proxy/v4/letter/d/5f8ce5/32.png) [@Dan\_Weaver](https://community.thinkgeo.com/u/Dan_Weaver)\
**Post date:** [July 27, 2018, 12:44pm UTC](https://community.thinkgeo.com/t/first-and-last-vertices-are-the-same/9225/1 "2018-07-27T12:44:51Z")

</div>

When drawing polygons, I noticed in the list of vertices that the first and last vertex are the same. Why is it done this way? I’m implementing a way for the user to edit the vertices, but I assume I have to worry about changing both the first and last every time they edit one of those?

If the first or last vertex is changed, will the other automatically be updated to match?

Thanks!

---

<div class="post-metadata">

**Author:** ![Ethan](https://community.thinkgeo.com/user_avatar/community.thinkgeo.com/ethan/32/19964_2.png) [@Ethan](https://community.thinkgeo.com/u/Ethan)\
**Post date:** [July 30, 2018, 5:13am UTC](https://community.thinkgeo.com/t/first-and-last-vertices-are-the-same/9225/2 "2018-07-30T05:13:40Z")

</div>

Hi Dan,

If the first vertex don’t equal to last vertex, it won’t be a polygon, it will be a line.

Our polygon have a outer ring, I think you should means edit the ring, but I am not sure how you edit it, if you edit it via our EditOverlay you don’t need worry about this problem, if you edit it by your custom code, please modify them at the same time, or you can show us your code, we can give you some advice.

Regards,

Ethan

---

<div class="post-metadata">

**Author:** ![Dan\_Weaver](https://community.thinkgeo.com/letter_avatar_proxy/v4/letter/d/5f8ce5/32.png) [@Dan\_Weaver](https://community.thinkgeo.com/u/Dan_Weaver)\
**Post date:** [July 30, 2018, 1:02pm UTC](https://community.thinkgeo.com/t/first-and-last-vertices-are-the-same/9225/3 "2018-07-30T13:02:41Z")

</div>

Got it, thanks! I just wasn’t sure if internally it would add the last vertex to match the first if I created a polygon.

---

<div class="post-metadata">

**Author:** ![Ethan](https://community.thinkgeo.com/user_avatar/community.thinkgeo.com/ethan/32/19964_2.png) [@Ethan](https://community.thinkgeo.com/u/Ethan)\
**Post date:** [July 31, 2018, 2:27am UTC](https://community.thinkgeo.com/t/first-and-last-vertices-are-the-same/9225/4 "2018-07-31T02:27:12Z")

</div>

Hi Dan,

If you create polygon by our map API, the last vertex will added to match the first one.

If you build the polygon by your logic, please make sure add this vertex.

Regards,

Ethan
