Transform Templates - Geom

This topic discusses application of the Transform panel with Tables on a geom field in a table.   That is equivalent to applying the Transform panel to a Drawing and using the geom field in the drawing.  See the Transform panel and Transform Templates topics for use and for links to lists of templates for other data types for tables and use of the Transform panel with other components, such as Drawings and Images.

 

Since transform templates applied to either drawings or to geoms in tables are equivalent, the illustrations in the transform template topics for drawings and for geoms in tables are often identical.

Tables, Geom Types

Bounds

For line and area objects in the source geom field extract the coordinates that give the extents of the object, the two end coordinates in the case of lines and the border lines in the case of areas, and place in the target geom field.  Ignore points in the source field.

il_trans_drawing_objects.png

 

Preview:

il_trans_drawing_bounds_pre.png

 

The points in the source field are ignored and do not appear in the result.   Their geom values in the table are set to NULL.

Branch

Choose the branch indicated of a multibranched object and discard other branches.  Branches are numbered starting with 0 in the order in which they occur within the object's geometry.   The starting drawing below shows one area object that is made of up three branches and one line object that is made up of three branches.  Labels have been added to the illustration to show the number of each branch, with labels for the multibranched area in magenta and labels for the multibranched line in light blue color.

il_trans_drawing_branches.png

 

Preview:  Branch using a value of 0

il_trans_drawing_branch0_pre.png

 

Preview:  Branch using a value of 1

il_trans_drawing_branch1_pre.png

 

Preview:  Branch using a value of 2

il_trans_drawing_branch2_pre.png

Buffer

Create an area object around each object in the source field at the given Distance and put into the target field.  Using a value of 0 for Tolerance (the default) means to use automatic tolerance.

il_trans_drawing_objects.png

 

Preview: Buffer with a Distance of 5 of objects specified in Geom.

il_trans_drawing_buffer_pre1.png

The dark "tips" of objects are a summary of rounded edges in the buffer areas as seen in the zoomed-in view below.

il_trans_drawing_buffer_pre2.png

Center

Create a point at the center of the minimum circle that encloses each line or area object in the source field and put in the target field.  Copy points from source field to target field.  See the Transform: Center and Centroids  topic.

il_trans_drawing_objects.png

 

Preview:

il_trans_drawing_center_pre.png

Center, Inner

Create a point at the "center" of each area object in the source field, adjusting the location of the point so that it always falls within the area, and put in the target field.  Discard lines and points.   See the Transform: Center and Centroids  topic.

il_trans_drawing_objects.png

 

Preview:

il_trans_drawing_center_inner_pre.png

Geom values for lines and points in the table are set to NULL.

Center, Weight

Create a point at the balance point of each area object in the source field and put in the target field. Discard lines and points.  See the Transform: Center and Centroids  topic.

il_trans_drawing_objects.png

 

Preview:

il_trans_drawing_center_weight_pre.png

Geom values for lines and points in the table are set to NULL.

Compose Circle

Most frequently used as a transform template for tables, where the operation is clearer: For each record in the table, Given an X value, a Y value and a Radius value, create in the target geom field a circular area object of specified radius centered on the specified X,Y location.

 

In the case of drawings, each record in the drawing's table specifies an object in the drawing.  When we utilize this transform template from a drawing the intent is for each object in the drawing to create a circle, with the circle usually intended to be related to the location of the object it replaces.   For example, we might create a circle of a given radius at each point, at the center of an area and so on.   To do that instead of using simple numbers or fields for the X and Y values we will probably use expressions in the X and Y combo boxes.

 

Consider a starting drawing that has four point objects, located at coordinates as follows (just the diagonal corner coordinates being labeled):

il_trans_drawing_compose_start.png

 

We can use the Compose Circle template to replace each point object with a circular area object centered upon the location of the point.   We will use an expression in the X and Y combo boxes that extracts the X or the Y value for the point.

 

 

il_trans_drawing_compose_circle_dlg.png

 

The expressions used to get the X and the Y values can be read as follows:

 

GeomCoordXY([Geom], 0)

 

The GeomCoordXY function returns the (X,Y) value for the specified coordinate of a geom.  We ask for the 0 coordinate, that is, the first coordinate that defines the object.   In this case because we are working points there is only one coordinate in the geom that defines each point object, but had we been working with lines where many coordinates might define the line asking for coordinate number 0 of the geom would return the (X,Y) value of the first coordinate, that is, the beginning of the line.

 

In the X box we want only a single number, the X part of the (X,Y) coordinate vector returned by GeomCoordXY so we will use the VectorValue function to get only that part.

 

The VectorValue( ) function takes two arguments: the first is a vector and the second argument, a number such as 0, 1, 2, 3... asks for that specified value in the vector.   In the case of a vector that has only two numbers in it such as an (X,Y) vector using a second argument of 0 asks for the first number, the X value, and using a second argument of 1 asks for the Y value.  If the vector we were working with was an (X,Y,Z) vector with three values in it then using a second argument of 2 would get the Z value.

 

The expression...

 

VectorValue(GeomCoordXY([Geom], 0), 0)

 

... means get the (X,Y) vector value of the first coordinate in the object in Geom, and then use VectorValue to extract from that the X value.     We use that expression in the X combo box and it will be automatically computed for each object in the drawing to produce the X value to be used for creating the circle for that object.

 

The expression...

 

VectorValue(GeomCoordXY([Geom], 0),1)

 

... means get the (X,Y) vector value of the first coordinate in the object in Geom, and then use VectorValue to extract from that the Y value.  We use that expression in the Y combo box and it will be automatically computed for each object in the drawing to produce the Y value to be used for creating the circle for that object.

 

For this example we use the number 5 for the Radius.   That will create all four circles with a radius of 5 units.

 

Preview:

il_trans_drawing_compose_circle_pre.png

 

In the above preview we see that each of the four points will be replaced by a circle centered on the X,Y location of the point with a Radius of 5 units.  Previews show an approximation for fast rendering: although the circles appear to be polygons if the command is given to apply the template smooth circles will result.

 

We are not required to use a fixed radius for all objects, of course.   We could choose a field to control the value of the Radius.  

il_trans_drawing_compose_circle2_dlg.png

To choose a purely artificial example, suppose we chose the mfd_id field as the value to control the Radius.  In the sample drawing the four points were created in order in a new, blank drawing so their mfd_id values are 1, 2, 3 and 4, respectively.   Using mfd_id to control the Radius therefore says to use those numbers as values for Radius for the four circles that are created.

 

Preview:

il_trans_drawing_compose_circle2_pre.png

How might we use this template in real life?   

 

Suppose we have a drawing that shows the locations of radio station antennas as points, and for each point we also have an attribute field that gives the transmission power for that station.  Creating a circle at each point using the transmission power to provide the radius can create a drawing of circles that show the coverage of the many radio stations.  

 

The template might also be used for classic military purposes such as targeting.   Each point could be the target coordinates for a particular warhead and the radius might be taken from a field that gave the effective range of destruction for that warhead.

Compose Point

Most frequently used as a transform template for tables, where the operation is clearer: For each record in the table, Given an X value, a Y value and a Radius value, create in the target geom field a point object at the specified X,Y location. See the Example: Create a Drawing from a Geocoded Table topic for an example of use with a table.

 

In the case of drawings, each record in the drawing's table specifies an object in the drawing.  When we utilize this transform template from a drawing the intent is for each object in the drawing to create a point, with the point usually intended to be placed at some meaningful spot related to the location of the object it replaces.  For example, we might want to create a point at the first coordinate of each object in the case of a drawing that contains lines.

 

Consider a starting drawing that has two point objects, two lines and three areas:

il_trans_drawing_objects.png

 

Following a procedure similar to the Compose Circle example above, we will first preview a replacement of the objects with a single point located at the position of the first coordinate that defines the object, and then we will preview a replacement  of the objects with a single point located at the position of the second coordinate that defines the object.  See the Compose Circle discussion for an explanation of the functions used.

 

il_trans_drawing_compose_point_dlg.png

 

As in the Compose Circle example above again to get the X and Y values we use expressions:

 

VectorValue(GeomCoordXY([Geom], 0), 0)

 

and

 

VectorValue(GeomCoordXY([Geom], 0), 1)

 

The 0 argument in ([Geom], 0) picks out the first coordinate defining the object, counting from zero.

 

Preview:

 

il_trans_drawing_compose_point_pre.png

 

To see where those points come from we can overlay with slight transparency the original drawing:

 

il_trans_drawing_compose_point_compare_pre.png

 

We can adjust the expressions used to get X and Y values for the second coordinate of each object:

 

il_trans_drawing_compose_point2_dlg.png

In the above we use the expressions:

 

VectorValue(GeomCoordXY([Geom], 1), 0)

 

and

 

VectorValue(GeomCoordXY([Geom], 1), 1)

 

In this case the 1 argument in ([Geom], 0) picks out the second coordinate defining the object, counting from zero.

 

Preview:

 

il_trans_drawing_compose_point2_pre.png

To see where those points come from we can overlay with slight transparency the original drawing:

 

il_trans_drawing_compose_point2_compare_pre.png

 

The two original points will disappear since they are not multipoints but are regular points that consist of one coordinate each.  Our expressions get the X and Y values of the second coordinates which the two original points do not have, so they will have a NULL value as a result of the transform.

Compose Point with Z

Exactly the same as Compose Point with the addition that we can specify a Z value for the point.  We might take that from a field for each object that specifies an altitude.

Compose Rectangle

Similar to Compose Circle but instead for each object creates a rectangular area object that is vertically aligned using the specified  coordinates for the X 0, Y 0 corner and diagonally opposite X 1, Y 1 corner.

 

Consider a starting drawing that has four point objects, located at coordinates as follows (just the diagonal corner coordinates being labeled):

il_trans_drawing_compose_start.png

 

We can use the Compose Rectangle template to replace each point object with a rectangular area object centered upon the location of the point.   We will use expressions that extract the X and the Y locations of each point and then add to them or subtract from them to create the desired offset locations of the lower left corner and the upper right corner of the rectangles to be created. See the Compose Circle discussion for an explanation of the functions used.

 

il_trans_drawing_compose_rect_dlg.png

 

The expressions for the lower left corner are

 

VectorValue(GeomCoordXY([Geom], 0), 0) - 4

 

and

 

VectorValue(GeomCoordXY([Geom], 0), 1) - 2

 

These expressions place the lower left corner of the new rectangle four units to the left and two units below the location of the point.  We take advantage of Manifold's ability to handle mathematics within expressions that are placed inside combo boxes.  The expressions for the upper right corner are

 

VectorValue(GeomCoordXY([Geom], 0), 0) + 4

 

and

 

VectorValue(GeomCoordXY([Geom], 0), 1) + 2

 

These expressions place the upper right corner of the new rectangle four units to the right and two units above the location of the point.   The net effect is to create a rectangle that is eight units wide and four units high that is centered on the location of the point that it replaces.

 

Preview:

il_trans_drawing_compose_rect_pre.png

Compose Segment

Similar to Compose Rectangle but instead of creating a rectangular area object the Compose Segment template creates a straight line segment between the specified  coordinates for the X 0, Y 0 beginning and X 1, Y 1 end of the line.

 

Consider a starting drawing that has four point objects, located at coordinates as follows (just the diagonal corner coordinates being labeled):

il_trans_drawing_compose_start.png

 

We can use the Compose Segment template to replace each point object with a straight line segment centered upon the location of the point.   We will use expressions that extract the X and the Y locations of each point and then add to them or subtract from them to create the desired offset locations of the lower left corner and the upper right corner of the line segments to be created.  See the Compose Circle discussion for an explanation of the functions used.

 

il_trans_drawing_compose_segment_dlg.png

 

The expressions for the lower left corner are

 

VectorValue(GeomCoordXY([Geom], 0), 0) - 4

 

and

 

VectorValue(GeomCoordXY([Geom], 0), 1) - 2

 

These expressions place the lower left beginning of the new line four units to the left and two units below the location of the point.  The expressions for the upper right corner are

 

VectorValue(GeomCoordXY([Geom], 0), 0) + 4

 

and

 

VectorValue(GeomCoordXY([Geom], 0), 1) + 2

 

These expressions place the upper right end of the line four units to the right and two units above the location of the point.   The net effect is to create a line that is centered on the location of the point that it replaces.

 

Preview:

 

il_trans_drawing_compose_segment_pre.png

Compose Triangle

Similar to Compose Rectangle but instead of creating a rectangular area object the Compose Triangle template creates a triangular area object using as corners of the triangle the specified  coordinates for the  X 0, Y 0 corner,  X 1, Y 1 corner and X 2, Y 2 corner,

 

Consider a starting drawing that has four point objects, located at coordinates as follows (just the diagonal corner coordinates being labeled):

il_trans_drawing_compose_start.png

 

We can use the Compose Triangle template to replace each point object with a triangular area with one corner placed at the location of the point.   We will use expressions that extract the X and the Y locations of each point and then add to them or subtract from them to create the desired offset locations of the corners of the triangles to be created.   See the Compose Circle discussion for an explanation of the functions used.

 

il_trans_drawing_compose_triangle_dlg.png

 

The expressions for the first corner are

 

VectorValue(GeomCoordXY([Geom], 0), 0)

 

and

 

VectorValue(GeomCoordXY([Geom], 0), 1)

 

These expressions place the first corner of the triangle at the location of the original point. The expressions for the next corner are

 

VectorValue(GeomCoordXY([Geom], 0), 0) + 4

 

and

 

VectorValue(GeomCoordXY([Geom], 0), 1) + 2

 

These expressions place the second corner of the triangle four units to the right and two units above the location of the point.  The expressions for the third corner are

 

VectorValue(GeomCoordXY([Geom], 0), 0) + 4

 

and

 

VectorValue(GeomCoordXY([Geom], 0), 1) - 4

 

These expressions place the final corner of the triangle four units to the right and four units below the location of the point.   The net effect is to create a triangle with one corner at the location of the point to be replaced and the rest of the triangle to the right of that location.

 

Preview:

 

il_trans_drawing_compose_triangle_pre.png

To see the relationship of the new triangles to the original points we can overlay with slight transparency the original drawing:

 

il_trans_drawing_compose_triangle_compare_pre.png

Convert to Area

For each object in the source field, take the sequence of defining coordinates and create an area to put into the target field.

il_trans_drawing_objectlines.png

 

Preview:

 

il_trans_drawing_convert_to_area_pre.png

When creating areas from lines this template is normally used with lines that form closed figures since an area object will be constructed from an unclosed line by connecting a final segment from the last coordinate of the line to the first coordinate, as seen above.   Points are discarded.

Convert to Line

For each line or area object in the source field, take the sequence of defining coordinates and create a line to put into the target field. Points are discarded.

il_trans_drawing_objects.png

 

Preview:

il_trans_drawing_convert_to_line_pre.png

Convert to Point

For each object in the source field, take the defining coordinates and create a point at each such coordinate to put into the target field.

il_trans_drawing_objects.png

 Preview:

il_trans_drawing_convert_to_point_pre.png

Important: The Convert to Point template creates multipoints, that is a single geom object that can have more than one point in it.   That is so that each source record is matched by exactly one target record.  If an area is defined by a few hundred points the resulting geom will still be a single record, but it will be a multipoint with a few hundred points in it.

 

The many points which appear in the center occur because that portion of the line was a curved segment, translated into many points as an approximation.

 

See the Notes to  the Transform Panel topic for a discussion and illustration of how the points created by Convert to Point are multipoints but the points created by Decompose to Coordinates are all separate points in separate records.

Convex Hull

For each line or area in the source field create the polygonal area with least boundary length that encloses the object and put into the target field. Ignore points.  The mathematical definition of convex hull is usually explained by the more intuitive notion of the shape a rubber band would take when stretched around the outside of pins placed at all the coordinates that define the object.

il_trans_drawing_objects.png

 

Preview:

il_trans_drawing_convex_hull_pre.png

Points have no extent so there is no convex hull area for a single point.   The convex hull area with an apparently curved corner in the center of the drawing above is the result of computing a convex hull for the line in the middle of the original drawing, which has a curved segment.  The line appears to consist of straight line segments only due to rendering approximation at the zoom level used.

Copy

Copy the source field into the target field, including copying and automatic conversion between different geom types.  Normally used with tables, but can also be used with drawings when copying values, such as geom fields, in tables where there is more than one geom field.

 

il_trans_drawing_objects.png

 

Example: Put into Tgeom a Copy of objects specified in Geom.

 

il_trans_copy_drawing.png

Geom is visualized in the drawing above and Tgeom is visualized in the drawing below, shown using green color to emphasize it is a different drawing.

 

il_trans_drawing_copy.png

Sometimes we may want to have two geom fields in a table so we can make a copy of objects to which we intend apply intricate transformations, just in case the results are not what we want.

 

Suppose, for example, in our original table we select two of the areas:

 

il_trans_drawing_copy1.png

We then apply a transformation restricted to the selection, that uses a complex expression.  

il_trans_drawing_copy2.png

But we click too quickly without looking at the preview first and the result is we put NULL values into the geometry for the areas.  That makes them disappear.    We can get them back by using Copy to copy Tgeom into Geom.

il_trans_drawing_copy3.png

The preview above shows the areas that would be copied from Tgeom back into Geom, including the two areas we inadvertently NULLed.

 

The following examples of conversions launch the transform from an opened table, not from the drawing.  It is easier to see what a conversion does by looking at previews in the table.

 

Example: Copy from Geom into the WKB geometry field TgeomWKB.  We create a new field in the table called TgeomWKB of type geomwkb.

il_trans_copy_geom.png

We then use the Copy template to copy from Geom into TgeomWKB.   The copy automatically converts Manifold geom types into WKB geom types.

 

We can use a similar procedure to convert a Manifold geom type into WKT text type.   We create a field in the table called Text_WKT of type varchar.  

 

il_trans_table_copy_wkt_dlg.png

 

Copy into Text_WKT the result of GeomWkt([Geom]) entered into the source Value box, showing the preview:

il_trans_copy_geom_text.png

 

Manifold evaluates the SQL expression in the Value box on the fly, using whatever is the value of Geom for that record within the GeomWkt function that converts a geom into a WKT string.

Enclosing Circle

For each line and area object in the source field create the smallest size, circular area that encloses the object and put into the target field.

il_trans_drawing_objects.png

 

Preview:

il_trans_drawing_enclosing_circle.png

Enclosing Rect

For each line and area object in the source field create the smallest size, vertically oriented rectangular area that encloses the object and put into the target field.

il_trans_drawing_objects.png

 

Preview:

il_trans_drawing_enclosing_rect.png

Enclosing Rect, Rotation Allowed

For each line and area object in the source field create the smallest size rectangular area that encloses the object and put into the target field.  The smallest size rectangular area is that which covers the area in any rotation and not just vertically oriented.  

il_trans_drawing_objects.png

 

Preview:

il_trans_drawing_enclosing_rect_rotated.png

Linearize

Replace all curved segments of line and area objects in the source field with linear, that is, straight, segments using the number of straight segments specified in Curved Limit to replace each curved segment and put the result into the target field.  Copy point objects from source to target.    As discussed in the Editing Drawings topic, curved segments are a poor choice in GIS and should regularly be replaced with linear segments.  The Linearize template makes that easy.

 

il_trans_drawing_linearize_start.png

We zoom into our objects example to a line, seen above, containing a curved segment between two linear segments.   

 

il_trans_linearize_geom.png

 

The curved segment is the arc extending approximately half-way around a circle.  It appears to be made up of straight line segments because rendering of curved segments in drawings depends greatly upon zoom level, coordinate system and other factors so that curved segments are normally rendered using polyline approximations.   

 

We can apply the Linearize transform template using a Tolerance of 0, for automatic epsilon approximations of straight segments to curve locations, and various values for Curve limit to see what those do.   In the illustrations below we have used Add Component to create new, linearized components and then have added them as layers to the original drawing, coloring each layer differently, to allow direct comparison of results at the same scale.

 

il_trans_drawing_linearize_100.png

Using a Curve limit of 100 results in a smooth-looking line, even smoother than the original curved segment as approximated in the initial rendering.   A Curve limit of 100 causes Manifold to replace the curved segment with 101 straight line segments (zero based counting is used).

 

il_trans_drawing_linearize_5.png

A Curve limit of 5 results in six segments being used.

 

il_trans_drawing_linearize_3.png

A Curve limit of 3 results in four segments being used.

 

il_trans_drawing_linearize_2.png

A Curve limit of 2 results in three segments being used.   

 

Important:  Visual display windows approximate curved segments with a limited number of linear segments when the view is zoomed out and the curved segment is small.   That can result in an unsmooth appearance of small, curved segments  when drawings are zoomed out.

Maximum Value

Compare two fields, choose the maximum value of the two and put that value into the target field.

il_trans_drawing_maxval01.png

 

Suppose we have a table with two geom fields, one named Geom and the other named Tgeom.   The objects are the same in both geom fields except for the first two records where Geom has areas in it and Tgeom has points.

 

il_trans_drawing_objects.png

 

The Objects Drawing shows objects taken from the Geom field.

 

il_trans_drawing_maxval02.png

The Temp Objects Drawing shows objects taken from the Tgeom field.   The two objects that are points in this field but areas in the Geom field have been selected and are shown in red selection color.

 

With the focus on the Temp Objects Drawing we click on the Transform panel and choose the Tgeom field as the Target and Maximum Value as the template.

 

il_drawing_maxval_dlg.png

 

We choose Tgeom as the Value and Geom as the Compare to value (the order which we choose is irrelevant as either way we are simply comparing the two fields).   We check the Restrict to selection box so that the preview shows only what happens when we compare the two objects that are different in the two geometry fields.

 

il_trans_drawing_maxval03.png

The preview shows that for those two records the two points in Tgeom would be replaced by the areas from Geom.   The Maximum Value template reckons that the areas in Geom are "bigger" (they have more coordinates defining them) than the points in Tgeom, so it chooses the areas to put into the target Tgeom field.

Minimum Value

The Minimum Value template works the same as Maximum Value but chooses the smaller of the two values.   If in the Transform panel shown above we had selected the Minimum Value template the preview would be as seen below.   Since the points in Tgeom are "smaller" than the areas in Geom the Minimum Value template would choose the points to put into the target Tgeom field.

 

il_trans_drawing_maxval04.png

Minimum Value

See the discussion in the Maximum Value template above.

Normalize

Normalize object metrics by removing redundant coordinates in objects in the source field and putting the result into the target field.   See the Coordinates topic.

il_trans_drawing_normstart.png

We start with the drawing above showing objects in the Tgeom field.   One of the objects, the triangular area on the left, has been edited by hand to insert two redundant coordinates.

 

il_trans_normalize_geom.png

 

Zooming in we see that two extra coordinates have been inserted, so the area boundary goes from the first vertex that defines the area out to a coordinate location above and to the left and then immediately back to the coordinate location of the first vertex.  That creates a dimensionless, spurious, out-and-back jump in coordinates that is redundant to defining the area.

il_trans_drawing_normalize.png

 

Choosing the Normalize template we see in the preview above that the dimensionless redundancy has been eliminated.  We also see a change in the line in the center because the curved segment has been replaced with straight segments as part of the normalization process.

Normalize Topology

 

Parse Base64 String

Convert base64-encoded geometry into a Manifold geom: Given a base64-encoded string extract the geometry specified in the string and write a geom containing that object into the target field.  

Parse GeoJSON

Convert GeoJSON geometry into a Manifold geom: Given a GeoJSON string extract the geometry specified in the string and write a geom containing that object into the target field.  

Parse GML

Convert GML geometry into a Manifold geom: Given a GML string extract the geometry specified in the and write a geom containing that object into the target field.  

Parse Hex String

Convert hexadecimal-encoded geometry into a Manifold geom: Given a hexadecimal-encoded string extract the geometry specified in the string and write a geom containing that object into the target field.  

Parse WKB

Convert WKB geometry into a Manifold geom: Given a WKB binary value extract the geometry specified in the WKB binary value and write a geom containing that object into the target field.  

Parse WKT

Convert WKT geometry into a Manifold geom: Given a WKT string extract the geometry specified in the string and write a geom containing that object into the target field.  

Remove Curves

Replace each curved segment in lines or areas in the source field with a single straight segment and put the result into the target field.

 

il_trans_remove_curves_geom.png

The sample drawing has only one object with a curved segment, the line object in the center.  

il_trans_drawing_remove_curves.png

The preview for Remove Curves shows how it would be replaced with straight line segments to approximate the curve.

Remove Z

Remove all Z values from objects in the source field and save to the target field.

Rotate

Rotate objects in the source field about their centers to the specified angle and put the result into the target field.

il_trans_drawing_more_objects.png

 

We begin with the sample drawing.

il_trans_rotate45_geom.png

 Rotate with an Angle value of 10 is shown in preview above.

il_trans_drawing_rotate45.png

Rotate with an Angle value of 45 is shown in preview above.

 

All of the areas and line objects are rotated 45 degrees about their centers.  We can see from the relative positions and relative rotations of the objects that it is not the drawing itself which is rotated but that each individual object is rotated about its center.  The positions of the centers of object relative to the centers of other objects are not changed.

Scale

Multiply coordinate values in the source by the given scale factor for both X and Y coordinates and put the result into the target field.

il_trans_drawing_more_objects.png

The sample drawing uses Orthographic projection so the effect of multiplying coordinate values will depend on the details of where objects are located relative to the projection center.

il_trans_scale_geom.png

Applying Scale with a Scale X value of 1.2 and a Scale Y value of 1 replaces all X coordinate values with values that are 1.2 times larger while leaving Y values unchanged.  That has the effect of moving the drawing in X dimension and also widening the X extent of objects.

il_trans_drawing_scale_x1y2.png

Applying Scale with a Scale X value of 1 and a Scale Y value of 1.2 replaces all Y coordinate values with values that are 1.2 times larger while leaving X values unchanged.  That has the effect of moving the drawing in Y dimension and also stretching vertically the Y extent of objects.

 

Because Scale is a simple multiply of coordinates by the given factors the effects of applying Scale are highly dependent upon which projection / coordinate system is in use.  The Scale template is very different from the way "scale" commands work in a graphics editor like PhotoShop or in a CAD program, where a "scale" means to change the size of an individual object while keeping it centered at the same position.

Segmentize

Convert each single segment in line and area objects in the source field into multiple segments as needed with each multiple segment no longer than the given Distance.

Set Z

Specify a Z value for each object in the source field and save the resulting Z-valued objects into the target field.

Shift

Add to or subtract from coordinate values in the source by the given values for a shift in the X direction and in the Y direction and put the result into the target field.

il_trans_drawing_shift1.png

We select two objects in the sample drawing and then we apply Shift with a Shift X of 100 and a Shift Y of 0, with the Restrict to selection box checked.

il_trans_drawing_shift2.png

The preview shows how the two selected objects would be moved 100 meters to the right.   We know they would move 100 meters because the sample drawing is in Orthographic projection, which uses meters as a unit of measure.

Smooth

Replaces coordinates in lines and areas the source field to smooth out apparent curves based on the specified Distance factor and save the result to the target field.  A better name might be a simplify function as many coordinates used to provide convoluted lines are reduced into fewer coordinates that provide simpler lines.

il_trans_drawing_rivers_start.png

 

The Rivers Drawing is in Pseudo Mercator, so the units of measure are meters.  The values in the Distance parameter will therefore be meters.

 

il_trans_smooth_geom.png

The preview shows the result of Smooth applied to objects in Geom using a Distance of 50.  The river lines are less smooth curves.

 

il_trans_drawing_smooth002.png

The preview shows the result using a Distance of 100. River lines are even more obviously composed of straight segments.

 

il_trans_drawing_smooth004.png

The bigger the distance, the more simple the lines.  Using a Distance of 200 the lines have become too simplified to connect in some cases.

Snap to Grid

Move all coordinates in the source field to orthogonally distributed grid locations with the specified Step X and Step Y distances between them and place the results in the target field..

 

il_trans_drawing_rivers_start.png

 

We start with a drawing of rivers in Pseudo Mercator projection and we apply Snap to Grid to Geom using a Step X of 200 and a Step Y of 200.

 

il_trans_orthogonalize_geom.png

The projection is meter-based so using steps of 200 means snapping vertices to a 200 meter by 200 meter grid.  The preview shows how vertices of the lines are moved to grid locations, so line segments become straight lines between locations on an orthogonal grid.

 

il_trans_drawing_orthogonalize.png

The illustration above shows a preview using steps of 500, for grid locations one-half kilometer apart.

 

To understand how Snap to Grid works we can work with a drawing that shows the province of Durango in Mexico using Orthographic projection, which is true to scale and uses meters as the unit of measure.

il_orthogonalize_01.png

Suppose we overlay a grid of points with a point located every 50000 meters in X and Y directions.

 

il_orthogonalize_02.png

 

Applying Snap to Grid to the area tells Manifold to move the coordinates that make up the area to the nearest point location.  

 

 

il_orthogonalize_03.png

 

The result is to move defining coordinates to locations where the lines between them are all vertically or horizontally straight lines or straight diagonal lines between grid locations.

il_orthogonalize_04.png

Most redundant coordinates will be eliminated.  It is possible, however, that some redundant coordinates will be left, in which case a quick Normalize operation will remove them.

Triangulate

Triangulates objects.  Given lines, areas or multipoints, performs a Delaunay triangulation of the geom coordinates of an object to create triangles as area objects.   Point objects that are not multipoints are ignored.

 

il_trans_drawing_triangulate01.png

 

We start with a zoomed in view of our example drawing.

 

il_trans_drawing_triangulate02.png

A preview of the Triangulate template shows how the borders of the triangles will be constrained by geom segments, that is, they will not cross segments within the geom.  The complex triangulation for the central line is a result of the curved segment in the line first being approximated into straight line segments, upon which the triangulation then operates.

Triangulate, Lines

Triangulates objects.  Given lines, areas or multipoints, performs a Delaunay triangulation of the geom coordinates of an object to create triangles as line objects.   

 

il_trans_drawing_triangulate01.png

 

We start with a zoomed in view of our example drawing.

 

il_trans_drawing_triangulate_lines.png

 

A preview of the Triangulate, Lines template shows it creates lines and not areas.  As with the Triangulate template, the borders of the triangles will be constrained by geom segments, that is, they will not cross segments within the geom.  The complex triangulation for the central line is a result of the curved segment in the line first being approximated into straight line segments, upon which the triangulation then operates.

 

Notes

Distances - Some templates use combo boxes within which we can specify a distance.  The distance units used in such boxes are the units of measure specified for the coordinate system (projection) utilized by the source geom field.    The quickest way to see that is normally to right-click on the table involved in the Project pane and to choose Properties.  The FieldCoordSystem.Geom property will show the coordinate system used for the Geom field.   Right-clicking onto the value cell of that property and choosing Edit will show the entire contents of the value, including the unit of measure used.  If the projection in use uses meters as the unit of measure than whatever we enter into Distance for, say, creating a buffer will be a number in meters.  

 

We must, of course, pay attention to what we are doing given that many data sets use Latitude/Longitude coordinate systems which use geographical degrees as a unit of measure.  If we give a Distance of 1 in such cases we are telling Manifold to use a distance of 1 degree, which is about 111 km or 69 miles at the Equator and a different value elsewhere.

 

It is inefficient to use Latitude/Longitude when we need to do anything involving distances, so it makes sense to quickly re-project any such data into a coordinate system that does not use degrees.

 

See Also

Editing Drawings

 

Contents Pane

 

Transform

 

Contents - Transform

 

Command Window

 

Queries

 

Transform Templates

 

Transform Templates - Drawings

 

Transform Templates - Images

 

Transform Templates - Binary

 

Transform Templates - Boolean

 

Transform Templates - Datetime

 

Transform Templates - Numeric

 

Transform Templates - Text

 

Transform Templates - Tile

 

Transform: Center and Centroids

 

Transform: Escape Templates

 

Transform: Overlay Topology

 

Transform: Voronoi Diagrams