Feature Request: Port `turf-bezier-spline` to Mapbox Java (Android)
Chưa có ai nhận issue này.
Đánh giá
- Độ khó
- 4/5
- Thời gian dự kiến
- 3-5 ngày
- Mức phù hợp với người mới
- 55/100
- Loại issue
- Tính năng
- Độ rõ ràng
- Khá rõ ràng
- Mức độ hoạt động
- Ít trao đổi
- Công nghệ
- android, java
- Lĩnh vực
- mobile-dev
Hướng nghiên cứu
So sánh các triển khai turf-bezier-spline hiện có trong Turf.js và Turf for Swift, sau đó kiểm tra entry point TurfMisc của Java SDK. Triển khai API TurfMisc.bezier còn thiếu cho đầu vào LineString và xác minh rằng đầu ra dạng đường cong của nó khớp với hành vi trên Web và iOS.
Do mô hình lập chỉ mục viết ra từ nội dung của issue.
Mô tả
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.
- Ngôn ngữ chính
- Java
- Star
- 438
- Fork
- 117
- Chỉ số merge pull request
- Không có pull request nào được merge trong 30 ngày
Hướng dẫn đóng góp
Bắt đầu từ đâu
- Đọc hết issue, rồi đọc hướng dẫn đóng góp của dự án.
- Bình luận trên issue rằng bạn sẽ nhận — tránh hai người làm cùng một việc.
- Fork repository và làm thay đổi trên một nhánh.
- Mở pull request có tham chiếu số hiệu của issue.
Issue khác của mapbox/mapbox-java
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 72/100
mapbox/mapbox-java#1640 ·
-
Độ khó 5/5 Hơn một tuần Mức phù hợp với người mới 15/100
mapbox/mapbox-java#1619 ·
-
Mapbox-java incompatible with gson 2.13.0 and up - call to internal GSON classes that were renamed Đang mở
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 48/100
mapbox/mapbox-java#1614 · 2 bình luận · 1 reaction ·
-
Độ khó 5/5 Hơn một tuần Mức phù hợp với người mới 20/100
mapbox/mapbox-java#1612 · 1 reaction ·
-
Validate GeoJSON data Đang mở
Độ khó 4/5 3-5 ngày Mức phù hợp với người mới 35/100
mapbox/mapbox-java#1603 ·
Tất cả issue của mapbox/mapbox-java
Issue tương tự
-
bug
Độ khó 1/5 Dưới một giờ Mức phù hợp với người mới 90/100
apache/cloudstack#14222 ·
-
[BUG]茶杯方块在取茶时会引发崩溃 Đang mở
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 88/100
-
Cannot differ own consent and managed consents in My Consents view and detailed consent view. Đang mở1.0.0-alpha2 Type/Improvement
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 68/100
wso2/dpdp-accelerator#272 ·
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 82/100
infinispan/infinispan#18150 ·
-
area/frontend
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 65/100