Skip to content

Add spherical_length() function to geometries in Lua#2474

Open
joto wants to merge 1 commit into
osm2pgsql-dev:masterfrom
joto:spherical-length
Open

Add spherical_length() function to geometries in Lua#2474
joto wants to merge 1 commit into
osm2pgsql-dev:masterfrom
joto:spherical-length

Conversation

@joto
Copy link
Copy Markdown
Collaborator

@joto joto commented May 17, 2026

For linestrings and multilinestrings this returns the same value as the PostGIS ST_Length() function on a geography. For other geometry types this always returns 0.0.

@joto joto force-pushed the spherical-length branch from 0f04784 to 81ccfc0 Compare May 17, 2026 13:01
@joto
Copy link
Copy Markdown
Collaborator Author

joto commented May 17, 2026

Looks like this is failing on PostgreSQL 11 due to results having less precision. On all newer PostgreSQL versions it is fine. And Pg 11 is not supported upstream any more, I am not sure why we are even testing against it.

@lonvia
Copy link
Copy Markdown
Collaborator

lonvia commented May 17, 2026

Because PG11 is the lowest supported version, see README.md.

For linestrings and multilinestrings this returns the same value as the
PostGIS ST_Length() function on a geography. For other geometry types
this always returns 0.0.
@joto joto force-pushed the spherical-length branch from 81ccfc0 to 61ac715 Compare May 18, 2026 10:06
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.

2 participants