You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Intuitively I expected that using transformTranslate with a negative distance will transform the feature in 180 degrees. This is true for west-east transformations, but not for north-south transformations.
Example:
turf.transformTranslate(turf.point([0,0]), 10, 0); // gives a transformation towards north {"type":"Feature","properties":{},"geometry":{"type":"Point","coordinates":[0,0.08993203637245381]}}
turf.transformTranslate(turf.point([0,0]), -10, 0); // gives same as above, i.e. distance negativity is ignored: {"type":"Feature","properties":{},"geometry":{"type":"Point","coordinates":[0,0.08993203637245381]}}
turf.transformTranslate(turf.point([0,0]), 10, 90); // gives a transformation towards east as expected: {"type":"Feature","properties":{},"geometry":{"type":"Point","coordinates":[0.08993203637248826,5.5067490242164445e-18]}}
turf.transformTranslate(turf.point([0,0]), -10, 90); // gives a transformation towards west: {"type":"Feature","properties":{},"geometry":{"type":"Point","coordinates":[-0.08993203637248826,5.5067490242164445e-18]}}
Please add a warning in the docs for now.
In my opinion, future versions should treat negative distances by flipping the direction in 180 degress.
The text was updated successfully, but these errors were encountered:
Hey @ozomer thanks for your input.
Reading the code looks like the issue is here. The conversion for a negative direction (i.e. bearing) should be instead:
Intuitively I expected that using transformTranslate with a negative distance will transform the feature in 180 degrees. This is true for west-east transformations, but not for north-south transformations.
Example:
Please add a warning in the docs for now.
In my opinion, future versions should treat negative distances by flipping the direction in 180 degress.
The text was updated successfully, but these errors were encountered: