Shape manipulation

Shape manipulation functions can be applied in the Geometry row of the Expression column in a Mapping workbook. The functions are used to define how geometry will be transformed when loading data from the source to the target. This transformation can include converting between geometry types.

The sections below describe the available shape manipulation functions.

Polygon to Point

The Polygon to Point function transforms a polygon into a point using the centroid of the polygon. The function is automatically selected in the Mapping workbook when the source is a polygon and the target is a point.

Illustration

Polygon to Point function

Syntax

polygon_to_point(shape)

NameExplanationData type

shape

The field that contains shape geometry.

Geometry

Example

polygon_to_point(!Shape!)

Polygon to Multipoint

The Polygon to Multipoint function transforms a polygon into a multipoint with a point at each vertex of the source polygon. The function is automatically selected in the Mapping workbook when the source is a polygon and the target is a multipoint.

Illustration

Polygon to Multipoint function

Syntax

polygon_to_multipoint(shape)

NameExplanationData type

shape

The field that contains shape geometry.

Geometry

Example

polygon_to_multipoint(!Shape!)

Polygon to Diameter Polyline

The Polygon to Diameter Polyline function transforms a polygon into a single segment polyline that connects the two vertices of the polygon that are farthest apart along its boundary. The function is not automatically selected in the Mapping workbook and must be manually entered in the Expression column.

Illustration

Polygon to Diameter Polyline function

Syntax

polygon_to_diameter_polyline(shape)

NameExplanationData type

shape

The field that contains shape geometry.

Geometry

Example

polygon_to_diameter_polyline(!Shape!)

Polygon to Polyline

The Polygon to Polyline function transforms a polygon into a polyline using the polygon's boundary. The function is automatically selected in the Mapping workbook when the source is a polygon and the target is a polyline.

Illustration

Polygon to Polyline function

Syntax

polygon_to_polyline(shape)

NameExplanationData type

shape

The field that contains shape geometry.

Geometry

Example

polygon_to_polyline(!Shape!)

Polyline to Polygon

The Polyline to Polygon function transforms a polyline into a polygon using a specified buffer distance. The function is automatically selected in the Mapping workbook when the source is a polyline and the target is a polygon.

Illustration

Polyline to Polygon function

Syntax

polyline_to_polygon(shape, distance)

NameExplanationData type

shape

The field that contains shape geometry.

Geometry

distance

The distance around the input feature that will be buffered.

Double

Example

polyline_to_polygon(!Shape!, 20)

Polyline to Point

The Polyline to Point function transforms a polyline into a point using a ratio of the length of the line. The function is automatically selected in the Mapping workbook when the source is a polyline and the target is a point.

Illustration

Polyline to Point function

Syntax

polyline_to_point(shape, {ratio})

NameExplanationData type

shape

The field that contains shape geometry.

Geometry

ratio (Optional)

The distance along the line where the point will be placed, expressed as a ratio from 0 to 1. The default value is 0.5.

Double

Example

polyline_to_point(!Shape!, 0.5)

Polyline to Multipoint

The Polyline to Multipoint function transforms a polyline into a multipoint, creating a point at each vertex of the source polyline. The function is automatically selected in the Mapping workbook when the source is a polyline and the target is a multipoint.

Illustration

Polyline to Multipoint function

Syntax

polyline_to_multipoint(shape)

NameExplanationData type

shape

The field that contains shape geometry.

Geometry

Example

polyline_to_multipoint(!Shape!)

Point to Polygon

The Point to Polygon function transforms a point into a polygon using a specified buffer distance. The function is automatically selected in the Mapping workbook when the source is a point and the target is a polygon.

Illustration

Point to Polygon function

Syntax

point_to_polygon(shape, distance)

NameExplanationData type

shape

The field that contains shape geometry.

Geometry

distance

The distance around the input feature that will be buffered.

Double

Example

point_to_polygon(!Shape!, 50)

Point to Polyline

The Point to Polyline function transforms a point into a polyline using a specified distance and angle. The function is automatically selected in the Mapping workbook when the source is a point and the target is a polyline.

Note:
The starting vertex for the generated line will be the same location as the source point.

Illustration

Point to Polyline function

Syntax

point_to_polyline(shape, angle, distance)

NameExplanationData type

shape

The field that contains shape geometry.

Geometry

angle

The angle at which the polyline will be generated. The angle must be between 0 and 360.

Double

distance

The distance around the input feature that will be buffered.

Double

Example

point_to_polyline(!Shape!, 30, 100)

Point to Multipoint

The Point to Multipoint function transforms a point into a multipoint with a collection of randomly generated points centered around the source point. The function is automatically selected in the Mapping workbook when the source is a point and the target is a multipoint.

Illustration

Point to Multipoint function

Syntax

point_to_multipoint(shape, num_points, radius)

NameExplanationData type

shape

The field that contains shape geometry.

Geometry

num_points

The number of points to be randomly generated.

Short

radius

The radius in which the randomly generated points will be dispersed within.

Double

Example

point_to_multipoint(!Shape!, 30, 200)

Multipoint to Polygon

The Multipoint to Polygon function transforms a multipoint into a polygon using the convex hull of the source multipoint. The function is automatically selected in the Mapping workbook when the source is a multipoint and the target is a polygon.

Note:
If the multipoint feature is only one or two points, a polygon buffer will be generated at a default buffer size. If the multipoint feature is greater than two points, it will use the convex hull method for polygon generation.

Illustration

Multipoint to Polygon function

Syntax

multipoint_to_polygon(shape)

NameExplanationData type

shape

The field that contains shape geometry.

Geometry

Example

multipoint_to_polygon(!Shape!)

Multipoint to Polyline

The Multipoint to Polyline function transforms a multipoint into a polyline using the convex hull of the source multipoint. The function is automatically selected in the Mapping workbook when the source is a multipoint and the target is a polyline.

Note:
If the multipoint feature is a single point, a polyline will be generated at a default direction and length. If the multipoint feature is two points or greater, it will use the convex hull method for polyline generation.

Illustration

Multipoint to Polyline function

Syntax

multipoint_to_polyline(shape)

NameExplanationData type

shape

The field that contains shape geometry.

Geometry

Example

multipoint_to_polyline(!Shape!)

Multipoint to Point

The Multipoint to Point function transforms a multipoint into a point using the centroid of the source multipoint. The function is automatically selected in the Mapping workbook when the source is a multipoint and the target is a point.

Illustration

Multipoint to Point function

Syntax

multipoint_to_point(shape)

NameExplanationData type

shape

The field that contains shape geometry.

Geometry

Example

multipoint_to_point(!Shape!)

Create Point

The Create Point function creates a point from x- and y-coordinates in a table. You can also include z, m, and spatial reference information. The function is automatically selected in the Mapping workbook when the source is a table and the target is a point.

Syntax

create_point(x, y, {z}, {m}, {spatial_reference})

NameExplanationData type

x

The x-value or the field that contains the x-value.

Double

y

The y-value or the field that contains the y-value.

Double

z (Optional)

The z-value or the field that contains the z-value.

Double

m (Optional)

The m-value or the field that contains the m-value.

Double

spatial_reference (Optional)

The horizontal coordinate system that defines the spatial reference. The coordinate system can be set using a projection file, name, or factory code.

SpatialReference

Example

create_point(!x!, !y!, !z!, !m!, 8745)

Move Feature

The Move Feature function moves the x-, y-, and z-coordinates of any geometry type by a value. The function is not automatically selected in the Mapping workbook and must be manually entered in the Expression column.

Syntax

move(shape, {x}, {y}, {z})

NameExplanationData type

shape

The field that contains shape geometry.

Geometry

x (Optional)

The amount to shift the x-value.

Double

y (Optional)

The amount to shift the y-value.

Double

z (Optional)

The amount to shift the z-value.

Double

Example

move(!Shape!, 50, 50, 50)