Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[FEATURE]PPL/SQL Geo Functionality Support #880

Open
YANG-DB opened this issue Nov 8, 2024 · 1 comment
Open

[FEATURE]PPL/SQL Geo Functionality Support #880

YANG-DB opened this issue Nov 8, 2024 · 1 comment
Labels
enhancement New feature or request Lang:PPL Pipe Processing Language support Roadmap:Search Project-wide roadmap label

Comments

@YANG-DB
Copy link
Member

YANG-DB commented Nov 8, 2024

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?

@YANG-DB YANG-DB added enhancement New feature or request untriaged Roadmap:Search Project-wide roadmap label Lang:PPL Pipe Processing Language support labels Nov 8, 2024
@dblock dblock removed the untriaged label Nov 25, 2024
@dblock
Copy link
Member

dblock commented Nov 25, 2024

[Catch All Triage - 1, 2, 3, 4, 5]

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request Lang:PPL Pipe Processing Language support Roadmap:Search Project-wide roadmap label
Projects
Status: New
Development

No branches or pull requests

2 participants