The Add Calculated Data tool has several calculation actions that can be performed on art geometry. The calculated data populates existing or new MAP Attribute columns. The calculation options are:
•Centroid position for lines and areas
•Elevation, Position, and North Angle for points
•Colours for labels, lines and areas
Calculated values are not updated automatically when the source column changes. Add Calculated Data must be run again to apply newly calculations. Calculated data can be added or updated to all art on a layer or only to the selected art, however statistical calculations are based on the entire dataset.
Add Calculated Data can populate new or existing attribute columns. Only attributes of type Double can be updated.
For statistic calculations, the source column must be numerical (Integer or Double). Users may need to use the Join Table function to import appropriate numerical data beforehand (e.g. election results per county). See Edit Schema in MAP Attributes.
Using Add Calculated Data
If necessary, select features before using the Add Calculated Data tool. Click the Add Calculated Data button on the MAP Toolbar. Enable the Apply to selected features only option if required.
Calculate Centroid or Position
Choose Centroid from the Calculation drop-down list to calculate the x and y position of line or area centroids. If the selected data is on a Point MAP layer, choose Position from the Calculation drop-down list to calculate the x and y position of points in a specific coordinate format.
Centroid positions are calculated using the low accuracy method (see Plot Centroids for details).
In the Column X and Column Y drop-down lists, users have the option to keep the default new column names (new_position_x and new_position_y), type names of their choice, or select an existing column. Only existing columns of data type Double are listed.
The positions coordinate format is set in the Type drop-down list. The options are:
•Page coordinates: x and y positions relative to the Adobe Illustrator page reference, in page units (as specified in the Adobe Illustrator document setup).
•Projected coordinates: x and y positions in the source coordinate system of the MAP View containing the selected layer (if this system is projected).
•Native geodetic coordinates: longitude and latitude positions — calculated from x and y positions of the selected MAP View's native geodetic coordinate system.
•WGS84 coordinates: longitude and latitude positions — calculated from x and y positions if the source coordinate systems of the MAP View containing the selected layer is projected.
•MGRS coordinates: military grid reference system positions — calculated from x and y positions if the source coordinate systems of the MAP View containing the selected layer is projected.
The Unit drop-down list shows a selection of linear or angular units if the coordinate type is set to projected or geodetic respectively.
To calculate statistics based on a source attribute column, choose Statistics from the Calculation drop-down list.
The following statistical operations are available:
•Deviation: for each row, difference between the current value and the mean.
•Distribution: for each row, current value divided by the sum.
•Mean: sum of all the row values divided by the number of rows in the source column (same for all rows).
•Standard Deviation: measure of the variability or dispersion of the row values in the source column. A low standard deviation indicates that row values are very close to the mean, whereas high standard deviation indicates that row values are spread out. Calculated as the square root of the sum of all deviations squared, divided by the number of rows in the source column (same for all rows).
•Sum: addition of all the row values in the source column (same for all rows).
In the Target drop-down list, users have the options to keep the default new column name (new_stat_col), type a name of their choice, or select an existing column. Only existing columns of data type Double are listed.
Then, select the required function in the Operation drop-down list. Deviation and Distribution calculate a value specific to each row; Mean, Standard Deviation and Sum create a single value for all rows.
In the Source drop-down list, select the source column from within all numerical attributes of the current layer. Users have the option to add calculated data to all art on a layer or only to the selected art, however statistical calculations are based on the entire dataset of the source column
To obtain a distribution in percents, first use Add Calculated Data with the Distribution operation, then use the Apply Expression function to multiply the column values by 100 (e.g. COLUMN = COLUMN * 100).
The standard deviation value MAPublisher uses is n. Microsoft Excel uses n-1.
Calculate North Angle
To calculate north angles of points on a Point MAP layer, choose North Angle from the Calculation drop-down list.
To calculate colours of layers or objects, choose Colours from the Calculation drop-down list.
In the Colour source drop-down list, choose from either Fill or Stroke of the current layer or objects. This will be the source of which MAPublisher retrieves the colour values from.
In the Colour model drop-down list, choose from either CMYK or RGB. This will change the available colour attribute label boxes below it and set the colour attribute values. When CMYK is chosen, colour values in the attribute table are populated with Real numbers. For example, a cyan value of 0.2562 is equivalent to 25.62 in the Adobe Illustrator Color panel. When RGB is chosen, colour values in the attribute table are populated with Integer numbers.
By default, the colour attribute label boxes are populated with the name of the colour. These are the attribute column heading names and can be edited, however, they must remain unique. An indicator to the right of the box displays either "Add" or "Update". When calculating new colour attribute values and a new label is entered, the indicator will display "Add". It is possible to update the values in the attribute table when the colour of the layer or objects are changed. When using the same attribute labels, the indicator will display "Update". This overwrites the existing colour values in the attribute table.
Adjust the CMYK colour Range value by representing them as numbers from 0.0 to 1.0 or 0.0 to 100.0.
Indeterminate colours are colours that MAPublisher cannot determine for a layer or object. The colour value will not be calculated if:
•objects do not have fill or stroke
•objects have gradient colour
•objects have patterns or hatches
•objects have colors not in CMYK or RGB (e.g. Pantone)
•colours are applied to the layer group (not object level)
In the Indeterminate Colours section, two options are available to deal with these situations. Reset attribute to default when colour source is indeterminate sets the attribute values to 0 (zero). The Indicate indeterminate colours using option allows you to specify a specific value. The default is -1.0000.
To calculate auto-numbers for records in the attribute table, choose Auto-number from the Calculation drop-down list.
Choose or add the attribute column in the Target box. In the Starting ID box, specify a numeric value to begin numbering from. In the Sort by drop-down list, choose which attribute the ID values should be sorted by. In the Sort order drop-down list, choose ascending or descending order. Also, an option to not sort is available to preserve the current object order. Enable the Use Natural Comparison check box to use an alphanumerical sort on the specified attribute.
To calculate elevation for points, choose Elevation from the Calculation drop-down list.
Choose or add the attribute column in the Elevation box. In the Unit drop-down list, choose a unit of measurement.
Elevation data values of -32,768 are considered as "no data" values.
Calculate Art Bounds
To calculate art bounds for features, choose Art bounds from the Calculation drop-down list.
Choose or add the attribute column in the Min X, Min Y, Max X, and Max Y boxes. In the Type drop-down list, choose a coordinate type: Page, Geodetic, WGS84 or MGRS. In the Unit drop-down list, choose a unit of measurement. The unit of measurement depends on the coordinate type.
Additional Add Calculated Data notes
For single polygons, the centroid can be assimilated to the center of mass of the surface. For single lines, the centroid is the mid-point of the line. For polygons or lines grouped into a compound path, the centroid of the largest polygon or line is used.
The centroid of a Bezier polygon (smoothed path) may not be completely accurate because only the anchor points are used to calculate the centroid's position. If necessary, use the Adobe Illustrator Add Anchor Points function (Object > Path > Add Anchor Points) before running Add Calculated Data.