Skip to content

Function flipCoordinates #79469

@CurtizJ

Description

@CurtizJ

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

Metadata

Metadata

Labels

comp-geoGeospatial functions and related libs (e.g., H3, S2, geo distance).feature

Type

No type
No fields configured for issues without a type.

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions