Company or project name
ClickHouse Inc.
Use case
Flip coordinates of points in geo types (Point, Ring, Polygon, MultiPolygon, ...) because different systems (and functions in ClickHouse) require a different order, and converting them is annoying.
Describe the solution you'd like
A function that unwraps the required number of dimensions in an array and swaps pointers inside the Tuple column without copying.
Describe alternatives you've considered
arrayMap(polygon -> (arrayMap(... p -> (p.2, p.1)), multipolygon), which is too bulky, requires remembering the number of dimensions in type and is inefficient.
Additional context
https://postgis.net/docs/ST_FlipCoordinates.html
Company or project name
ClickHouse Inc.
Use case
Flip coordinates of points in geo types (
Point,Ring,Polygon,MultiPolygon, ...) because different systems (and functions in ClickHouse) require a different order, and converting them is annoying.Describe the solution you'd like
A function that unwraps the required number of dimensions in an array and swaps pointers inside the Tuple column without copying.
Describe alternatives you've considered
arrayMap(polygon -> (arrayMap(... p -> (p.2, p.1)), multipolygon), which is too bulky, requires remembering the number of dimensions in type and is inefficient.Additional context
https://postgis.net/docs/ST_FlipCoordinates.html