At the moment, the polygon geometries' database attributes are blank as shown below.
The steps are as follows:
- In GeoMedia, select Edit > Attribute > Update Attributes.
The Update Attributes dialog box appears.
- In the Update features in box, expand your read/write connection node and select the polygon feature you want to update e.g. BLDG_OUTLINE.
The Update Attributes dialog box may look like this.
- Click the cursor on the attribute field you want to update with the polygon geometries' centroid X coordinate e.g. XCOORD.
- Click Expression.
The Expression dialog box appears.
- In the Expression field, type in the following string:
X(CENTERPOINT(Input.Geometry), Constant.ProjectedMeas, Constant.METER))
Note: Replace Input.Geometry with the name of your geometry field. The RefSpace argument can be either Constant.ProjectedMeas or Constant.TrueMeas. The UnitOfMeasure argument can be angular units (if Constant.TrueMeas is used) or linear units like Constant.METER, Constant.INCH, etc.
The Expression dialog box may look like this.
- Click OK.
- Repeat the steps 3 to 7 for the Y coord field. The expression string for the Y coord may look like this:
Y(CENTERPOINT(Input.Geometry), Constant.ProjectedMeas, Constant.METER))
At the end, the Update Attributes dialog box may look like this.
- Click Apply.
The centroids of the polygon geometries are calculated and updated into the attribute fields.
- Click Close.