Wish add method of "turf.coordEach" and "turf.toWgs84".
Nobody has claimed this yet.
Assessment
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Newbie friendliness
- 35/100
Research direction
Start by locating the Java Turf and GeoJSON APIs corresponding to coordEach and toWgs84, then compare them with the JavaScript examples in this issue. Determine how coordinate traversal and coordinate conversion should fit the existing Mapbox Java API, and verify the behavior with suitable project tests. Done means both requested methods are available for the described GeoJSON transformation.
Written by the indexing model from the issue text.
Description
JavaScript code here , now,need to transfer it for Java. but Turf for Java hasn't been provided these methods("turf.coordEach" and "turf.toWgs84").
`let matrix = [
[1, 0, 0],
[0, 1, 0],
[-7497858.8300422, 295668.93016059976, 1]
]
var geojson;
if(trans){
$.getJSON('./xjlmk.geojson', null, function(data){
geojson = data;
transformGeo(geojson, matrix);
geojson = turf.toWgs84(geojson);
});
}
// geojson坐标配准
var transformGeo = function (features, matrix) {
var ret = [];
if(matrix.length != 3) return features;
turf.coordEach(features, function (currentCoord, coordIndex, featureIndex, multiFeatureIndex, geometryIndex) {
var x = currentCoord[0] * matrix[0][0] + currentCoord[1] * matrix[1][0] + matrix[2][0];
var y = currentCoord[0] * matrix[0][1] + currentCoord[1] * matrix[1][1] + matrix[2][1];
currentCoord[0] = x;
currentCoord[1] = y;
});
};`
- Dominant language
- Java
- Stars
- 438
- Forks
- 117
- PR merge metrics
- No merged PRs in 30d
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
More from mapbox/mapbox-java
-
Difficulty 2/5 1-3 hours Newbie friendliness 72/100
mapbox/mapbox-java#1640 ·
-
Difficulty 4/5 3-5 days Newbie friendliness 55/100
mapbox/mapbox-java#1635 ·
-
Difficulty 5/5 Over a week Newbie friendliness 15/100
mapbox/mapbox-java#1619 ·
-
Mapbox-java incompatible with gson 2.13.0 and up - call to internal GSON classes that were renamed Open
Difficulty 2/5 1-3 hours Newbie friendliness 48/100
mapbox/mapbox-java#1614 · 2 comments · 1 reaction ·
-
Difficulty 5/5 Over a week Newbie friendliness 20/100
mapbox/mapbox-java#1612 · 1 reaction ·
All issues in mapbox/mapbox-java
Similar issues
-
Difficulty 2/5 1-3 hours Newbie friendliness 65/100
-
Difficulty 1/5 Under an hour Newbie friendliness 88/100
checkstyle/test-configs#263 ·
-
bug
Difficulty 1/5 Under an hour Newbie friendliness 90/100
apache/cloudstack#14222 ·
-
[BUG]茶杯方块在取茶时会引发崩溃 Open
Difficulty 2/5 1-3 hours Newbie friendliness 88/100
-
1.0.0-alpha2 Type/Improvement
Difficulty 2/5 1-3 hours Newbie friendliness 68/100
wso2/dpdp-accelerator#272 ·