Skip to content

fix(projection) - Rework public API to allow arbitrary projections - #3098

Merged
mfedderly merged 3 commits into
masterfrom
mf/projection-public-api
Aug 18, 2026
Merged

fix(projection) - Rework public API to allow arbitrary projections#3098
mfedderly merged 3 commits into
masterfrom
mf/projection-public-api

Conversation

@mfedderly

@mfedderly mfedderly commented Jul 20, 2026

Copy link
Copy Markdown
Collaborator

Rename convert to project and exports it as new public api.

There are plenty of projections that aren't Mercator or WGS84, and a lot of work has gone into generic projection tools like proj4. This lets people use the existing projection code in Turf to manage the GeoJSON wrappers without forcing Turf to continue to expand for new projections or stay up to date with these other packages.

WGS84 and Mercator are a special case because they are so often used in web mapping, so I think it makes sense to continue to ship implementations of these two methods.

Fixes #3046

@mfedderly

Copy link
Copy Markdown
Collaborator Author

One possible counterexample to the projection: (input: number[]) => number[] API here would be trying to bulk project to something like MGRS where you wouldn't be able to return number[]. That also starts to get a little far from GeoJSON itself though, so maybe its a nonissue.

@mfedderly
mfedderly force-pushed the mf/projection-public-api branch from b63fbe3 to 0644511 Compare August 18, 2026 15:37
@mfedderly
mfedderly marked this pull request as ready for review August 18, 2026 15:38
@mfedderly
mfedderly force-pushed the mf/projection-public-api branch from 52ce426 to d844986 Compare August 18, 2026 16:19
@mfedderly
mfedderly force-pushed the mf/projection-public-api branch from d844986 to a43f870 Compare August 18, 2026 16:22
@mfedderly
mfedderly merged commit 0791335 into master Aug 18, 2026
3 checks passed
@mfedderly
mfedderly deleted the mf/projection-public-api branch August 18, 2026 16:35
@mfedderly mfedderly added this to the v8 milestone Aug 18, 2026
@mfedderly mfedderly changed the title Rework projection public API to allow arbitrary projections fix(projection) - Rework public API to allow arbitrary projections Aug 18, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant