package
25.1.0+incompatible
Repository: https://github.com/cockroachdb/cockroach.git
Documentation: pkg.go.dev

# Functions

AddMeasure takes a LineString or MultiLineString and linearly interpolates measure values for each line.
AddPoint adds a point to a LineString at the given 0-based index.
Affine applies a 3D affine transformation onto the given geometry.
Angle calculates the clockwise angle between two vectors given by points p1,p2 and p3,p4.
AngleLineString calculates the clockwise angle between two linestrings, treating them as vectors between the start- and endpoints.
Area returns the area of a given Geometry.
AsMVTGeometry returns a geometry converted into Mapbox Vector Tile coordinate space.
Azimuth returns the azimuth in radians of the segment defined by the given point geometries, where point a is the reference point.
Boundary returns the boundary of a given Geometry.
BoundingBoxHasInfiniteCoordinates checks if the bounding box of a Geometry has an infinite coordinate.
BoundingBoxHasNaNCoordinates checks if the bounding box of a Geometry has a NaN coordinate.
Buffer buffers a given Geometry by the supplied parameters.
Centroid returns the Centroid of a given Geometry.
ClipByRect clips a given Geometry by the given BoundingBox.
ClosestPoint returns the first point located on geometry A on the shortest line between the geometries.
Collect collects two geometries into a GeometryCollection or multi-type.
CollectionExtract returns a (multi-)geometry consisting only of the specified type.
CollectionHomogenize returns the simplest representation of a collection.
Contains returns whether geometry A contains geometry B.
ContainsProperly returns whether geometry A properly contains geometry B.
ConvexHull returns the convex hull of a given Geometry.
CountVertices returns a number of vertices (points) for the geom.T provided.
CoveredBy returns whether geometry A is covered by geometry B.
Covers returns whether geometry A covers geometry B.
Crosses returns whether geometry A crosses geometry B.
DFullyWithin determines whether the maximum distance across every pair of points comprising geometries A and B is within D units.
Difference returns the difference between two given Geometries.
Dimension returns the topological dimension of a given Geometry.
Disjoint returns whether geometry A is disjoint from geometry B.
DWithin determines if any part of geometry A is within D units of geometry B.
Envelope forms an envelope (compliant with the OGC spec) of the given Geometry.
Equals returns whether geometry A equals geometry B.
EqualsExact validates if two geometry objects are exact equal under some epsilon.
FlipCoordinates returns a modified g whose X, Y coordinates are flipped.
ForceCollection converts the input into a GeometryCollection.
ForceLayout forces a geometry into the given layout.
ForceLayoutWithDefaultM forces a geometry into the given layout.
ForceLayoutWithDefaultZ forces a geometry into the given layout.
ForceLayoutWithDefaultZM forces a geometry into the given layout.
ForcePolygonOrientation forces orientations within polygons to be oriented the prescribed way.
FrechetDistance calculates the Frechet distance between two geometries.
FrechetDistanceDensify calculates the Frechet distance between two geometries.
GenerateRandomPoints generates provided number of pseudo-random points for the input area.
HasPolygonOrientation checks whether a given Geometry have polygons that matches the given Orientation.
HausdorffDistance calculates the Hausdorff distance between two geometries.
HausdorffDistanceDensify calculates the Hausdorff distance between two geometries.
Intersection returns the geometries of intersection between A and B.
Intersects returns whether geometry A intersects geometry B.
IsClosed returns whether the given geometry has equal start and end points.
IsCollection returns whether the given geometry is of a collection type.
IsEmpty returns whether the given geometry is empty.
IsRing returns whether the given geometry is a ring, i.e.
IsSimple returns whether the given geometry is simple, i.e.
IsValid returns whether the given Geometry is valid.
IsValidDetail returns information about the validity of a Geometry.
IsValidReason returns the reasoning for whether the Geometry is valid or invalid.
IsValidTrajectory returns whether a geometry encodes a valid trajectory.
Length returns the length of a given Geometry.
LineCrossingDirection takes two lines and returns an integer value defining behavior of crossing of lines: 0: lines do not cross, -1: line2 crosses line1 from right to left, 1: line2 crosses line1 from left to right, -2: line2 crosses line1 multiple times from right to left, 2: line2 crosses line1 multiple times from left to right, -3: line2 crosses line1 multiple times from left to left, 3: line2 crosses line1 multiple times from right to Right.
LineInterpolatePoints returns one or more points along the given LineString which are at an integral multiples of given fraction of LineString's total length.
LineLocatePoint returns a float between 0 and 1 representing the location of the closest point on LineString to the given Point, as a fraction of total 2d line length.
LineMerge merges multilinestring constituents.
LineStringFromMultiPoint generates a linestring from a multipoint.
LineSubstring returns a LineString being a substring by start and end.
LongestLineString returns the LineString corresponds to maximum distance across every pair of points comprising geometries A and B.
MakeDefaultBufferParams returns the default BufferParams/.
MakePolygon creates a Polygon geometry from linestring and optional inner linestrings.
Takes a multilinestring input and converts it to a slice of linestrings to call MakePolygon.
MakePolygonWithSRID is like MakePolygon but also sets the SRID, like ST_Polygon.
MakeValid returns a valid form of the given Geometry.
MatchesDE9IM checks whether the given DE-9IM relation matches the DE-91M pattern.
MaxDistance returns the maximum distance across every pair of points comprising geometries A and B.
MinDistance returns the minimum distance between geometries A and B.
MinimumBoundingCircle returns minimum bounding circle of an EWKB.
MinimumClearance returns the minimum distance a vertex can move to produce an invalid geometry, or infinity if no clearance was found.
MinimumClearanceLine returns the line spanning the minimum distance a vertex can move to produce an invalid geometry, or an empty line if no clearance was found.
MinimumRotatedRectangle Returns a minimum rotated rectangle enclosing a geometry.
Multi converts the given geometry into a new multi-geometry.
Node returns a geometry containing a set of LineStrings using the least possible number of nodes while preserving all of the input ones.
Normalize returns the geometry in its normalized form.
OrderingEquals returns whether geometry A is equal to B, with all constituents and coordinates in the same order.
Overlaps returns whether geometry A overlaps geometry B.
ParseBufferParams parses the given buffer params from a SQL string into the BufferParams form.
Perimeter returns the perimeter of a given Geometry.
PointKindAndPolygonKind returns whether a pair of geometries contains a (multi)point and a (multi)polygon.
PointKindCoveredByPolygonKind returns whether a (multi)point is covered by a (multi)polygon.
PointKindIntersectsPolygonKind returns whether a (multi)point and a (multi)polygon intersect.
PointKindWithinPolygonKind returns whether a (multi)point is contained within a (multi)polygon.
PointOnSurface returns the PointOnSurface of a given Geometry.
Points returns the points of all coordinates in a geometry as a multipoint.
Relate returns the DE-9IM relation between A and B.
RelateBoundaryNodeRule returns the DE-9IM relation between A and B using the given boundary node rule (as specified by GEOS).
RelatePattern returns whether the DE-9IM relation between A and B matches.
RemovePoint removes the point at the given index of lineString; index is 0-based.
RemoveRepeatedPoints returns the geometry with repeated points removed.
Reverse returns a modified geometry by reversing the order of its vertexes.
Rotate returns a modified Geometry whose coordinates are rotated around the origin by a rotation angle.
RotateWithPointOrigin returns a modified Geometry whose coordinates are rotated around the pointOrigin by a rotRadians.
RotateWithXY returns a modified Geometry whose coordinates are rotated around the X and Y by a rotRadians.
RotateX returns a modified Geometry whose coordinates are rotated about the X axis by rotRadians.
RotateY returns a modified Geometry whose coordinates are rotated about the Y axis by rotRadians.
RotateZ returns a modified Geometry whose coordinates are rotated about the Z axis by rotRadians.
Scale returns a modified Geometry whose coordinates are multiplied by the factors.
ScaleRelativeToOrigin returns a modified Geometry whose coordinates are multiplied by the factors relative to the origin.
Segmentize return modified Geometry having no segment longer that given maximum segment length.
SetPoint sets the point at the given index of lineString; index is 0-based.
SharedPaths Returns a geometry collection containing paths shared by the two input geometries.
ShiftLongitude returns a modified version of a geometry in which the longitude (X coordinate) of each point is incremented by 360 if it is <0 and decremented by 360 if it is >180.
ShortestLineString returns the LineString corresponds to minimum distance across every pair of points comprising geometries A and B.
Simplify simplifies the given Geometry using the Douglas-Pecker algorithm.
SimplifyGEOS returns a simplified Geometry with GEOS.
SimplifyPreserveTopology returns a simplified Geometry with topology preserved.
Snap returns the input geometry with the vertices snapped to the target geometry.
SnapToGrid snaps all coordinates in the Geometry to the given grid size, offset by the given origin.
Subdivide returns a geometry divided into parts, where each part contains no more than the number of vertices provided.
SwapOrdinates returns a version of the given geometry with given ordinates swapped.
SymDifference returns the geometries of symmetric difference between A and B.
TileEnvelope returns a geometry as a rectangular Polygon giving the extent of a tile in the XYZ tile system.
Touches returns whether geometry A touches geometry B.
Translate returns a modified Geometry whose coordinates are incremented or decremented by the deltas.
TransScale returns a modified Geometry whose coordinates are translate by deltaX and deltaY and scale by xFactor and yFactor.
UnaryUnion returns the geometry of union between input geometry components.
Union returns the geometries of union between A and B.
VoronoiDiagram Computes the Voronoi Diagram from the vertices of the supplied geometry.
Within returns whether geometry A is within geometry B.

# Constants

Assigning constant integer values to variables for different crossing behavior and directions throughout the functions.
Assigning constant integer values to variables for different crossing behavior and directions throughout the functions.
Assigning constant integer values to variables for different crossing behavior and directions throughout the functions.
Assigning constant integer values to variables for different crossing behavior and directions throughout the functions.
Assigning constant integer values to variables for different crossing behavior and directions throughout the functions.
Assigning constant integer values to variables for different crossing behavior and directions throughout the functions.
Assigning constant integer values to variables for different crossing behavior and directions throughout the functions.
NotPointAndPolygon signifies that a pair of geometries is not a point and a polygon.
OrientationCCW denotes a counter-clockwise orientation.
OrientationCW denotes a clockwise orientation.
PointAndPolygon signifies that the point appears first in an ordered pair of a point and a polygon.
PolygonAndPoint signifies that the polygon appears first in an ordered pair of a point and a polygon.
PPCFCheckNextPolygon signals that the current point should be checked against the next polygon.
PPCFReturnTrue signals that the function should exit early and return true.
PPCFSkipToNextPoint signals that the rest of the checking for the current point can be skipped.

# Variables

ErrGenerateRandomPointsInvalidPoints is returned if we have a negative number of points or an empty geometry.
ErrPointOriginEmpty is an error to compare point origin is empty.

# Structs

BufferParams is a wrapper around the geos.BufferParams.
ValidDetail contains information about the validity of a geometry.

# Interfaces

PointInPolygonEventListener is an interface implemented for each binary predicate making use of the point in polygon optimization to specify the behavior in pointKindRelatesToPolygonKind.

# Type aliases

AffineMatrix defines an affine transformation matrix for a geom object.
LineCrossingDirectionValue maps to the return value of ST_LineCrossingDirection from PostGIS.
Orientation defines an orientation of a shape.
PointPolygonControlFlowType signals what control flow to follow.
PointPolygonOrder represents the order of a point and a polygon in an ordered pair of geometries.