Select to view content in your preferred language

Create new point at the center of polygon

3532
4
Jump to solution
10-23-2013 10:54 AM
MayJeff
Deactivated User
How do you create a new point at the center of polygon? 
Thanks.
Tags (2)
0 Kudos
1 Solution

Accepted Solutions
RobertScheitlin__GISP
MVP Emeritus
All,

   It is not really practical to use it for popups but there is a way to get that center of the actual polygon Just like in ArcMap its called the labelpoint and it is available on the GeometryService:

View solution in original post

0 Kudos
4 Replies
RobertBorchert
Honored Contributor
First create two new attributes for your polygons.

Make them Double they will represent latitude and longitude.  I normally them Xing and Ying

Now right click on the Xing column and select calculate geometry.  Choose X coordinate of Centroid.  select also the Units.  I prefer Decimal Degrees.

Do the same for Ying

now from the table view export your polygon layer as a text file.

bring that text file back in and right click on it and select display X,Y data.

It will create an Event Layer.  Export that event layer as a shapefile or to a geodatebase.  it will carry along all the attributes of the parent polygon.

How do you create a new point at the center of polygon? 
Thanks.
0 Kudos
MayJeff
Deactivated User
Actually, is there a way just create a new point so that new point will show at the center of polygon on the map using flex api.

Thanks.
0 Kudos
MattiasEkström
Frequent Contributor
The easy way is to use the center of the extent for the polygon, for example
var p:MapPoint = new MapPoint(YourPolygon.geometry.extent.center.x, YourPolygon.geometry.extent.center.y);
or using YourPolygon.geometry.extent.center which is a MapPoint...

This is of course the center of the extent so it's not the "real" center of the polygon, and for some polygons the point might be placed outside the polygon.
If someone else has a solution to really get the center of the polygon, or at least some way to make sure it will always fall inside the polygon, I'm also interested...
0 Kudos
RobertScheitlin__GISP
MVP Emeritus
All,

   It is not really practical to use it for popups but there is a way to get that center of the actual polygon Just like in ArcMap its called the labelpoint and it is available on the GeometryService:

0 Kudos