server
server copied to clipboard
MDEV-34278: Implement the GIS function ST_Collect
- [x] *The Jira issue number for this PR is: MDEV-34278
Description
The GIS function ST_Collect takes as input multiple geometries and returns the aggregation of the distinct geometry arguments.
The resulting value type is chosen using the following policy:
- If all arguments are
Pointvalues, the result is aMultiPointvalue. - If all arguments are
LineStringvalues, the result is aMultiLineStringvalue. - If all arguments are
Polygonvalues, the result is aMultiPolygonvalue. - Otherwise, the result is a
GeometryCollectionvalue.
If there are multiple geometry arguments and those arguments are in the same SRS, the return value is in that SRS. If those arguments are not in the same SRS, an ER_GIS_DIFFERENT_SRIDS_AGGREGATION error occurs.
This PR does not implement the DISTINCT clause that needs to be handled in a different PR.
To ensure compatibility between the MySQL implementation of this function and the MariaDB implementation, the tests for this function have been cherry-picked from MySQL.
This patch has no side effects.
Release Notes
Adds the function:
ST_Collect(Geometry g), ST_Collect(Geometry g) [over clause] : aggregates geometry values and returns the tightest geometry collection value.
How can this PR be tested?
An extensive test suite has been cherry-picked from MySQL.
Basing the PR against the correct MariaDB version
- [x] This is a new feature or a refactoring, and the PR is based against the latest MariaDB development branch.
- [ ] This is a bug fix, and the PR is based against the earliest maintained branch in which the bug can be reproduced.
PR quality check
- [x] I checked the CODING_STANDARDS.md file and my PR conforms to this where appropriate.
- [x] For any trivial modifications to the PR, I am ok with the reviewer making the changes themselves.
@holyfoot I pushed a new version that solves point number 3
@holyfoot I pushed a new version that solves point number 3
@StefanoPetrilli the main.spatial_utility_function_collect test fails because the result file wasn't updated, can you please attach those changes to the PR? Thanks.
@holyfoot I pushed a new version that solves point number 3
@StefanoPetrilli the
main.spatial_utility_function_collecttest fails because the result file wasn't updated, can you please attach those changes to the PR? Thanks.
@DaveGosselin-MariaDB I forgot to add that file to the changes. Now it should be all right.
@holyfoot I pushed a new version that solves point number 3
@StefanoPetrilli the
main.spatial_utility_function_collecttest fails because the result file wasn't updated, can you please attach those changes to the PR? Thanks.@DaveGosselin-MariaDB I forgot to add that file to the changes. Now it should be all right.
Thank you, the test is passing now. 😄