# Transform - Geometry

Transforms which appear in the template list when a geometry field, of type geom, geommfd, or geomwkb, has been picked in the Transform pane.

Note: spatial overlays, previously done using transform templates are now done using the Join dialog.

 Buffer Compute buffer zone geometry given the Distance and Unit of measure specified and save into the specified Result destination, using the geometry type of the destination or choosing geom, geommfd, or geomwkb when saving to a new field or new table.  A positive Distance creates a buffer zone area surrounding points, lines and areas.  A negative Distance writes  NULL geometry for points and lines, and for areas creates a inner buffer zone area that is reduced from the original area boundary by the distance of the buffer.  If the area is so small that the inner buffer zone is reduced to nothing a NULL geometry value is written.   The units of measure provided depend upon the unit of measure used in the geometry field.  For radial coordinate systems (for example, using degrees for units of measure as in Latitude / Longitude) available units will be Arc Minute, Arc Second, Degree, and Radian.  For linear coordinate systems (for example, Pseudo-Mercator), the Unit box will be populated with the long list of linear units Manifold knows. Center Compute the centroid of objects using:   circle - The center of a minimum enclosing circle. inner (area) - For areas only, a merge into the center point of a minimum enclosing circle as adjusted to fall within the original area weight (area) - For areas only, a merge into the center of gravity point of the subject areas, as if they were cut out of cardboard.   See the Center and Centroids topic. Clean Clean the geometry of objects using available operations:   convert curves to lines, - Replace curvilinear segments with the number of straight line segments given in the Curve limit parameter, to the given tolerance, with a tolerance of 0 indicating automatic tolerance. fill missing z - Set z values in objects that do not have z values to the given value.   fill z - Set z values in all objects to the given value. , normalize metric - Normalize object metrics by removing redundant coordinates. remove curves - Replace all curvilinear segments with straight line segments. remove z - Remove z information from geometry. Clip Clip objects in the source drawing using area objects in the Clip with drawing.  The Keep inner part option regulates what is left after the clip.   Checking the Keep inner part option leaves only those portions of objects in the target drawing that are inside of the Clip with areas.   Unchecking the Keep inner part option leaves only those portions of objects that are outside of the Clip with areas.   The transform allows operating only on the selection in the target drawing, and also allows clipping only with selected areas in the Clip with drawing.   The Clip transform template is a different command than the interactive Clip editing command.   See the Clip (Transform) topic for details and illustrated examples. Compose Compose a geometry value from coordinate numbers and save to the specified Result destination:   circle  -  Compose a circle from X and Y coordinate values and a Radius. point -  Compose a point from X and Y coordinate values. point with z -  Compose a point from X and Y coordinate values and add a Z value. rectangle  -  Compose a rectangle from X and Y coordinate values for two diagonally opposite corners. segment  -  Compose a straight line segment from X and Y coordinate values for the beginning and end coordinates. triangle -  Compose a triangle from X and Y coordinate values for each of the three vertices. Convert Convert objects to their equivalent as area, line, or point objects.  Converting areas to lines or to points will created branched lines (multilines) or branched points (multipoints).  Converting lines to points will create branched points.   Such branched points can be converted into lines or areas, and branched lines can be converted into areas, because branched points and branched lines contain within their coordinate ordering the sequence information required to construct a higher level object, such as lines or areas from branched points, and areas from branched lines. Copy Provides numerous operators to extract or to compute geometry characteristics and to save to the specified Result destination, using the data type required and providing rich options for each operation.  Available operations include:   area - Compute the area covered by a polygonal area in the specified square units, using either geodetic or planar computation. bearing - Compute the bearing direction from the first coordinate of the object to the last coordinate of the object using either geodetic or planar computation. branch - Extract and save as an object the given branch number. coordinate x - Report the x value of the given coordinate number counting from the start or end of the sequence of coordinates that defines the object. coordinate xy - Report the xy vector value of the given coordinate number counting from the start or end of the sequence of coordinates that defines the object. coordinate xyz - Report the xyz vector value of the given coordinate number counting from the start or end of the sequence of coordinates that defines the object. coordinate y - Report the y value of the given coordinate number counting from the start or end of the sequence of coordinates that defines the object. coordinate z - Report the z value of the given coordinate number counting from the start or end of the sequence of coordinates that defines the object. geometry - Copy the geometry of the object. length - Report the length of the object using either geodetic or planar computation. number of branches - Report the number of branches in the object. number of coordinates - Report the number of coordinates in the object. number of curves - Report the number of curvilinear segments in the object. radius - The radius of the minimum enclosing circle for an object, useful for ranking geometry values by size. rectangle - Report the coordinates (lower left corner, upper right corner) of the minimum, vertically-oriented, enclosing rectangle as an x4 value. type - Report areas as type 3, lines as type 2, and points as type 1. x max - Report the largest x coordinate value in the object. x min - Report the smallest x coordinate value in the object. y max - Report the largest y coordinate value in the object. y min - Report the smallest y coordinate value in the object. z max - Report the largest z coordinate value in the object. z min - Report the smallest z coordinate value in the object. Enclose Compute the minimum enclosing area shape desired for objects and save into the specified Result destination using the specified geometry type.  Options in the Enclose in box for enclosing shapes are:   circle - Compute the minimum enclosing circle area. convex hull - Compute the convex hull area. rectangle, - Compute the minimum enclosing rectangular area aligned north-south. rectangle with rotation - Compute the enclosing rectangular area freely rotated to whatever bearing alignment allows the smallest enclosing rectangle. Expression Save the result of the given expression into the specified Result destination using the specified geometry type. Interpolate Create raster data in the specified Result destination and specified data type by interpolation using values in vector objects in a drawing.  Parameter boxes will automatically appear as required by different interpolation options.   gravity (IDW) - Compute pixel values in tiles from Z values in objects using gravity formulae with inverse distance weighting (IDW) for interpolation and optional specification of interpolation order. Kriging - Compute pixel values in tiles from Z values in objects using Kriging for interpolation. Kriging with median polish - The same as Kriging, but with the application of median-polish, an extra processing step, to improve the interpolation.   Kriging with regression - The same as Kriging, but using a regression model as well.  See notes below. natural neighbors - Use natural neighbors interpolation with Sibson weights for interpolation.  Limited to interpolation within the convex hull of the source data. thin-plate spline - Use thin-plate spline (TPS) interpolation, which works both inside and outside the convex hull of the source data. triangulation - Compute pixel values in tiles from Z values in objects using triangulation for interpolation. triangulation with segments - Compute pixel values in tiles from Z values in objects using constrained triangulation for interpolation, and providing a Remove flat areas (DEST) option.  The option improves triangulation of contours using a DEST (Determination of Earth Surface Structures) algorithm, which helps to remove or reduce terracing effects when contouring from contour lines or other regular data.   Typical interpolation parameters, depending on the operation:   Z - Field to use for interpolation value. Margin - Additional distance, in the specified unit of measure, to create the image beyond the bounding rectangle of vector data in the drawing. Resolution - Size of resulting pixels, in the specified unit of measure. Radius - Radius, in the specified unit of measure, for neighbor searches.  0 or negative = Auto. Neighbors - Number of neighbors to use.  0 or negative = Auto. Model - Interpolation model.  Default is to autoselect the model.  Click to choose a specific model. Regression - Regression model.  Default is to autoselect the model.  Click to choose a specific model.   Do not use a Resolution of 1 with a Unit of Degree when drawings are in a radial coordinate system, like Latitude / Longitude. That creates pixels which are 1 degree in size, many kilometers in size in most parts of the world.    If drawings are in a linear  coordinate system and the Unit chosen is Meter, a Resolution of 30 creates pixels that are 30 meters by 30 meters in size.  To keep units straight, it is best to do interpolations using drawings that have been projected into linear coordinate systems, and not radial coordinate systems like Latitude / Longitude.   Interpreting various combinations of specified (positive value) or auto-computed (zero or negative value) for Radius and Neighbors:   Specified Radius and Neighbors auto-computed = Use all neighbors within the specified radius. Both Radius and Neighbors auto-computed = Use all Voronoi neighbors.   Specified number of Neighbors, but Radius auto-computed = Radius set by the system according to the global interpolation picture. Specified number of Neighbors, and specified Radius = Use up to the specified number of neighbors within the specified radius.   Interpolation Model options:   auto circular exponential gaussian linear power rational spherical   Regression model options:   auto linear quadratic   The SQL function used within interpolation transform templates operate on objects that have Z values within their geoms.  The transform automatically takes Z values from the designated field and temporarily adds them as Z values within the geom for each object so the function used can operate.  The starting data is not changed, so after running this transform objects will not end up with Z values in their geoms.   Kriging operations produce a report of the parameters used, including resolved values for autocomputed parameters, and save the report into the description property of the new image component.   In Kriging, geoms without Z values are ignored.  All geoms are converted to coordinates. Duplicate XY coordinates are ignored: if duplicate XY coordinates have different Z values, the operation uses one of these values and ignores any other Z values.    If there is too little data to set up the model, Kriging degrades to Gravity interpolation.   About regression Kriging: Imagine an undulating surface that lies on the slope of a large hill, where if the surface were not bumpy we would have a smooth plane inclined at the overall angle of the hill.  Suppose now we have many points that lie on the surface with each point providing the X,Y, and Z value of the surface at that point. Some regions of the surface have relatively few points or are lacking points.     The general task of Kriging is to take the collection of many points and to re-create the surface, filling in through computation some plausible interpolation in regions where sample points are sparse or missing.  Ordinary Kriging simply takes the X,Y,Z values of the points and applies Kriging computations to interpolate a surface.   Regression Kriging first attempts to ascertain the overall inclined plane and to remove that as a bias, to allow considering the undulating surface as if it were arranged horizontally and not tilted on the overall slope of a hill.  A Kriging calculation is performed on the adjusted, "as if level,"  coordinates of the points, and then the resulting interpolated surface is titled back to the original overall incline.  The choice of linear or quadratic regression is a choice of how the original "overall" tilted-plane setting is determined.   Regression Kriging can identify and set aside more complex biases than the case of an undulating surface within a simple, overall incline in a hill.  This non-mathematical description provides an analogy, not an exact phrasing of the math involved, to help non-mathematicians understand how Regression Kriging can provide better results than ordinary Kriging. Merge Combine objects, optionally grouping by an attribute field, and save the combined result into the specified Result destination using the specified geometry type.   Objects to be merged optionally can be grouped by a field given in the Group box.   Options in the Merge into box are:   area (dissolve) - For areas only, a classic GIS "dissolve" operation by field values when grouped by a field or simply a union of all areas into one area when not grouped by a field. center - A merge into the center point of a minimum enclosing circle, either one center point for all objects together or into multiple center points for minimum enclosing circles of merged groups of objects when objects are grouped by a field,.   center inner (area) - For areas only, a merge into the center point of a minimum enclosing circle as adjusted to fall within the original area, either one center point for all areas together or into multiple center points for minimum enclosing circles of merged groups of areas when areas are grouped by a field.    center weight (area) - For areas only, a merge into the center of gravity point of the subject areas, as if they were cut out of cardboard, either one center point for all areas together or into multiple center of gravity points for merged groups of areas when areas are grouped by a field.   circle - A merge into a minimum enclosing circular (in the coordinate system of the drawing) area,  either one circular area for all objects together or into multiple circular areas of merged groups of objects when objects are grouped by a field,. convex hull - A merge into a convex hull area,  either one convex hull for all objects together or into multiple convex hulls for  merged groups of objects when objects are grouped by a field. line - For lines only, a merge into a single, branched line object for all lines together, or into multiple, possibly branched lines for merged groups of lines when lines are grouped by a field. points - For points only, a merge into a single, branched point object for all points together, or into multiple, possibly branched points for merged groups of points when points are grouped by a field. rectangle - A merge into a minimum enclosing rectangular area aligned north-south, either one rectangle for all objects together or into multiple rectangles of merged groups of objects when objects are grouped by a field. rectangle with rotation - A merge into an enclosing rectangular area freely rotated to whatever bearing alignment allows the smallest enclosing rectangle, either one rectangle for all objects together or into multiple rectangles of merged groups of objects when objects are grouped by a field.   Notes:   The center operations when the mfd_id field is used for grouping are equivalent to the Center transform, since simply a centroid of the desired sort is created for each object.     Whenever a circle is mentioned in the above, that is a circular figure within the coordinate system of the drawing, or an approximation of a circle in radial coordinate systems like Latitude / Longitude.  Use a linear coordinate system that preserves measurement of distance in the region of interest to generate "real" circles.   Creating branched point objects using the points option is generally a very bad idea, because the result is something that looks like independent point objects but which in fact is a single, branched object, a so-called "multipoint."   Friends do not let friends create multipoints. Overlay Perform an ESRI-style topology overlay on a pair of drawings in a map using identity, intersect, union, or update. The result drawing includes fields from the source drawing (transferred using the original field names) as well as fields from the overlay drawing (transferred using original names as modified based on the specified pattern, by default Overlay {name}). Both drawings can be restricted to the selection.  Options in the Operation box are:   identity - Use the boundaries of areas in the overlay drawing to split all areas, lines and points in the source drawing, and save each resulting part of the original object from the source drawing into the specified Result destination. intersect - Intersect all objects in the source drawing with areas in the overlay drawing, and save each resulting part of the original object from the source drawing that falls within an area in the overlay drawing into the specified Result destination. union - Intersect all objects in the source drawing using areas in the overlay drawing, and then intersect all areas in the overlay drawing using areas in the source drawing.  Save all resulting pieces, discarding duplicates, from both operations into the specified Result destination. update - Intersect all objects in the source drawing with areas in the overlay drawing.  Remove the intersection result objects from the source drawing and save the remaining source drawing object pieces together with all of the overlay drawing areas into the specified Result destination. Reshape Alter the shape of objects using the specified operation and parameters, and save into the specified Result destination using the specified geometry type.   Z values are preserved and 2D curvilinear segments are preserved, but 3D curvilinear segments are replaced with 3D straight line segments.  Options in the Operation box are:   flip horizontal - Flip objects horizontally about the circle centroid of the object. flip vertical - Flip objects vertically about the circle centroid of the object. reverse - Reverse the order of coordinates defining lines. Points and areas are unmodified. rotate - Rotate objects about their circle centroid to the specified clockwise angle, using the specified choice of angular unit (Arc Minute, Arc Second, Degree, Radian). scale - Scale objects by the given X and Y scale values about the circle centroid of the object. shift - Move objects in the X direction and in the Y direction by adding to or subtracting from coordinate values by the given values using the specified unit of measure. smooth - Reduces the number of coordinates used to define an area or line to no more than one coordinate per distance given in the Tolerance box using the specified unit of measure.  Would be called "simplify" but for historical compatibility with function names. snap to grid - Move all coordinates for all objects to the nearest orthogonally distributed grid locations with the specified X step and Y step distances between them using the specified unit of measure.  Usually should be followed by a Clean :  normalize metric operation to eliminate redundant coordinates. unscale - Inverse of the scale operation.  Using scale with X and Y scale values of .5 will reduce objects to half size.  Using unscale with X and Y scale values of .5 will expand those reduced objects to their original size. Split Decompose objects into constituent elements as specified in the Split into box and parameter options, and save into the specified Result destination using the specified geometry type.  Split into options are:   branches - Split branched objects into separate objects for each branch.  Creates areas from holes in areas as well as an area object with filled holes.  Use the shapes operation to retain holes in areas. convex parts - For areas only, decompose each area into smaller area objects such that each smaller area is a convex hull for the locations it encloses.  There usually are many possible such decompositions of a larger area into smaller areas.  The algorithm used generates one such decomposition. coordinates - For each coordinate of every object create a single point object. line coordinates - For lines only.  Given a  Start distance, an End distance, and a distance Step in the specified unit of measure, creates a sequence of points on the line from start to end at the specified step distances. Works with lines composed of straight line segments, converting any curvilinear segments to straight line segments on the fly.  The operation follows branches in order. If the maximum distance given is longer than the first branch, measurements continue into the second branch, and then into the third, and so on until the maximum distance is reached.  Also works using a negative distance for Step and setting the Start distance to be greater than the End distance, although that is conceptually more confusing than beginning at the Start and using positive Step distances. Uses the GeomToCoordsLineSequence SQL function. line parts - For lines only.  Given a  Start distance, an End distance, and a distance Step in the specified unit of measure, creates a sequence of lines on the line from start to end at the specified step distances. Works with lines composed of straight line segments, converting any curvilinear segments to straight line segments on the fly.   Similar to line coordinates for how it works with branches and negative Step distances. parts -  Splits areas and lines into parts using areas or lines in a different drawing. segments - For each segment of every line or area boundary create an equivalent line object. shapes - For areas.  A shape is a branch of an area that forms an island.  A shape is also referred to as an individual polygon within a multipolygon object.  For each shape of every area create a separate area.  Points and lines are copied unchanged except that any curved segments in lines are replaced by straight segments.   This operation decomposes areas to shapes using OGC rules for coordinate ordering with the GeomToShapes SQL function.   shapes (ESRI non-OGC) - The same as the shapes operation, but using ESRI rules for coordinate ordering using the GeomToShapesEsri SQL function.   triangles -  For areas only.  Perform a Delaunay triangulation of areas to create triangular areas that tile the original area.  Curved segments in area boundaries are replaced on the fly by straight line segments prior to triangulation.  Lines and points are discarded. Topology Simultaneously adjust coordinates that define points, lines and areas to accomplish several tasks at once, considering all of the objects in the drawing.   Alters any clockwise rotation area boundary sequences to OGC style counter clockwise rotation boundaries.   Frequently used to prepare drawings for use as a network or for similar purposes.   See the Normalizing Topology topic. Trace Computed bounded areas and save into the specified Result destination using the specified geometry type.  Given line objects, creates areas in regions entirely enclosed by self-intersecting, intersecting or otherwise touching lines.  Areas and points are ignored. Saving the result into a new drawing / table called Bounded Areas creates five areas: Triangulate Perform a Delaunay triangulation on all points and multipoints, creating triangular areas or lines as specified in the Output type box, and save into the specified Result destination using the specified geometry type.  Ignores areas and lines in the original geometry field. Voronoi Create areas or lines as specified in the Output type box that create a Voronoi diagram for the positions of points in the source geometry field.  Areas and lines are ignored.   A Voronoi diagram divides the drawing into regions around each point that are shaped so that the borders of the regions are equidistant from the two nearest points.   The Margin setting allows choosing a Margin distance in X and Y directions in the specified unit of measure from the nearest points, to clips the extent of Voronoi cells to the resulting enclosing rectangle.  The Unit setting allows choosing a unit of measure.

## Notes

Virtual drawings - Operations on geometry can use any table with a geometry field. The geometry field does not have to be part of a spatial index, although having such an index will frequently help performance. A query function that operates on geometry can accept either a physical drawing component stored in a database, or a virtual drawing created on a geometry field (using the ComponentFieldDrawing function) of a table or of a query component.  A virtual drawing supports all functions available for regular components:  for example, it can report its coordinate system or the name of the underlying component.  Both physical and virtual drawings can be limited to using only selected records with the result being accepted as a drawing by query functions.

Tolerance - Operations on drawings do not specify a tolerance value except for a few special cases where this value materially defines the operation, for example, normalize. The tolerance value passed to query functions that require a tolerance argument is set to 0, for automatic tolerance. In the future, this parameter likely will be removed from most functions altogether, so users need not consider it at all.

Pass through of unaffected geometry - Geometry transforms that only make sense for a particular geometry type keep geometry values of other types unchanged whenever this makes sense. For example, reversing lines will keep areas and points unchanged instead of turning them into NULLs.

Uneven X and Y scales are OK - Geometry transforms that operate on distances also automatically compensate for uneven X and Y scales. Previously, if a coordinate system of a geometry field had different scales by X and Y, creating a buffer would create a circle in the coordinate system of the drawing which would become an ellipse if the scales for X and Y were made the same. Same for other distance computations. Now the transforms make the X and Y scales even prior to computing the buffer and then force the computed buffer back to the scales used in the coordinate system. This makes the results of computations independent of the scales used in the coordinate system, which is much more reasonable.

Curvilinear segments - As a practical matter, most people doing GIS will use straight line segments for lines and areas.   Few GIS systems do a good job of supporting curved segments, so there is much less data published using curved segments.   Manifold's ability to work with curved segments allows us to use that data within Manifold in a limited way, at least for display and interactive editing.

However, most processing tools in Manifold, such as Transform templates and various Geom SQL functions, do their work by first converting a curvilinear segment into a straight line segment between the same two start and finish coordinates.  That will often lead to weird or otherwise unexpected results.  To avoid such problems, first convert curvilinear segments into equivalent constellations of straight line segments at whatever resolution is desired, using the transform template with the convert curves to lines operation option and the number of linear segments desired to approximate the curve in the Curve limit parameter.   See the Curved Segments discussion in the Drawings topic.

Transform Pane

Transform Reference

Transform - Expression

Transform - Binary

Transform - Boolean

Transform - Datetime

Transform - Numbers

Transform - Numeric Vectors

Transform - Text

Transform - Tiles

Transform - UUID