Get Centroid

Returns the coordinates of the centroid of the geometry object as follows:
  • Points—Returns coordinates of the point.
  • Lines—Returns the representative point if available, otherwise returns the centroid.
  • Polygons—Returns the representative point if available, otherwise returns the centroid.

A representative point is a point that has significance. For example, a major intersection in a road segment, or the capital of a country. If there is no representative point for the geometry, a centroid is calculated. The calculation attempts to find a point that is centrally located in the geometry.

Table 1. Geometry Coordinates Options
Option Name Description
Coordinate system

This field specifies the coordinate system to use when determining the coordinates.

To change the default coordinate system, clear the default value then start typing the name of a coordinate system or an EPSG code to see a drop-down list of systems that begin with or contain those characters (the list appears after you have entered three alphanumeric characters). You can also click the browse button to open the Select Coordinate System dialog and select one from the list. Regardless of which coordinate system you select, the descriptive name will appear in the field and the respective EPSG code is saved for the stage.

For more information on EPSG codes, see www.spatialreference.org. To retrieve a list of supported codespaces for EPSG, you can submit the SOAP request List Supported CoordSys by Code Space from the Geometry Service Demo page at http://<server>:<port>/Spatial/GeometryService/DemoPage.html.

Geometry field The field that contains the geometry you want to convert to coordinates.

This field also accepts geometries that are generated by stages in the Enterprise Routing Module, such as a LineString or Polygon.

Longitude field The output field that you want to contain the longitude returned by Spatial Calculator (output type is double)..
Latitude field The output field that you want to contain the latitude returned by Spatial Calculator (output type is double)..