Skip to content

Add geometry_nearest_points function#14923

Merged
mbasmanova merged 1 commit intoprestodb:masterfrom
jagill:nearest_points
Aug 21, 2020
Merged

Add geometry_nearest_points function#14923
mbasmanova merged 1 commit intoprestodb:masterfrom
jagill:nearest_points

Conversation

@jagill
Copy link
Contributor

@jagill jagill commented Jul 29, 2020

This function is similar to PostGIS ST_ClosestPoints. Given two
geometries, find a pair of points on them that have the minimum
distance. If either geometry is empty, return null.

Fixes #14887

Test plan - Unit tests in TestGeoFunctions

== RELEASE NOTES ==

Geospatial Changes
* Add :func:`geometry_nearest_points` to find nearest points of a pair of geometries.

This function is similar to PostGIS ST_ClosestPoints.  Given two
geometries, find a pair of points on them that have the minimum
distance.  If either geometry is empty, return null.
@jagill jagill requested review from mbasmanova and rschlussel July 29, 2020 22:53
@jagill jagill requested a review from tdcmeehan August 11, 2020 12:22
Copy link
Contributor

@mbasmanova mbasmanova left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@jagill Thank you.

CC: @zhenxiao @adamjshook

return blockBuilder.build();
}
catch (TopologyException e) {
throw new PrestoException(INVALID_FUNCTION_ARGUMENT, e.getMessage(), e);
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is it possible to add a test that triggers this exception and confirm that try allows to suppress it?

@mbasmanova mbasmanova merged commit e7af71b into prestodb:master Aug 21, 2020
@caithagoras caithagoras mentioned this pull request Sep 9, 2020
3 tasks
martint pushed a commit to art4ul/trino that referenced this pull request Jun 28, 2021
martint pushed a commit to trinodb/trino that referenced this pull request Jun 28, 2021
OLMS99 pushed a commit to OLMS99/trino that referenced this pull request Jul 9, 2021
sumannewton pushed a commit to sumannewton/trino that referenced this pull request Jan 17, 2022
@jagill jagill deleted the nearest_points branch October 1, 2025 20:23
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

nearest_point function

2 participants