Retrieve polygon centroid


Purpose
The centroid of a polygon is the center of mass of an irregular polygon. This sample takes in a shapefile with a polygon feature class and reports back the centroids.

How to use

See How to use ArcGIS samples for help on running the sample. If the sample has associated data, you will find that the sample's zip file includes a "data" folder alongside the language folders. However, you will need to update the sample to point to the location of the data once you have extracted all the files.

  1. Run the RetrievePolygonCentroid application.
  2. Examine output.


Download the files for Java
geometry/RetrievePolygonCentroid.java Main class




Development licensing Deployment licensing
Engine Developer Kit Engine Runtime