mapbox / mapbox/mapbox-java

Feature Request: Port `turf-bezier-spline` to Mapbox Java (Android)

オープン
#1,635 コメント 0 件 リアクション 0 件 担当者 0 名 GitHub で見る

まだ誰も着手していません。

主要言語
Java
スター
438
フォーク
117
PR マージ指標
30日以内にマージされた PR はありません

説明

Description

Currently, the Mapbox Java SDK's Turf implementation lacks the turf-bezier-spline module. This feature is readily available in both Turf.js (Web) and Turf for Swift (iOS), but Android developers are left without a native way to generate smooth Bézier curves from a LineString.

When building cross-platform applications that rely on consistent map rendering, the absence of TurfMisc.bezier() in Java forces Android developers to write custom mathematical utilities to calculate intermediate curve coordinates, rather than relying on the official Turf ecosystem.

Expected Behavior

Port the turf-bezier-spline algorithm to mapbox-java so that Android developers can pass a straight LineString with control points and receive a curved LineString or Feature in return, matching the behavior of the Web and iOS SDKs.

Example of Desired API usage (Java)
List<Point> points = Arrays.asList(
    Point.fromLngLat(-122.414, 37.776),
    Point.fromLngLat(-122.420, 37.780), // Control point
    Point.fromLngLat(-122.425, 37.776)
);
LineString straightLine = LineString.fromLngLats(points);

// This is currently missing:
Feature curvedFeature = TurfMisc.bezier(straightLine);
Current Workaround

Manually calculating the Quadratic/Cubic Bézier mathematical formulas in a custom Java utility class, generating a dense list of Point objects, and then passing those to a standard LineString. This is inefficient and prone to projection errors compared to a dedicated Turf module.

Context

This missing feature was also noted internally by the Mapbox team in the navigation-android SDK (Issue #3018) back in 2020. Adding this would greatly improve feature parity between Mapbox's Web, iOS, and Android ecosystems.

コントリビューションガイド

コントリビューションガイドを開く

はじめの一歩

  1. issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
  2. 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
  3. リポジトリをフォークし、ブランチを切って変更します。
  4. issue 番号を参照したプルリクエストを送ります。

調査の方向性

Turf.js と Turf for Swift にある既存の turf-bezier-spline 実装を比較し、続いて Java SDK の TurfMisc エントリポイントを調べます。LineString 入力に対応する未実装の TurfMisc.bezier API を実装し、その曲線出力が Web と iOS の動作と一致することを検証します。

索引モデルが issue の本文から書いたものです。

評価

技術スタック
android, java
領域
mobile-dev
issue の種類
機能追加
難易度
4/5
見積もり時間
3〜5日
活発さ
静か
明瞭さ
おおむね明確
初心者へのやさしさ
55/100

新しい issue をメールで受け取る

初心者向けの GitHub issue を短くまとめたダイジェスト。