Is your feature request related to a problem?
We would like to add advanced geo-spatial commands support.
Context
Here’s a list of common SQL/PPL geo-spatial commands, often used in databases like PostGIS, Oracle Spatial, and other geospatial extensions for SQL-compliant systems.
These can be implemented or adapted in PPL / SQL (under the Spark Engine) for spatial analysis tasks.
Geospatial Functions for Geometry Operations
Distance: Computes the distance between two geometries (e.g., points, polygons).
Distance(geomA, geomB)
Intersects: Determines if two geometries intersect.
Intersects(geomA, geomB)
Contains: Checks if one geometry contains another.
Contains(geomA, geomB)
Within: Determines if one geometry is within another.
Within(geomA, geomB)
Overlaps: Checks if two geometries overlap.
Overlaps(geomA, geomB)
Crosses: Tests if one geometry crosses another.
Crosses(geomA, geomB)
Geospatial Transformation Functions
Transform: Transforms a geometry to a different spatial reference system (SRID).
Transform(geometry, targetSRID)
Buffer: Creates a buffer area around a geometry at a specified distance.
Buffer(geometry, distance)
Centroid: Calculates the centroid (center point) of a geometry.
Centroid(geometry)
Union: Merges multiple geometries into one.
Union(geomA, geomB)
Difference: Computes the difference between two geometries.
Difference(geomA, geomB)
Simplify: Reduces the complexity of a geometry, keeping its shape intact within a specified tolerance.
Simplify(geometry, tolerance)
Geometry Creation and Manipulation
Point: Creates a point geometry from given X and Y coordinates.
Point(x, y)
LineString: Creates a line geometry from an array of points.
LineString([point1, point2, ...])
Polygon: Forms a polygon geometry from boundary coordinates.
Polygon(boundary)
MakeEnvelope: Creates a rectangular polygon based on corner coordinates.
MakeEnvelope(xMin, yMin, xMax, yMax, SRID)
Spatial Index and Aggregate Functions
GeomFromText: Converts Well-Known Text (WKT) representation to a geometry.
GeomFromText('POINT(1 1)')
AsText: Converts a geometry to its WKT representation.
AsText(geometry)
Area: Computes the area of a polygonal geometry.
Area(geometry)
Length: Calculates the length of a linear geometry.
Length(geometry)
Collect: Aggregates multiple geometries into a single multi-geometry.
Collect(geometry_set)
geometry refers to spatial data types used to represent shapes, locations, and spatial relationships. This typically includes various geometric objects such as:
Point: Represents a single location in space, defined by X (longitude) and Y (latitude) coordinates.
LineString: Represents a sequence of points that form a continuous line, such as roads, rivers, or paths.
Polygon: A closed shape, defined by a series of points that create a boundary, often used to represent areas like countries, lakes, or other closed regions.
MultiPoint, MultiLineString, MultiPolygon: Collections of points, lines, or polygons, respectively, allowing multiple geometries to be treated as one.
GeometryCollection: A collection of geometries of different types, such as a mix of points, lines, and polygons.
These commands cover a broad range of spatial operations used for queries, analysis, and transformations in SQL environments
Is your feature request related to a problem? We would like to add advanced geo-spatial commands support.
Context
Here’s a list of common SQL/PPL geo-spatial commands, often used in databases like PostGIS, Oracle Spatial, and other geospatial extensions for SQL-compliant systems.
These can be implemented or adapted in PPL / SQL (under the Spark Engine) for spatial analysis tasks.
Geospatial Functions for Geometry Operations
Distance: Computes the distance between two geometries (e.g., points, polygons).
Distance(geomA, geomB)
Intersects: Determines if two geometries intersect.
Intersects(geomA, geomB)
Contains: Checks if one geometry contains another.
Contains(geomA, geomB)
Within: Determines if one geometry is within another.
Within(geomA, geomB)
Overlaps: Checks if two geometries overlap.
Overlaps(geomA, geomB)
Crosses: Tests if one geometry crosses another.
Crosses(geomA, geomB)
Geospatial Transformation Functions
Transform: Transforms a geometry to a different spatial reference system (SRID).
Transform(geometry, targetSRID)
Buffer: Creates a buffer area around a geometry at a specified distance.
Buffer(geometry, distance)
Centroid: Calculates the centroid (center point) of a geometry.
Centroid(geometry)
Union: Merges multiple geometries into one.
Union(geomA, geomB)
Difference: Computes the difference between two geometries.
Difference(geomA, geomB)
Simplify: Reduces the complexity of a geometry, keeping its shape intact within a specified tolerance.
Simplify(geometry, tolerance)
Geometry Creation and Manipulation
Point: Creates a point geometry from given X and Y coordinates.
Point(x, y)
LineString: Creates a line geometry from an array of points.
LineString([point1, point2, ...])
Polygon: Forms a polygon geometry from boundary coordinates.
Polygon(boundary)
MakeEnvelope: Creates a rectangular polygon based on corner coordinates.
MakeEnvelope(xMin, yMin, xMax, yMax, SRID)
Spatial Index and Aggregate Functions
GeomFromText: Converts Well-Known Text (WKT) representation to a geometry.
GeomFromText('POINT(1 1)')
AsText: Converts a geometry to its WKT representation.
AsText(geometry)
Area: Computes the area of a polygonal geometry.
Area(geometry)
Length: Calculates the length of a linear geometry.
Length(geometry)
Collect: Aggregates multiple geometries into a single multi-geometry.
Collect(geometry_set)
geometry
refers to spatial data types used to represent shapes, locations, and spatial relationships. This typically includes various geometric objects such as:Point: Represents a single location in space, defined by X (longitude) and Y (latitude) coordinates.
LineString: Represents a sequence of points that form a continuous line, such as roads, rivers, or paths.
Polygon: A closed shape, defined by a series of points that create a boundary, often used to represent areas like countries, lakes, or other closed regions.
MultiPoint, MultiLineString, MultiPolygon: Collections of points, lines, or polygons, respectively, allowing multiple geometries to be treated as one.
GeometryCollection: A collection of geometries of different types, such as a mix of points, lines, and polygons.
These commands cover a broad range of spatial operations used for queries, analysis, and transformations in SQL environments
Do you have any additional context?