# Geom SQL Functions

This topic covers functions built into the Manifold query engine, called SQL functions or query functions,  that begin with Geom.   Functions that begin with Geom manipulate object geometry and geometric relationships.  For example, the GeomAdjacent function returns true if two objects are adjacent using the given tolerance, with a zero for tolerance specifying automatic tolerance.  GeomBearingGeo provides the geodetic (computed on the surface of the given ellipsoid) bearing of the given geometry.  For both raster and vector data.  Geometry functions can also manipulate geometry, such as the GeomOverlay series of functions, or functions like GeomToShapes.

The Manifold query engine also supports declaring and calling functions, including script functions, functions in external files and compiled functions as .NET assemblies.

• For information on functions in queries, please see the Queries topic.

• For information on declaring and calling functions, please see the Functions topic.

Manifold has so many SQL functions they have been grouped into several topics:

• SQL Functions - Introduction and list of topics by function category.

• Geom SQL Functions - This topic:  Functions that begin with Geom and manipulate geometry, as used within drawings.

• String SQL Functions - Functions that begin with String and manipulate strings (text) within tables, including attributes of drawings and labels.

• Tile SQL Functions - Functions that begin with Tile and manipulate tiles and pixels within tiles, as used within images (rasters).

• Other SQL Functions - Non-aggregate functions that do not begin with Coord, Geom, String or Tile.

The list of functions below uses the same nomenclature as the function templates in the Query Builder.  SQL functions take arguments as specified in angle < > brackets.  The data type or value type the function returns is given after the : colon.    For example, Chr(<value>) : <string> takes a numeric <value> and returns a text <string>, as noted in the description a string that is a single character.   CoordSystems() : <table> takes no arguments and returns a table.

Examples in the list below which use an ? expression evaluation command are intended to be run in a Command Window.   Do not add a semicolon ; character when using the ? command in a Command window.  When using the ? command we use CALL when the function returns more than just a value, for example, when it returns a table.

Indexes are always zero based: for example, in an object consisting of three branches the first branch is branch 0, the second is branch 1 and the third is branch 2.

This is a long list, so to find a function it is best when viewing this topic in a browser to do a Ctrl-F to open a Find box and to enter the function name of interest to be able to jump to that function.  The list in this topic is comprehensive but new items are often added with updates to Manifold and may appear in the product before they appear in this documentation.   See the list in the query builder tab of the Command Window for an authoritative list of operators, commands and functions.

## Constants

See the Identifiers, Constants and Literals topic for some useful constants.   For information on functions that use a <filter> argument or which produce a filter definition matrix, see the How Matrix Filters Work topic.

## Functions

 GeomAdjacent(, , ) : Given two geoms returns true if they are adjacent. A tolerance of zero means automatic tolerance.   For the definition of adjacent see the Join topic. GeomArea(, ) : Given a geom that contains an area object, returns the area (Euclidean planar computation) of that area object in square units of measure used by the coordinate system.  A tolerance of zero means automatic tolerance.   SELECT GeomArea([Geom], 0) AS [Computed Area] FROM [Mexico]; GeomAreaGeo(, , , ): Given a geom that contains an area object, and values for major axis, eccentricity, and tolerance, returns the geodetic area (computed on the surface of the ellipsoid) of that area object.  A tolerance of zero means automatic tolerance.   The geom value must be an area in Latitude / Longitude, with X (longitude) and Y (latitude) expressed in degrees. The returned value is in squared units of the major axis (typically, meters, for a returned value in square meters).   Looking at the Custom tab of the Base Coordinate System dialog for the WGS84 base used for Latitude / Longitude projection, we can see the major axis is 6378137.01 and the eccentricity is 0.08181919084262149   Given a Mexico drawing of provinces as areas in Latitude / Longitude coordinate system, we can write:   SELECT GeomAreaGeo([Geom], 6378137.01, 0.08181919084262149, 0) AS [Geodetic Area] FROM [Mexico]; GeomBearing(): Given a geom that contains a line object, returns the bearing (Euclidean planar computation) of that line object. The line must have a single branch.   The bearing is computed from the first to last coordinate of the line. The returned value is in degrees. GeomBearingGeo(, , ): Given a geom that contains a line object, and values for major axis, and eccentricity, returns the geodetic bearing (computed on the surface of the ellipsoid) of that line object.     The geom value must be a single-branch line in Latitude / Longitude, with X (longitude) and Y (latitude) expressed in degrees.   The geodetic bearing is computed from the first to last coordinate of the line, using Vincenty's formulae.  The returned value is in degrees. GeomBearingPoint(, ): Given a pair of point (x2) values, returns the bearing (Euclidean planar computation) from the first point to the second point.  The returned value is in degrees. GeomBearingPointGeo(, , , ): Given a pair of point (x2) values,  and values for major axis, and eccentricity,  returns the geodetic bearing (computed on the surface of the ellipsoid) from the first point to the second point, computed using Vincenty's formulae.    The point values must be in Latitude / Longitude, with X (longitude) and Y (latitude) expressed in degrees.  The returned value is in degrees. GeomBoundedAreas(, ): Given line objects, creates areas in regions entirely enclosed by overlapping or otherwise touching lines.  Areas and points are ignored.  The Tolerance value specifies how close lines must be to each other to be considered "touching."   Line objects are normally merged before being used as the geom in this function, for example, as in:   GeomBoundedAreas(GeomMergeLines([Geom]), 0)) GeomBounds() : Given a geom, return a geom that in the case of areas is the border of the area and in the case of lines is the two end coordinates of the line as a multipoint.  NULL is returned for points. GeomBoundsCircle(, ) : Given a geom, return a geom for an area object that in the case of areas or lines is the minimal enclosing circle.  NULL is returned for points. A tolerance of zero means automatic tolerance. GeomBoundsRect() : Given a geom, return a float64x4 value that gives the location of diagonally opposite corners which define a vertically oriented rectangle that is the minimum enclosing rectangle for areas or lines.  NULL is returned for points.     Use the GeomMakeRect function to create a rectangular area object from the float64x4 value returned by GeomBoundsRect, as in   UPDATE (   SELECT [mfd_id],  [Geom],     GeomMakeRect(GeomBoundsRect([Geom])) AS [n_Geom]   FROM [Table Drawing] ) SET [Geom] = [n_Geom]; GeomBoundsRectRotated(, ) : Given a geom, return a float64x4 value that gives the location of diagonally opposite corners which define a rectangle of any orientation that is the minimum enclosing rectangle for areas or lines.  NULL is returned for points.  A tolerance of zero means automatic tolerance. GeomBoundsX(): Given a geometry value, reports the minimum and maximum X values of the geometry as an x2 value. GeomBoundsY(): Given a geometry value, reports the minimum and maximum Y values of the geometry as an x2 value. GeomBoundsZ(): Given a geometry value, reports the minimum and maximum Z values of the geometry as an x2 value. GeomBranch(, ) : Takes a geom and a branch number (0 is the first branch) and returns the specified branch as a geom. GeomBranchCount() : Takes a geom and returns the number of branches in that geom. GeomBranchFirst(, ) : Given a geom and a branch number (0 is the first branch) returns the index of the first coordinate in the specified branch. GeomBranchLast(, ) : Given a geom and a branch number (0 is the first branch) returns the index of the last coordinate in the specified branch. GeomBuffer(, , ) : Given a geom, a distance and a tolerance, returns a geom for an area object the border of which is the specified distance from any part of the object in the geom.   A tolerance of zero means automatic tolerance. GeomCenter(, ) : Given a geom returns a float64x2 value that specifies the location of the center of the minimum enclosing circle for areas and lines and which for points specifies the location of the point.   A tolerance of zero means automatic tolerance. GeomCenterInner(, ) : Given a geom returns a float64x2 value that specifies the location of the center of the minimum enclosing circle for areas, with the location adjusted so that it falls within the area object.   NULL is returned for lines and points.  A tolerance of zero means automatic tolerance. GeomCenterWeight(, ) : Given a geom returns a float64x2 value that specifies the location of the balance point  for areas   NULL is returned for lines and points.  A tolerance of zero means automatic tolerance. GeomClip(, , , ) : Given two geoms, use the geom in the second argument to "cookie cut," that is, to clip, the geom in the first argument, returning the result as a geom.   If the argument is true, leave the inner portion of the cut.   If the argument is false, leave the outer portion.   A tolerance of zero means automatic tolerance.   See illustrations and discussion in the Example: Clip Areas with a Transform Expression topic. GeomContains(, , ) : Given two geoms returns true if the first geom contains the second geom. A tolerance of zero means automatic tolerance.   For the definition of contains see the Join topic.   Example: A table contains a geom field called Buffer which are buffer areas that are larger than and were created from objects in the Geom field using the GeomBuffer function.  The Buffer objects contain the Geom objects.     SELECT GeomContains([Buffer], [Geom], 0) FROM [Table];   The above returns a results table where all rows have 1 for true because all of the Buffer objects fully contain the corresponding Geom object.   SELECT GeomContains([Geom], [Buffer], 0) FROM [Table];   The above returns a results table where all rows have 0 for false, because none of the Geom objects contain the corresponding Buffer object. GeomConvertToArea() : Takes a geom of arbitrary type and converts it to an area geom. Branches are auto-closed (if the starting coordinate of the branch does not coincide with the ending coordinate, the starting coordinate is added once again at the end). Curves and Z values are preserved.  Points which are single-branched multipoints are converted to areas.  Points that are not single-branched multipoints are converted into pathological areas defined by three coordinates that are all at the same location, of each point or point branch. GeomConvertToLine() : Takes a geom of arbitrary type and converts it to a line geom. Curves and Z values are preserved. Points are converted into pathological lines defined by two coordinates that are both at the same location. GeomConvertToPoint(, ) : Takes a geom of arbitrary type and converts it to a point geom. Converting objects such as areas, lines or multipoints will result in a multipoint.  The argument is true or false, controlling whether to keep original branches (true) or join all coordinates into a single branch (false). Z values are preserved. GeomConvexHull(, ,  ) : Given a geom, return an area object geom that is the convex hull enclosing the geom.  The allowSegmentPoint> boolean parameter specifies what is returned when the produced convex hull is a single point or a straight line segment.  When false, NULL is returned.  When true, an area with coincident coordinates is returned.  A tolerance of zero means automatic tolerance. GeomCoordCount() : Given a geom returns the number of coordinates in the object the geom contains.  A triangular area contains 4 coordinates because the last coordinate is the same as the first to close the area. GeomCoordLine(, ) : Given a geom and a distance position, returns the coordinate on the line at the specified distance from the start of the line.  The function considers all line branches: If the first branch ends before the specified distance, the function moves on to check the second branch and so on, until the distance is reached. If the distance is negative or greater than the total length of all line branches, the function returns a NULL value. GeomCoordX(, ): Given a geom and the index of a coordinate in that geom (0 based numbering, the first coordinate is the 0 coordinate), returns the value of the X coordinate number for that geom coordinate.     Suppose we have a drawing with points.  The drawing's table has X, Y, and Z float64 fields which we would like to populate with the X and Y coordinates in each point's geom, and the Z field with any Z value for each point:   UPDATE [Drawing Table] SET   [X] = GeomCoordX([Geom], 0),   [Y] = GeomCoordY([Geom], 0),   [Z] = GeomCoordZ([Geom], 0); GeomCoordXY(, ) : Given a geom and the index of a coordinate in that geom (0 based numbering, the first coordinate is the 0 coordinate), returns the value of that coordinate as a float64x2 value, representing the X and the Y coordinate numbers. GeomCoordXYZ(, ) : Given a geom and the index of a coordinate in that geom (0 based numbering, the first coordinate is the 0 coordinate), returns the value of that coordinate as a float64x3 value, representing the X, Y and Z coordinate numbers.   To test if a geom has a Z value, use GeomHasZ. To set the Z values for all coordinates of a geom to a specified value, use GeomSetZ.   To remove all Z values, use GeomRemoveZ. To read the Z value of the first coordinate of a geom, use    VectorValue(GeomCoordXYZ([Geom],0),2) GeomCoordY(, ): Given a geom and the index of a coordinate in that geom (0 based numbering, the first coordinate is the 0 coordinate), returns the value of the Y coordinate number for that geom coordinate.     Suppose we have a drawing with points.  The drawing's table has X, Y, and Z float64 fields which we would like to populate with the X and Y coordinates in each point's geom, and the Z field with any Z value for each point:   UPDATE [Drawing Table] SET   [X] = GeomCoordX([Geom], 0),   [Y] = GeomCoordY([Geom], 0),   [Z] = GeomCoordZ([Geom], 0); GeomCoordZ(, ): Given a geom and the index of a coordinate in that geom (0 based numbering, the first coordinate is the 0 coordinate), returns the value of the Z coordinate number for that geom coordinate.     Suppose we have a drawing with points.  The drawing's table has X, Y, and Z float64 fields which we would like to populate with the X and Y coordinates in each point's geom, and the Z field with any Z value for each point:   UPDATE [Drawing Table] SET   [X] = GeomCoordX([Geom], 0),   [Y] = GeomCoordY([Geom], 0),   [Z] = GeomCoordZ([Geom], 0); GeomCurveCount(, ): Given a geom and the type of curvilinear segment to count, returns the number of curvilinear segments in the geom.      specifies the type of curvilinear segment: Negative values or a value of 0 = count any curvilinear segment.  Positive values = count curvilinear segments of a specific type, with 1 = Circle, 2 = Ellipse, and 3 = Spline. GeomDistance(, , ) : Takes two geoms and returns the Euclidean distance between the geoms, reported in whatever units are used for the geoms. The geoms are assumed to be in the same coordinate system.   A tolerance of zero means automatic tolerance. GeomDistancePoint(, ) : Takes a pair of point (x2) values and returns the Euclidean distance in the 2D plane between the locations defined by these values. GeomDistancePoint3(, ) : Takes a pair of point (x3) values and returns the Euclidean distance in 3D space between the locations defined by these values. GeomDistancePointGeo(, , , ): Takes a pair of point (x2) values, and values for major axis, and eccentricity, and returns the geodetic distance (computed on the surface of the ellipsoid) from the first point to the second point, computed using Vincenty's formulae.    The point values must be in Latitude / Longitude, with X (longitude) and Y (latitude) expressed in degrees.  The returned value is in units of the major axis GeomFlip(, , ): Takes a geom,  a boolean to specify horizontal flipping, and a boolean to specify vertical flipping, and returns a geom flipped horizontally and vertically as specified, about the centroid of the object.   Z values are preserved and 2D curvilinear segments are preserved, but 3D curvilinear segments  are replaced with 3D straight line segments. GeomGml(, ) : Takes a geom and an optional coordinate system (pass an empty string for no optional coordinate system) and returns GML for the geom.   SELECT GeomGml([Geom],'') FROM [Table];   for no optional coordinate system, and   SELECT GeomGml([Geom],'EPSG:4200') FROM [Table];   to specify EPSG:4200 as the coordinate system. GeomHasCurves() : Takes a geom and returns true if the geom has any curvilinear segments. GeomHasZ() : Takes a geom and returns true if the geom has a Z value, that is, is 3D.   To set the Z values for all coordinates of a geom to a specified value, use GeomSetZ.   To remove all Z values, use GeomRemoveZ. To read the Z value of the first coordinate of a geom, use    VectorValue(GeomCoordXYZ([Geom],0),2) GeomInflateRect(, ):   GeomInflateRectTileSize(, ): A rect is a rectangular extent given by a four part (x4) number given the diagonally opposite corners of the rectangle as x1,y1, x2,y2 values.  To inflate a rect means to increase the size of the rectangle, and to deflate a rect means to decrease the size of the rectangle.   See the discussion of rects in the SQL Example: Miscellaneous SQL Functions topic.   GeomInflateRect inflates a rect by increasing the size of the rectangle by the given X,Y values in the two part (x2) value.   If the X or Y values are negative, the rectangle will be deflated, that is reduced by those values.   Consider a rectangle defined by a lower left x1,y1 corner of 0,0 and an upper right x2, y2 corner of 10,10.   We want to inflate the rectangle by two units in both X and Y.   In the Command Window we run the expression:   ? GeomInflateRect(VectorMakeX4(0,0,10,10), VectorMakeX2(2,2))   That yields the result:   float64x4: [ -2, -2, 12, 12 ]   The result gives a new rect, with a new lower left corner of -2,-2 and a new upper right corner of 12,12.    The overall size of the rectangle has been increased by 2 units in both X and Y direction.     Suppose we run the expression:   ? GeomInflateRect(VectorMakeX4(0,0,10,10), VectorMakeX2(-2,-2))   That yields the result:   float64x4: [ 2, 2, 8, 8 ]   The new rect has been contracted by two units in X and Y dimension, with a new lower left corner of 2,2 and a new upper right corner of 8,8.     GeomInflateRectTileSize takes a argument giving the size of a tile, such as 128,128, and adjusts the rect size by inflating it to cover whole tiles of the given size.   Consider a rectangle defined by a lower left x1,y1 corner of 0,0 and an upper right x2, y2 corner of 1040,1040.   We want to inflate the rectangle so the extent exactly covers a whole number of 128,128 tiles in both X and Y dimension   In the Command Window we run the expression:   ? GeomInflateRectTileSize(VectorMakeX4(0,0,1040,1040),     VectorMakeX2(128,128))   That yields the result:   float64x4: [ 0, 0, 1152, 1152 ]   The result gives a new rect, with a new lower left corner of 0,0 and a new upper right corner of 1152,1152.    Note that 1152 is exactly 9 tiles of width or height 128.   The GeomInflateRectTileSize function always inflates, increasing the size of the rect to the next whole number of tiles. GeomIntersectLines(, , ) : Takes a set of lines and returns their intersection points as a geom.  The geom will be one point, one intersection and will be a multipoint if there are multiple intersections.    A tolerance of zero means automatic tolerance. GeomIntersects(, , ) : Given two geoms returns true if they intersect. A tolerance of zero means automatic tolerance.   For the definition of intersect see the Join topic. GeomIsArea() : Returns true if the geom is an area. GeomIsLine() : Returns true if the geom is a line. GeomIsLineClosed(): Returns true if each branch in a line geom is closed, that is, if each branch has the starting coordinate equal to the ending coordinate. GeomIsNormalized() : Returns true if the geom is normalized.   Use within the pane's Expression template for geometry fields to select normalized geoms.   The system keeps track of geoms that have been normalized.  Normalized geometry values store an explicit normalized flag plus additional normalize data which allows quickly transforming geometry either to normalized form required by OGC or to the different normalized form required by ESRI. GeomIsPoint() : Returns true if the geom is a point. GeomJsonGeo(, ) : Takes a geom and an optional coordinate system (pass an empty string for no optional coordinate system) and returns GeoJSON for the geom.   SELECT GeomJsonGeo([Geom],'') FROM [Table];   for no optional coordinate system, and   SELECT GeomJsonGeo([Geom],'EPSG:4200') FROM [Table];   to specify EPSG:4200 as the coordinate system. GeomLength(, ) : Given a geom returns the length of lines and areas in native units of the coordinate system, using Euclidean measures in the plane of the coordinate system.  NULL is returned for points. A tolerance of zero means automatic tolerance.  The length of an area object is the length of its boundary, that is, the perimeter of the area.  The length reported for a branched object is the sum of the lengths of the branches.   SELECT GeomLength([Geom], 0) FROM [Table]; GeomLengthGeo(, , , ): Given a geom that contains an area or a line object, and values for major axis, eccentricity, and tolerance, returns the geodetic length (computed on the surface of the ellipsoid) of that object, computed using Vincenty's formulae  A tolerance of zero means automatic tolerance.   The length of an area object is the length of its boundary, that is, the perimeter of the area.  The length reported for a branched object is the sum of the lengths of the branches.   The geom value must be an area or line in Latitude / Longitude, with X (longitude) and Y (latitude) expressed in degrees. The returned value is in units of the major axis.   Looking at the Custom tab of the Base Coordinate System dialog for the WGS84 base used for Latitude / Longitude projection, we can see the major axis is 6378137.01 and the eccentricity is 0.08181919084262149   Given a Mexico drawing of provinces as areas in Latitude / Longitude coordinate system, we can write:   SELECT GeomLengthGeo([Geom], 6378137.01, 0.08181919084262149, 0) AS [Geodetic Length] FROM [Mexico]; GeomLinearize(, , ) : Convert curvilinear segments to straight line segments. Takes a geom, linearizes all curvilinear segments and returns the result.   A tolerance of zero means automatic tolerance. The linearization process is guided by the tolerance value and the maximum number of coordinates, 1 or more specified as the argument, to which a single curve part (for example, between two control points of a spline) of a curvilinear segment will be expanded. GeomMakeCircle(, ) : Takes an x2 value that defines the center and a radius value and returns a geom for a circular area object centered on that location with that radius. GeomMakePoint() : Takes an x2 value that defines a location and returns a geom for a point object at that location. GeomMakePoint3() : Takes an x3 value that defines a 3D location (X, Y and Z) and returns a geom for a 3D point object at that location. GeomMakeRect() : Takes an x4 value that defines diagonally opposite corners of a rectangle and returns a geom for a rectangular area object defined by those corner locations.  See the discussion of rects in the SQL Example: Miscellaneous SQL Functions topic. GeomMakeRectDiagonal(, ) : Takes a pair of x2 values that define diagonally opposite corners of a rectangle and returns a geom for a rectangular area object defined by those corner locations.  See the discussion of rects in the SQL Example: Miscellaneous SQL Functions topic. GeomMakeSegment(, ) : Takes a pair of x2 values and returns a line geom consisting of a straight line segment between those two locations. GeomMakeSegment3(, ) : Takes a pair of x3 values and returns a 3D line geom consisting of a straight line segment between those two 3D locations. GeomMakeTriangle(, , ) : Takes three x2 values that define the corners of a triangle and returns a geom for a triangular area object defined by those corner locations. GeomMakeTriangle3(, , ) : Takes three x3 values that define the corners of a triangle in 3D and returns a geom for a 3D triangular area object defined by those corner locations. GeomMergeAreas GeomMergeLines GeomMergePoints The GeomMergeAreas, GeomMergeLines, and GeomMergePoints functions are aggregate functions.  See the Aggregate SQL Functions topic. GeomNormalize(, ) : Normalize object metrics by removing redundant coordinates and note the geom has been normalized.   A tolerance of zero means automatic tolerance.  The function retains Z values if the object has Z values. GeomNormalizeTopology(, ) : Takes a drawing and returns a table with the drawing's geoms normalized, providing a table with the same fields but with the values in the geom field altered.   A tolerance of zero means automatic tolerance. GeomOverlayAdjacent(, , ) : Combines fields between a source drawing and an overlay drawing, finding cases where objects in the overlay are adjacent to objects in the source.  Given a drawing and an overlay drawing, returns a table with the following characteristics:   Columns: The returned table will contain all fields from the source drawing and all fields from the overlay drawing.  Fields from the source drawing will have their names prefixed with s_ for source.  Fields from the overlay drawing will have their names prefixed with o_ for overlay.     Rows: Every object in the source drawing that is not adjacent to an object in the overlay drawing will appear as a row in the table with values for the o_ fields set to NULL.   Every object in the source drawing that is adjacent to one or more objects in the overlay drawing will appear in one or more rows in the table with values for the o_ fields populated from the corresponding object to which it is adjacent.   A tolerance of zero means automatic tolerance. The table supports all indexes of the source drawing. The overlay is performed in the coordinate system of the source drawing; objects in the overlay drawing are automatically converted to that coordinate system as necessary.   We can use the table created by this function as desired in subsequent operations, for example, creating a drawing via a query that uses aggregates.   See the SQL Example: GeomOverlayAdjacent Function topic. GeomOverlayAdjacentPar(, , , ) : A parallel form of the GeomOverlayAdjacent function that takes a parameter for the suggested number of threads as encoded in the JSON string as "threads".  If the number of threads is less than or equal to 1 the GeomOverlayAdjacent function will be executed.  Use ThreadConfig to generate a JSON string with the desired number of threads. GeomOverlayAdjacentFilter(, , ): Takes a source drawing and an overlay drawing, finds all objects in the source drawing that are adjacent to any object in the overlay drawing, and filters the source drawing leaving only objects which are adjacent to at least one object in the overlay drawing. Unlike the result table of GeomOverlayAdjacent, the result table of GeomOverlayAdjacentFilter includes all fields from the source drawing and no fields from the overlay drawing.   Result tables returned by GeomOverlayXxxFilter functions contain all indexes from the source table and are writable. It is possible to chain calls to these functions as well as calls to SelectionXxx functions.   Example: The following query returns all states touching selected parcels:   TABLE CALL GeomOverlayTouchingFilter(states,   CALL Selection(parcels, TRUE), 0); GeomOverlayAdjacentFilterPar(, , , ) : A parallel form of the GeomOverlayAdjacentFilter function that takes a parameter for the suggested number of threads as encoded in the JSON string as "threads".  If the number of threads is less than or equal to 1 the GeomOverlayAdjacentFilter function will be executed.  Use ThreadConfig to generate a JSON string with the desired number of threads. GeomOverlayContained(, , ) : Combines fields between a source drawing and an overlay drawing, finding cases where objects in the overlay are contained by objects in the source. Given a drawing and an overlay drawing, returns a table with the following characteristics:   Columns: The returned table will contain all fields from the source drawing and all fields from the overlay drawing.  Fields from the source drawing will have their names prefixed with s_ for source.  Fields from the overlay drawing will have their names prefixed with o_ for overlay.     Rows: Every object in the source drawing that does not contain an object in the overlay drawing will appear as a row in the table with values for the o_ fields set to NULL.   Every object in the source drawing that does contain one or more objects in the overlay drawing will appear in one or more rows in the table with values for the o_ fields populated from the corresponding object to which it is adjacent.   A tolerance of zero means automatic tolerance. The table supports all indexes of the source drawing. The overlay is performed in the coordinate system of the source drawing; objects in the overlay drawing are automatically converted to that coordinate system as necessary.   We can use the table created by this function as desired in subsequent operations, for example, creating a drawing via a query that uses aggregates.   See the SQL Example: GeomOverlayAdjacent Function topic for an example of how functions like this are used. GeomOverlayContainedPar(, , , ) : A parallel form of the GeomOverlayContained function that takes a parameter for the suggested number of threads as encoded in the JSON string as "threads".  If the number of threads is less than or equal to 1 the GeomOverlayContained function will be executed. Use ThreadConfig to generate a JSON string with the desired number of threads. GeomOverlayContainedFilter(, , ) : Takes a source drawing and an overlay drawing, finds all objects in the source drawing that are contained by any object in the overlay drawing, and filters the source drawing leaving only objects which are contained by at least one object in the overlay drawing. Unlike the result table of GeomOverlayContained, the result table of GeomOverlayContainedFilter includes all fields from the source drawing and no fields from the overlay drawing.   Result tables returned by GeomOverlayXxxFilter functions contain all indexes from the source table and are writable. It is possible to chain calls to these functions as well as calls to SelectionXxx functions.   Example: The following query returns all states touching selected parcels:   TABLE CALL GeomOverlayTouchingFilter(states,   CALL Selection(parcels, TRUE), 0); GeomOverlayContainedFilterPar(, , , ) : A parallel form of the GeomOverlayContainedFilter function that takes a parameter for the suggested number of threads as encoded in the JSON string as "threads".  If the number of threads is less than or equal to 1 the GeomOverlayContainedFilter function will be executed. Use ThreadConfig to generate a JSON string with the desired number of threads. GeomOverlayContaining(, , ) : Combines fields between a source drawing and an overlay drawing, finding cases where objects in the overlay are containing objects in the source.  Given a drawing and an overlay drawing, returns a table with the following characteristics:   Columns: The returned table will contain all fields from the source drawing and all fields from the overlay drawing.  Fields from the source drawing will have their names prefixed with s_ for source.  Fields from the overlay drawing will have their names prefixed with o_ for overlay.     Rows: Every object in the source drawing that is not contained by an object in the overlay drawing will appear as a row in the table with values for the o_ fields set to NULL.   Every object in the source drawing that is contained by one or more objects in the overlay drawing will appear in one or more rows in the table with values for the o_ fields populated from the corresponding object to which it is adjacent.   A tolerance of zero means automatic tolerance. The table supports all indexes of the source drawing. The overlay is performed in the coordinate system of the source drawing; objects in the overlay drawing are automatically converted to that coordinate system as necessary.   We can use the table created by this function as desired in subsequent operations, for example, creating a drawing via a query that uses aggregates.   See the SQL Example: GeomOverlayAdjacent Function topic for an example of how functions like this are used. GeomOverlayContainingPar(, , , ) : A parallel form of the GeomOverlayContaining function that takes a parameter for the suggested number of threads as encoded in the JSON string as "threads".  If the number of threads is less than or equal to 1 the GeomOverlayContaining function will be executed. Use ThreadConfig to generate a JSON string with the desired number of threads. GeomOverlayContainingFilter(, , ) : Takes a source drawing and an overlay drawing, finds all objects in the source drawing that contain any object in the overlay drawing, and filters the source drawing leaving only objects which contain at least one object in the overlay drawing. Unlike the result table of GeomOverlayContaining, the result table of GeomOverlayContainingFilter includes all fields from the source drawing and no fields from the overlay drawing.   Result tables returned by GeomOverlayXxxFilter functions contain all indexes from the source table and are writable. It is possible to chain calls to these functions as well as calls to SelectionXxx functions.   Example: The following query returns all states touching selected parcels:   TABLE CALL GeomOverlayTouchingFilter(states,   CALL Selection(parcels, TRUE), 0); GeomOverlayContainingFilterPar(, , , ) : A parallel form of the GeomOverlayContainingFilter function that takes a parameter for the suggested number of threads as encoded in the JSON string as "threads".  If the number of threads is less than or equal to 1 the GeomOverlayContainingFilter function will be executed. Use ThreadConfig to generate a JSON string with the desired number of threads. GeomOverlayIntersecting(, , ) : Combines fields between a source drawing and an overlay drawing, finding cases where objects in the overlay are intersecting objects in the source.  Given a drawing and an overlay drawing, returns a table with the following characteristics:   Columns: The returned table will contain all fields from the source drawing and all fields from the overlay drawing.  Fields from the source drawing will have their names prefixed with s_ for source.  Fields from the overlay drawing will have their names prefixed with o_ for overlay.     Rows: Every object in the source drawing that is not intersected by an object in the overlay drawing will appear as a row in the table with values for the o_ fields set to NULL.   Every object in the source drawing that is intersected by one or more objects in the overlay drawing will appear in one or more rows in the table with values for the o_ fields populated from the corresponding object to which it is adjacent.   A tolerance of zero means automatic tolerance. The table supports all indexes of the source drawing. The overlay is performed in the coordinate system of the source drawing; objects in the overlay drawing are automatically converted to that coordinate system as necessary.   We can use the table created by this function as desired in subsequent operations, for example, creating a drawing via a query that uses aggregates.   See the SQL Example: GeomOverlayAdjacent Function topic for an example of how functions like this are used. GeomOverlayIntersectingPar(, , , ) : A parallel form of the GeomOverlayIntersecting function that takes a parameter for the suggested number of threads as encoded in the JSON string as "threads".  If the number of threads is less than or equal to 1 the GeomOverlayIntersecting function will be executed.  Use ThreadConfig to generate a JSON string with the desired number of threads. GeomOverlayIntersectingFilter(, , ) : Takes a source drawing and an overlay drawing, finds all objects in the source drawing that intersect any object in the overlay drawing, and filters the source drawing leaving only objects which intersect at least one object in the overlay drawing. Unlike the result table of GeomOverlayIntersecting, the result table of GeomOverlayIntersectingFilter includes all fields from the source drawing and no fields from the overlay drawing.   Result tables returned by GeomOverlayXxxFilter functions contain all indexes from the source table and are writable. It is possible to chain calls to these functions as well as calls to SelectionXxx functions.   Example: The following query returns all states touching selected parcels:   TABLE CALL GeomOverlayTouchingFilter(states,   CALL Selection(parcels, TRUE), 0); GeomOverlayIntersectingFilterPar(, , , ) : A parallel form of the GeomOverlayIntersectingFilter function that takes a parameter for the suggested number of threads as encoded in the JSON string as "threads".  If the number of threads is less than or equal to 1 the GeomOverlayIntersectingFilter function will be executed. Use ThreadConfig to generate a JSON string with the desired number of threads. GeomOverlayTopologyIdentity(, , ) : Using the area boundaries of objects in the overlay drawing, slice all objects in the source drawing into regions that are overlapped by objects in the overlay drawing and that are not overlapped by objects in the overlay drawing.  Save all the pieces thus created as geoms into the result table.  Given a drawing and an overlay drawing, returns a table with the following characteristics:   Columns: The returned table will contain all fields from the source drawing and all fields from the overlay drawing.  Fields from the source drawing will have their names prefixed with s_ for source.  Fields from the overlay drawing will have their names prefixed with o_ for overlay.     Rows for non-intersecting objects: Every region of an object in the source drawing that is not intersected by an object in the overlay drawing will appear as a row in the table with values for the o_ fields set to NULL.     Rows for intersecting objects: Every region of an object in the source drawing that is intersected by one or more objects in the overlay drawing will appear as a single row in the table with s_ fields and o_ fields populated by the respective objects from the source and overlay drawings that intersected.   If the overlay drawing is empty (contains no objects), the result will be composed from only the source drawing.   A tolerance of zero means automatic tolerance. The table supports all indexes of the source drawing. The overlay is performed in the coordinate system of the source drawing; objects in the overlay drawing are automatically converted to that coordinate system as necessary.   We can use the table created by this function as desired in subsequent operations, for example, creating a drawing via a query that uses aggregates.   See the SQL Example: GeomOverlayTopologyUnion Function topic for an example of how functions like this are used. GeomOverlayTopologyIdentityPar(, , , ) : A parallel form of the GeomOverlayTopologyIdentity function that takes a parameter for the suggested number of threads as encoded in the JSON string as "threads".  If the number of threads is less than or equal to 1 the GeomOverlayTopologyIdentity function will be executed. Use ThreadConfig to generate a JSON string with the desired number of threads. GeomOverlayTopologyIntersect(, , ) : Locate regions of intersection and save them into the results table.  Slices all objects in each drawing with the area boundaries of objects in the other drawing and then places geoms for all regions of intersection, discarding duplicates, into the result table.   Given a drawing and an overlay drawing, returns a table with the following characteristics:   Columns: The returned table will contain all fields from the source drawing and all fields from the overlay drawing.  Fields from the source drawing will have their names prefixed with s_ for source.  Fields from the overlay drawing will have their names prefixed with o_ for overlay.     Rows:  Each region of intersection will appear as a row in the table with s_ fields and o_ fields populated by the respective objects from the source and overlay drawings that intersected.   A tolerance of zero means automatic tolerance. The table supports all indexes of the source drawing. The overlay is performed in the coordinate system of the source drawing; objects in the overlay drawing are automatically converted to that coordinate system as necessary.   We can use the table created by this function as desired in subsequent operations, for example, creating a drawing via a query that uses aggregates.     See the SQL Example: GeomOverlayTopologyUnion Function topic for an example of how functions like this are used. GeomOverlayTopologyIntersectPar(, , , ) : A parallel form of the GeomOverlayTopologyIntersect function that takes a parameter for the suggested number of threads as encoded in the JSON string as "threads".  If the number of threads is less than or equal to 1 the GeomOverlayTopologyIntersect function will be executed. Use ThreadConfig to generate a JSON string with the desired number of threads. GeomOverlayTopologyUnion(, , ) : Slices all objects in each drawing with the area boundaries of objects in the other drawing and then places geoms for all pieces, discarding duplicates, into the result table.  Given a drawing and an overlay drawing, returns a table with the following characteristics:   Columns: The returned table will contain all fields from the source drawing and all fields from the overlay drawing.  Fields from the source drawing will have their names prefixed with s_ for source.  Fields from the overlay drawing will have their names prefixed with o_ for overlay.     Rows for non-intersecting objects: Every object in the source drawing that is not intersected by an object in the overlay drawing will appear as a row in the table with values for the o_ fields set to NULL.  Every object in the overlay drawing that is not intersected by an object in the source drawing will appear as a row in the table with values for the s_ fields set to NULL.      Rows for intersecting objects: Every object in the source drawing that is intersected by one or more objects in the overlay drawing will appear as a single row in the table with values for the o_ fields set to NULL but will have the geom altered to remove all regions of intersection from the object.  Each region of intersection will appear as a row in the table with s_ fields and o_ fields populated by the respective objects from the source and overlay drawings that intersected.   If either the source drawing or the overlay drawing is empty (contains no objects), the result will be composed from only the other drawing.   A tolerance of zero means automatic tolerance. The table supports all indexes of the source drawing. The overlay is performed in the coordinate system of the source drawing; objects in the overlay drawing are automatically converted to that coordinate system as necessary.   We can use the table created by this function as desired in subsequent operations, for example, creating a drawing via a query that uses aggregates.   See the SQL Example: GeomOverlayTopologyUnion Function topic for an example of how functions like this are used. GeomOverlayTopologyUnionPar(, , , ) : A parallel form of the GeomOverlayTopologyUnion function that takes a parameter for the suggested number of threads as encoded in the JSON string as "threads".  If the number of threads is less than or equal to 1 the GeomOverlayTopologyUnion function will be executed. Use ThreadConfig to generate a JSON string with the desired number of threads. GeomOverlayTopologyUpdate(, , ) : Keep all objects in the overlay drawing.  In the source drawing cut out and discard any portions of objects in the source drawing that intersect with objects in the overlay drawing and leave the remaining portions.  Place geoms for all objects in the overlay drawing plus non-intersecting portions of objects in the source drawing into the result table.  Given a drawing and an overlay drawing, returns a table with the following characteristics:   Columns: The returned table will contain all fields from the source drawing and all fields from the overlay drawing.  Fields from the source drawing will have their names prefixed with s_ for source.  Fields from the overlay drawing will have their names prefixed with o_ for overlay.     Rows for non-intersecting objects: Every object in the overlay drawing will appear as a row in the table with values for the s_ fields set to NULL.   Every object in the source drawing that is not intersected by an object in the overlay drawing will appear as a row in the table with values for the o_ fields set to NULL.     Rows for intersecting objects: Every object in the source drawing that is intersected by one or more objects in the overlay drawing will appear as a single row in the table with values for the o_ fields set to NULL but will have the geom altered to remove all regions of intersection from the object.   If either the source drawing or the overlay drawing is empty (contains no objects), the result will be composed from only the other drawing.   A tolerance of zero means automatic tolerance. The table supports all indexes of the source drawing. The overlay is performed in the coordinate system of the source drawing; objects in the overlay drawing are automatically converted to that coordinate system as necessary.   We can use the table created by this function as desired in subsequent operations, for example, creating a drawing via a query that uses aggregates.   See the SQL Example: GeomOverlayTopologyUnion Function topic for an example of how functions like this are used. GeomOverlayTopologyUpdatePar(, , , ) : A parallel form of the GeomOverlayTopologyUpdate function that takes a parameter for the suggested number of threads as encoded in the JSON string as "threads".  If the number of threads is less than or equal to 1 the GeomOverlayTopologyUpdate function will be executed. Use ThreadConfig to generate a JSON string with the desired number of threads. GeomOverlayTouching(, , ) : Combines fields between a source drawing and an overlay drawing, finding cases where objects in the overlay are touching objects in the source.  Given a drawing and an overlay drawing, returns a table with the following characteristics:   Columns: The returned table will contain all fields from the source drawing and all fields from the overlay drawing.  Fields from the source drawing will have their names prefixed with s_ for source.  Fields from the overlay drawing will have their names prefixed with o_ for overlay.     Rows: Every object in the source drawing that is not touched by an object in the overlay drawing will appear as a row in the table with values for the o_ fields set to NULL.   Every object in the source drawing that is touched by one or more objects in the overlay drawing will appear in one or more rows in the table with values for the o_ fields populated from the corresponding object to which it is adjacent.   A tolerance of zero means automatic tolerance. The table supports all indexes of the source drawing. The overlay is performed in the coordinate system of the source drawing; objects in the overlay drawing are automatically converted to that coordinate system as necessary.   We can use the table created by this function as desired in subsequent operations, for example, creating a drawing via a query that uses aggregates.   See the SQL Example: GeomOverlayAdjacent Function topic for an example of how functions like this are used. GeomOverlayTouchingPar(, , , ) : A parallel form of the GeomOverlayTouching function that takes a parameter for the suggested number of threads as encoded in the JSON string as "threads".  If the number of threads is less than or equal to 1 the GeomOverlayTouching function will be executed. Use ThreadConfig to generate a JSON string with the desired number of threads. GeomOverlayTouchingFilter(, , ) : Takes a source drawing and an overlay drawing, finds all objects in the source drawing that touches any object in the overlay drawing, and filters the source drawing leaving only objects which touch at least one object in the overlay drawing. Unlike the result table of GeomOverlayTouching, the result table of GeomOverlayTouchingFilter includes all fields from the source drawing and no fields from the overlay drawing.   Result tables returned by GeomOverlayXxxFilter functions contain all indexes from the source table and are writable. It is possible to chain calls to these functions as well as calls to SelectionXxx functions.   Example: The following query returns all states touching selected parcels:   TABLE CALL GeomOverlayTouchingFilter(states,   CALL Selection(parcels, TRUE), 0); GeomOverlayTouchingFilterPar(, , , ) : A parallel form of the GeomOverlayTouchingFilter function that takes a parameter for the suggested number of threads as encoded in the JSON string as "threads".  If the number of threads is less than or equal to 1 the GeomOverlayTouchingFilter function will be executed. Use ThreadConfig to generate a JSON string with the desired number of threads.   Example: The following query returns all states touching selected parcels, using all available threads:   TABLE CALL GeomOverlayTouchingFilterPar(states,   CALL Selection(parcels, TRUE), 0, ThreadConfig(SystemCpuCount())); GeomOverlayWithin(, , , ): Given a source drawing,  an overlay drawing, and a distance using the unit of measure for the coordinate system of the source drawing, return all pairs of geoms in the source drawing and the overlay drawing that are within the specified distance.  A tolerance of zero means automatic tolerance.   Distances are computed for area and line objects as the distance to the closest part of the object.   Contents of the results table:   Columns: The returned table will contain all fields from the source drawing and all fields from the overlay drawing.  Fields from the source drawing will have their names prefixed with s_ for source.  Fields from the overlay drawing will have their names prefixed with o_ for overlay.     Rows: Every object in the source drawing that does not have any objects in the overlay drawing within the specified distance will appear as a row in the table with values for the o_ fields set to NULL.   Every object in the source drawing that does have one or more objects in the overlay drawing within the specified distance will appear in one or more rows in the table with values for the o_ fields populated from the corresponding object within the specified distance.   Example: Given two drawings, a drawing of airports as points using Pseudo-Mercator projection (units of measure are meters) and a drawing of cities as points, the following query returns a table where each row is an airport and a city within 150 kilometers of that airport.  Airports that have no city within 150 kilometers will appear in the table with NULL values for the overlay fields.   TABLE CALL GeomOverlayWithin([Airports], [Cities], 150000, 0);   Example:  Return all airports with selected cities within 150 kilometers.  This is a way of finding which airports are within 150 km of selected cities.   Airports that have no selected city within 150 kilometers will appear in the table with NULL values for the overlay fields.   TABLE CALL GeomOverlayWithin([Airports],   CALL Selection([Cities], TRUE), 150000, 0);   Example:  Given two drawings, a drawing of airports as points using Pseudo-Mercator projection (units of measure are meters) and a drawing of provinces as polygonal areas,  the following query returns a table where each row is an airport and a province where the closest part of the province is within 150 kilometers of that airport.  Airports that have no part of any province within 150 kilometers will appear in the table with NULL values for the overlay fields.   TABLE CALL GeomOverlayWithin([Airports], [Provinces], 150000, 0);   Example: As above, but for selected provinces.     TABLE CALL GeomOverlayWithin([Airports],   CALL Selection([Provinces], TRUE), 150000, 0); GeomOverlayWithinPar(, , , , ): A parallel form of the GeomOverlayWithin function that takes a parameter for the suggested number of threads as encoded in the JSON string as "threads".  If the number of threads is less than or equal to 1 the GeomOverlayWithin function will be executed. Use ThreadConfig to generate a JSON string with the desired number of threads.   Example:  Return all pairs of airports and cities within 150 km, using all available threads:   TABLE CALL GeomOverlayWithin([Airports],   [Cities], 150000, 0, ThreadConfig(SystemCpuCount()));   Example:  Return all airports with selected cities within 150 kilometers, using all available threads:     TABLE CALL GeomOverlayWithinPar([Airports],   CALL Selection([Cities], TRUE), 150000, 0, ThreadConfig(SystemCpuCount())); GeomOverlayWithinFilter(, , , ): Given a source drawing,  an overlay drawing, and a distance using the unit of measure for the coordinate system of the source drawing, return all geoms in the source drawing for which there is at least one geom within the specified distance in the overlay drawing..  A tolerance of zero means automatic tolerance.   Distances are computed for area and line objects as the distance to the closest part of the object.   Contents of the results table:   Columns: The returned table will contain all fields from the source drawing and no fields from the overlay drawing.  Fields from the source drawing will have the same names as in the source table.   Rows: Only those objects in the source drawing that do have one or more objects in the overlay drawing within the specified distance will appear in the result table, each such object appearing in a single row.   Example: Given two drawings, a drawing of airports as points using Pseudo-Mercator projection (units of measure are meters) and a drawing of cities as points, the following query returns a table where each row is an airport that has one or more cities within 150 kilometers of that airport.  Airports that have no city within 150 kilometers will not appear in the table   TABLE CALL GeomOverlayWithinFilter([Airports], [Cities], 150000, 0);   Example:  Return all airports that have a selected city within 150 kilometers.  This is a way of finding which airports are within 150 km of selected cities.   Airports that have no selected city within 150 kilometers will not appear in the table.   TABLE CALL GeomOverlayWithinFilter([Airports],   CALL Selection([Cities], TRUE), 150000, 0); GeomOverlayWithinFilterPar(, , , , ): A parallel form of the GeomOverlayWithinFilter function that takes a parameter for the suggested number of threads as encoded in the JSON string as "threads".  If the number of threads is less than or equal to 1 the GeomOverlayWithinFilter function will be executed. Use ThreadConfig to generate a JSON string with the desired number of threads.   Example:  Return all airports with one or more cities within 150 km, using all available threads:   TABLE CALL GeomOverlayWithinFilter([Airports],   [Cities], 150000, 0, ThreadConfig(SystemCpuCount()));   Example:  Return all airports with one or more selected cities within 150 kilometers, using all available threads:     TABLE CALL GeomOverlayWithinFilterPar([Airports],   CALL Selection([Cities], TRUE), 150000, 0, ThreadConfig(SystemCpuCount())); GeomPartLine(, , ): Given a geom that is a line, and beginning and end distances, return a line that is the part of the line between the two specified distances. If the begin distance is larger than the end distance, the returned line goes in the direction opposite to the original line. GeomRemoveCurves() : Returns a geom where each curved segment of an area or line object in the source geom has been replaced with a single straight segment.   Geoms without curved segments are unchanged. GeomRemoveZ() : Takes a geom and returns the same geom without Z values. Geoms without Z values are left unchanged. For geoms with Z values curves are replaced with straight line segments, because 3D curves can not be used with a 2D geom.   To test if a geom has a Z value, use GeomHasZ. To set the Z values for all coordinates of a geom to a specified value, use GeomSetZ.    To read the Z value of the first coordinate of a geom, use    VectorValue(GeomCoordXYZ([Geom],0),2) GeomReverseLine(): Takes a geom for a line and reverses the order of coordinates defining the line.  Preserves curvilinear segments and Z values. GeomRotate(, , ) : Takes a geom, a rotation center as an x2 vector value, a rotation angle in degrees, and returns a rotated geom. The rotation direction is counterclockwise. Z values are preserved but curves are replaced with straight line segments. GeomScale(, ): A version of GeomScaleShift with shift set to 0 for both X and Y.  Takes a geom, an x2 vector for scale values in X and Y direction, and returns a geom with no shift and with those scale values applied.   Z values are preserved and 2D curvilinear segments are preserved, but 3D curvilinear segments  are replaced with 3D straight line segments.   Caveat: attempting to apply uneven XY scales to a circular arc will currently not convert it to an ellipse arc, and will instead compose a new circular arc that passes through the scaled ends and the scaled control point. Future builds will address that with a slight rework of curves in geoms. GeomScaleCentered(, , ) : Takes a geom, an x2 vector for scale factor values in X and Y direction, an x2 vector for  X and Y location of a center in the units of the coordinate system used, and returns a geom with the scale applied around the specified center location.   Z values are preserved and 2D curvilinear segments are preserved, but 3D curvilinear segments  are replaced with 3D straight line segments.   Caveat: attempting to apply uneven XY scales to a circular arc will currently not convert it to an ellipse arc, and will instead compose a new circular arc that passes through the scaled ends and the scaled control point. Future builds will address that with a slight rework of curves in geoms. GeomScaleRev(, ): An inverse version of GeomScale.  A version of GeomScaleShift with shift set to 0 for both X and Y.  Takes a geom, an x2 vector for scale values in X and Y direction, and returns a geom with no shift and with those scale values applied as 1/scale.  Unscales back to the original scale a geom that previously was rescaled using  GeomScale.  Z values are preserved and 2D curvilinear segments are preserved, but 3D curvilinear segments  are replaced with 3D straight line segments.   Caveat: attempting to apply uneven XY scales to a circular arc will currently not convert it to an ellipse arc, and will instead compose a new circular arc that passes through the scaled ends and the scaled control point. Future builds will address that with a slight rework of curves in geoms. GeomScaleShift(, , ) : Takes a geom, an x2 vector for scale factor values in X and Y direction, an x2 vector for shift values in X and Y direction in the units of the coordinate system used, and returns a geom with those scale and shift values applied.   Z values are preserved and 2D curvilinear segments are preserved, but 3D curvilinear segments  are replaced with 3D straight line segments.   Caveat: attempting to apply uneven XY scales to a circular arc will currently not convert it to an ellipse arc, and will instead compose a new circular arc that passes through the scaled ends and the scaled control point. Future builds will address that with a slight rework of curves in geoms. GeomScaleShiftZ(, , ) : Takes a geom, a scale factor value in Z direction, a shift value in Z direction in the units of the coordinate system used, and returns a geom with those scale and shift values applied to the Z values. Geoms with no Z values are left unchanged.   3D curvilinear segments  are replaced with 3D straight line segments. GeomSegmentize(, ) : Takes a geom and a length value and returns a geom where each segment is split to parts which are the same length or shorter than the specified length. Point geoms are left unchanged.   Z values are preserved, but curvilinear segments are replaced with straight line segments. GeomSetZ(, ) : Takes a geom and a Z value, and returns the same geom with Z values for all coordinates set to the specified value. Curves are replaced with straight line segments.   To test if a geom has a Z value, use GeomHasZ.   To remove all Z values, use GeomRemoveZ.  To read the Z value of the first coordinate of a geom, use   VectorValue(GeomCoordXYZ([Geom],0),2) GeomShift(, ): A version of GeomScaleShift with scale set to 1 for both X and Y.  Takes a geom, an x2 vector for shift values in X and Y direction in the units of the coordinate system used, and returns a geom at the same scale with those shift values applied.  Z values are preserved and 2D curvilinear segments are preserved, but 3D curvilinear segments  are replaced with 3D straight line segments. GeomSmooth(, ) : Takes a geom and a length value and returns a geom that removes detail shorter than the specified length by reducing the number of coordinates. Point geoms are left unchanged. Z values are eliminated. Curvilinear are replaced with straight line segments. GeomSnapToGrid(, ) : Takes a geom and  an x2 vector for distance values in X and Y direction and returns a geom with coordinates rounded to a rectangular grid with the specified steps. Curvilinear segments are replaced with straight line segments.  Any coordinates that end up the same are collapsed together. GeomToConvex(, ) : Takes an area geom and decomposes it into convex parts. A tolerance of zero means automatic tolerance. GeomToConvexPar(, , ) : A parallel form of the GeomToConvex function that takes a parameter for the suggested number of threads as encoded in the JSON string as "threads".  If the number of threads is less than or equal to 1 the GeomToConvex function will be executed.  Use ThreadConfig to generate a JSON string with the desired number of threads. GeomToBranches() : Convert branched objects into a table of branches. Takes a geom and returns a table where each record contains a row for each branch of the object in the geom, with fields as follows:   Branch - index of the branch Value - geom for that branch.   Example:   SELECT * FROM (     SELECT SPLIT       CALL GeomToBranches([Geom])     FROM [Table]); GeomToCoords() : Converts objects into their coordinates. Takes a geom and returns a table where each record contains a row for each coordinate of the object in the geom, with fields as follows:     Branch - index of current branch. Coord - index of current coordinate from the beginning of geom. CoordInBranch - index of current coordinate within current branch. XY - X, Y coordinates as a float64x2 vector. XYZ - X, Y, Z coordinates as a float64x3 vector (NULL if there is no Z).   Example:   SELECT * FROM (     SELECT SPLIT       CALL GeomToCoords([Geom])     FROM [Table]); GeomToCoordsLineSequence(, , , ): Given a geom, beginning and end distances and step (similar to ValueSequence), returns a sequence of coordinates at the specified distances on the line.  The step can be positive or negative. For example, using begin = 0, end = 5, and step = 1, the function will return coordinates at 0, 1, 2, 3, 4, 5.  Using begin = 5, end = 0, and step = -1, the function will return coordinates at 5, 4, 3, 2, 1, 0.  Either begin or end can be outside of the line. For example,  using begin = -2, end = 50, and step = 10, the function will return coordinates at 8, 18, 28, 38, 48.  The coordinates are returned as a table with two fields: distance from the start (Value) and coordinate (XY). GeomToParts(, , ): Given a geom and geom that is an area or line, split the geom into parts using the geom.   Zero for a tolerance value is automatic tilerance.  Use the Edit Query button with the Split : parts transform operation for examples of use. GeomToPartsLineSequence(, , , ): Given a geom, beginning and end distances and step (similar to ValueSequence), returns a sequence of line objects between the specified distances on the line, in effect, splitting the line into parts between specified distances. If the begin distance is larger than the end distance, the returned parts go in the direction opposite to that of the line. The result table includes minimum and maximum distance for each part.   Example - Split lines into parts every 100 units long starting at the beginning of each line and going out to a distance of 900 units in each line:   SELECT * FROM (   SELECT SPLIT     CALL GeomToPartsLineSequence([Geom], 0, 900, 100)   FROM [Objects]); GeomToSegments() : Converts objects into their segments. Takes a geom and returns a table where each record contains a row for each segment of the object in the geom, with fields as follows:   Branch - index of current branch. Coord - index of starting coordinate of the segment from the beginning of geom. CoordInBranch - index of starting coordinate of the segmment within current branch. XY - starting coordinate value of the segment in X, Y coordinates as a float64x2 vector. XYNext - ending coordinate value of the segment in X, Y coordinates as a float64x2 vector.   XYZ - starting coordinate value of the segment in X, Y, Z coordinates as a float64x3 vector  (NULL if there is no Z).   XYZNext - ending coordinate value of the segment in X, Y, Z coordinates as a float64x3 vector  (NULL if there is no Z). Type - segment type: 0 = straight line segment, 1 = circular arc, 2 = ellipsoidal arc, 3 = non-uniform b-spline.   Example:   SELECT * FROM (     SELECT SPLIT       CALL GeomToCoords([Geom])     FROM [Table]); GeomToShapes() : A shape is a branch of an area that forms an island.  It is also referred to as an individual polygon within a multipolygon object. This function splits area objects into their constituent shapes using OGC rules for doing so.  Use GeomToShapesEsri to split an area into shapes using ESRI rules.  Takes a geom and returns a table where each record contains a row for each shape, with fields as follows:   Shape - index of the shape within the original multipolygon.   Branch - index of the original starting branch for this shape. BranchCount - number of branches in this shape. Value - the geom.   Points and lines are unchanged except that any curved segments in lines are replaced by straight segments.    The function retains Z values if an area has Z values.   Consider a table that has one object, a branched area that has islands as seen in the drawing below. That area overall has five branches which make up three shapes.   Three of those branches are used to create the larger shape (one branch for the outer boundary and two branches for the inner holes) and two of the branches are used to create the islands.   SELECT * INTO [Shapes Table]   FROM (     SELECT SPLIT       CALL GeomToShapes([Geom])     FROM [Drawing Table]);   We can run the query above to use the GeomToShapes function to decompose the single area into three objects, one for each constituent shape. The resulting table contains three rows, one for each of the objects that was created by splitting the original area into its constituent three shapes.   The first row is for the larger shape that has two holes.   It is the first shape so the Shape value is 0.   Branch is also 0 because this shape was started by the first branch in the original area.    BranchCount is 3 because this shape contains three branches, one branch for the outer boundary and two branches for the inner holes.   Shape number 1, the second shape, was Branch number 3 of the original area.  The BranchCount value for this shape is 1 because this shape contains only one branch.   Shape number 2, the third shape, was Branch number 4 of the original area.  The BranchCount value for this shape also is 1 because this shape contains only one branch. We can add an index to the Shapes Table, to make the table selectable, and then create a drawing from the table.  We open the drawing above.  It looks like the original, except it now shows three objects instead of just one.  We Ctrl-click the middle object to select it. We can see in the drawing's table that Shape number 1, as expected, is the object selected. GeomToShapesEsri() : Exactly like GeomToShapes  except that it decomposes geoms into shapes based on ESRI rules. The function retains Z values if an area has Z values. To decompose geoms into shapes using OGC rules use GeomToShapes. GeomTouches(, , ) : Given two geoms returns true if they touch. A tolerance of zero means automatic tolerance.   For the definition of touch see the Join topic. GeomTriangulate(, ) : Triangulates objects.  Given lines, areas or multipoints, performs a Delaunay triangulation of the geom coordinates of an object to create triangles as area objects.   The borders of the triangles will be constrained by geom segments, that is, they will not cross segments within the geom. GeomTriangulatePar(, . ) : A parallel form of the GeomTriangulate function that takes a parameter for the suggested number of threads as encoded in the JSON string as "threads" and the minimum number of coordinates to allocate for a thread as "batch."  The threads default is 1 and the batch default is 1000. Use ThreadConfig to generate a JSON string with the desired number of threads to see how values such as "threads" and "batch" are encoded in the JSON string used for the value. GeomTriangulateLines(, ) : Triangulates objects.  Given lines, areas or multipoints, performs a Delaunay triangulation of the geom coordinates of an object to create triangles as line objects.   The borders of the triangles will be constrained by geom segments, that is, they will not cross segments within the geom. GeomTriangulateLinesPar(, , ) : A parallel form of the GeomTriangulateLines function that takes a parameter for the suggested number of threads as encoded in the JSON string as "threads" and the minimum number of coordinates to allocate for a thread as "batch."  The threads default is 1 and the batch default is 1000.  Use ThreadConfig to generate a JSON string with the desired number of threads to see how values such as "threads" and "batch" are encoded in the JSON string used for the value. GeomType() : Returns the object type of a geom as a number:   3 - area ; 2 - line; 1 - point GeomVoronoi(, , ) : Given a set of points create a Voronoi diagram and return a geom with the Voronoi cells as area objects.  A tolerance of zero means automatic tolerance.    The x2 value for margin gives the X, Y factors by which to increase the bounding box used for clipping infinite regions. GeomVoronoiPar(, , , ) : A parallel form of the GeomVoronoi function that takes a parameter for the suggested number of threads as encoded in the JSON string as "threads" and the minimum number of coordinates to allocate for a thread as "batch."  The threads default is 1 and the batch default is 1000.  Use ThreadConfig to generate a JSON string with the desired number of threads to see how values such as "threads" and "batch" are encoded in the JSON string used for the value. GeomVoronoiLines(, , ) : Given a set of points create a Voronoi diagram and return a geom with the borders of Voronoi cells as line objects.  A tolerance of zero means automatic tolerance.    The x2 value for margin gives the X, Y factors by which to increase the bounding box used for clipping infinite regions. GeomVoronoiLinesPar(, , , ) : A parallel form of the GeomVoronoiLines function that takes a parameter for the suggested number of threads as encoded in the JSON string as "threads" and the minimum number of coordinates to allocate for a thread as "batch."  The threads default is 1 and the batch default is 1000.  Use ThreadConfig to generate a JSON string with the desired number of threads to see how values such as "threads" and "batch" are encoded in the JSON string used for the value. GeomVoronoiPoints(, , ) : Given a set of points create a Voronoi diagram and return a geom with points at the intersections of borders of Voronoi cells as line objects.  A tolerance of zero means automatic tolerance.    The x2 value for margin gives the X, Y factors by which to increase the bounding box used for clipping infinite regions. GeomVoronoiPointsPar(, , , ) : A parallel form of the GeomVoronoiPoints function that takes a parameter for the suggested number of threads as encoded in the JSON string as "threads" and the minimum number of coordinates to allocate for a thread as "batch."  The threads default is 1 and the batch default is 1000.  Use ThreadConfig to generate a JSON string with the desired number of threads to see how values such as "threads" and "batch" are encoded in the JSON string used for the value. GeomWithin(, , , ) : Given two geoms and a distance value returns True if the geoms are closer to each other than the specified distance.  A tolerance of zero means automatic tolerance. GeomWkb() : Provides a way to extract geometry from a Manifold geometry type, a geom, into a well known binary representation of the geometry, WKB.  Given a geom return a WKB binary representation for that object's geometry. GeomWkt() : Provides a way to extract geometry from a Manifold geometry type, a geom, into a well known binary representation of the geometry, WKT.  Given a geom return a WKT text representation for that object's geometry.

## Merge Compared to Union

Merge and Union operations are similar in that they combine objects.  The difference is that Merge simply combines coordinate lists as if each object combined is a new branch while Union utilizes the spatial implications of inside/outside the objects had before being merged.   This can be most clearly seen when areas are combined using Merge or Union.   Consider two overlapping area objects, as seen in the left-most illustration above.   A Merge operation simply combines the coordinate lists of the two objects as two branches.   The coordinate list of the second object treated as a branch results in a "hole" in the region of overlap with a touching "island" where the second branch does not overlap the first branch.   This is a consequence of how coordinate lists are used to define branched area objects.

A Union operation considers both original area objects in terms of the spatial definition of what is considered to be "inside" the original area boundary.  That "inside" is retained as if both areas were metal cutouts where the region of overlap between the metal cutouts is welded together in the region of overlap, to form a single "inside" within the new, combined cutout.  Branches are used in Union where area objects do not touch or overlap, so show such a combined, area object as having "islands."

## Notes

New functions - The list in this topic is intended to be comprehensive but might be not up to date.  New items are often added with updates to Manifold and may appear in the product before they appear in this documentation.   See the list in the query builder tab of the Command Window for an authoritative list of operators, commands and functions.

Normalization - GeomMakeRect is happy to accept the x1,y1 and x2, y2 in non-normalized order, that is, it doesn't matter to the function if we give it the lower left corner followed by the upper right corner so that x1 is less than x2 and y1 is less than y2.   But when GeomBox reports the x4 value for a bounding box it always reports the x4 value in a standard way, in normalized form so that x1 is less than or equal to x2 and y1 is less than or equal to y2.

GeomClip - If two geoms touch, their intersection is mathematically non-empty, but might have a lower dimension than the geoms and so be empty in terms of geom type; however, GeomClip must return a geom of the same type as its first argument. For example, two areas that share a corner touch, but intersecting them produces a point, which is not a valid area, and so GeomClip for that case will return NULL.

GPGPU - Manifold automatically uses GPU parallelism (see the GPGPU topic) in functions where it makes sense to do so and when workflow is such that it is worth it to dispatch to GPU instead of simply using CPU parallelism.  In many cases both CPU parallelism and GPU parallelism will be used.  For example, all Kriging implementations (standard, median polish, and regression Kriging) use GPU, if available, to compute model parameters together with CPU parallelism in other parts of the function's operation.  GPU cards are so cheap that it doesn't make sense to try to guess when it pays to use GPGPU: simply install a GPU card, at least a cheapo GPU card.  Always.  Do not overthink it.  Just install an NVIDIA GPU card.

Why a GPU parallelism limit to radius/border of 8 or less? - Filter functions using a <radius> argument to set the size of the filter matrix applied typically are limited to a radius of 8 or less for GPGPU parallelism, switching to CPU parallelism at a radius of 9 or greater.   Calls to tile functions which use borders of 9 or more pixels likewise automatically dispatch to CPU parallelism.  In both cases, calls dispatched to CPU parallelism can freely intermix with calls dispatched to GPU parallelism.

Those limitations allows more flexible use of a greater range of GPU cards.  Some cards, perhaps older cards or lower cost cards, may have limited memory or earlier generation GPU chips, but they nonetheless can provide very many cores for GPGPU parallel computation.  Manifold makes it possible to use such cards effectively for GPGPU parallelism.

A radius of 8 implies a 17x17, 289-cell matrix, an absurdly huge and almost always an excessively large choice for matrix size.  A radius of 9 or above may indicate a conceptual error or workflow error.   At the same time, use of a radius of 9 or above requires so much GPU-accessible memory that such tasks fit into fewer and fewer cards, even if performance-reducing methods are adopted.   Given a choice between assuring a wide range of GPU cards will always work well, or restricting GPU choice to allow practices that are probably wrong in any event, Manifold chooses to support a wider range of GPU cards, placing the current switch to CPU parallelism at a radius or border of 9.  That may change as CUDA editions evolve.

Z values - All functions support Z values.

M values - Functions creating geoms from other formats tolerate M values in formats that have them but ignore those M values, discarding them.

Curvilinear objects -  Functions for GML, WKB and WKT conversions support curvilinear objects for all types supported by each format:  circular arcs, ellipsoidal arcs, splines for GML and circular arcs for WKB and WKT.  Geom functions in general first convert any curvilinear segments to straight segments, which can create 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.

Division by zero - returns NULL.

All types of values - Operators and functions generally  support all types of values so that, for example, we can use comparison or boolean operators on tiles and not just on scalar values.

Everything Math - For a handy reference to anything in mathematics, see the Wolfram MathWorld site.   Thank you, Wolfram!

Tables

Add an Index to a Table

Functions

Queries

Regular Expressions

How Matrix Filters Work

Command Window

Command Window - Query Builder

Identifiers, Constants and Literals

SQL Statements

SQL Operators

SQL Functions

Aggregate SQL Functions

Coord SQL Functions

String SQL Functions

Tile SQL Functions

Other SQL Functions

Temporary Databases

EXECUTE

Example: Create and Run a Query -  See how the different parts of a command window operate when creating and running SQL queries.   Includes use of the Log tab as well as the ?expression and !fullfetch commands.

Example: Transfer DEM Terrain Heights to Areas in a Drawing - Given a map with an image layer that shows terrain heights taken from a DEM, and a drawing layer that contains areas, using a small SQL query we transfer the average terrain height within each area to that area as a Height attribute for the area. Easy!

SQL Example: Process Images with 3x3 Filters -  Shows a step-by-step example of developing an SQL query that takes a query written by the Edit Query button and then modifies that query into a general purpose query that can apply any 3x3 filter.   This makes it easy to use matrix filters we find on the web for custom image processing.   We extend the query by using parameters and adding a function, and then show how it can be adapted to use a 5x5 filter.

SQL Example: Process Images using Dual 3x3 Filters  - A continuation of the above topic, extending the example query to utilize two filters for processing, as commonly done with Sobel and Prewitt two filter processing.

SQL Example: Process RGB Images using Matrix Filters - A continuation of the above two topics, extending the example query to process three channel, RGB images.

SQL Example: Miscellaneous SQL Functions - A variety of small examples using SQL functions.

SQL Example: GeomOverlayAdjacent Function - Using the GeomOverlayAdjacent function, an example that shows how this function and similar functions such as GeomOverlayContained, GeomOverlayContaining, GeomOverlayIntersecting and GeomOverlayTouching operate.

SQL Example: GeomOverlayTopologyUnion Function - A continuation of the SQL Example: GeomOverlayAdjacent Function example, using the GeomOverlayTopologyUnion function, an example that shows how this function and similar functions such as GeomOverlayTopologyIdentity, GeomOverlayTopologyIntersect and GeomOverlayTopologyUpdate operate.

Example: Merge : areas (dissolve) - In this example we combine multiple area objects into a single area object by using the Merge template in the Transform pane, using the areas (dissolve) option.  A drawing of French regions shows some regions as more than one area.  We would like each region to be one area so the table of regions has one record per region.

SQL Example: Learn SQL from Edit Query - Merging Areas - We learn how to write an SQL query that does a Merge : area (dissolve) operation by cutting and pasting from what the Edit Query button automatically generates.

Example: Use a Transform Expression to Create Buffers in a Drawing - Use the Expression tab of the Transform pane to create three different sizes of buffers for different lines in a drawing and then automatically create a query which does the same thing.  Includes examples of using the Add Component button and also the Edit Query button.

Example: Clip Areas with a Transform Expression - Use the Expression tab of the Transform pane to clip areas in a drawing to fit within horizontal bounds.   Includes examples of using the Add Component button and also the Edit Query button.

Example: Transform Templates, Expressions and Queries - We learn to use a function by clicking on a template in the Transform pane, seeing what it does in a preview, looking at the query Manifold creates and then trying out the function in the Expression tab.

SQL Example: List Transformation Grids - In this example we use a few snippets of easy SQL to list NTv2 and NADCON transformation grids that are available within the grids.dat compressed collection of transformation grid files.   Grid transformation files can be used when creating custom base coordinate systems, for NADCON / HARN / HPGN and NTv2 high accuracy transformations that use grid files.