Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

turf-destination, turf-ellipse, turf-tesselate: Fix coordinate elevation component failing to pass though. #2852

Open
wants to merge 2 commits into
base: master
Choose a base branch
from

Conversation

prozvora
Copy link

@prozvora prozvora commented Mar 8, 2025

Summary of Changes

Fix dimension handling in tesselate.
Test for elevation in tesselate.
Fix elevation in destination.
Add input and output test cases with elevation to destination and ellipse.

Note

This is a non-breaking change.

Resolves

Test Output

turf-full-test-output

Destination

# turf-destination
ok 1 point-way-far-away-miles
ok 2 point-way-far-away-km
ok 3 point-90
ok 4 point-180
ok 5 point-0
ok 6 point-0-with-elevation

1..6
# tests 6
# pass  6

# ok

Ellipse

# turf-ellipse
anti-meridian-degrees.json
ok 1 anti-meridian-degrees
anti-meridian.json
ok 2 anti-meridian
northern-latitudes-degrees.json
ok 3 northern-latitudes-degrees
northern-latitudes.json
ok 4 northern-latitudes
rotation-degrees.json
ok 5 rotation-degrees
rotation.json
ok 6 rotation
simple-degrees.json
ok 7 simple-degrees
simple-with-elevation.json
ok 8 simple-with-elevation
simple.json
ok 9 simple
# turf-ellipse -- circle consistency
ok 10 both areas are equal
# turf-ellipse -- rotation consistency
ok 11 both areas are equal
# turf-ellipse -- with coordinates
ok 12 should be truthy
# turf-ellipse -- validate geojson
ok 13 (unnamed assert)

1..13
# tests 13
# pass  13

# ok

Tesselate

# tesselate
ok 1 Polygon returns a FeatureCollection
ok 2 contains at least 1 triangle
ok 3 triangle is valid
ok 4 MultiPolygon returns a FeatureCollection
ok 5 contains at least 1 triangle
ok 6 triangle is valid
ok 7 should throw
ok 8 should throw
ok 9 Polygon returns a FeatureCollection
ok 10 contains at least 1 triangle
ok 11 triangle is valid
ok 12 triangle coordinates contain elevation

1..12
# tests 12
# pass  12

# ok

Please provide the following when creating a PR:

  • Meaningful title, including the name of the package being modified.
  • Summary of the changes.
  • Heads up if this is a breaking change.
  • Any issues this resolves.
  • Inclusion of your details in the contributors field of package.json - you've earned it! 👏
  • Confirmation you've read the steps for preparing a pull request.

prozvora added 2 commits March 8, 2025 15:58
Fix dimension handling in tesselate.
Test for elevation in tesselate.
Fix elevation in destination.
Add input and output test cases with elevation to destination and ellipse.
Comment on lines +3521 to +3535
t.equal(
simpleTrianglesWithElevation.type,
"FeatureCollection",
"Polygon returns a FeatureCollection"
);
t.equal(
simpleTrianglesWithElevation.features[0].geometry.type,
"Polygon",
"contains at least 1 triangle"
);
t.equal(
simpleTrianglesWithElevation.features[0].geometry.coordinates[0].length,
4,
"triangle is valid"
);
Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

not sure if these tests are necessary to repeat. I copied them from the first polygon. I figured they would catch any malformation issues from adding the elevation to the coordinate.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant