The Wayback Machine - https://web.archive.org/web/20210124133231/https://github.com/Turfjs/turf/issues/1920
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/transform-rotate on Polygon, 'coordinates must contain numbers' #1920

Closed
MattIPv4 opened this issue Jun 30, 2020 · 2 comments
Closed

@turf/transform-rotate on Polygon, 'coordinates must contain numbers' #1920

MattIPv4 opened this issue Jun 30, 2020 · 2 comments

Comments

@MattIPv4
Copy link

@MattIPv4 MattIPv4 commented Jun 30, 2020

I have a Polygon (polygon from @turf/helpers) and need to rotate it 180 degrees, so I am using transformRotate from @turf/transform-rotate.

However, whenever I call transformRotate(poly, 180), I get back an error with coordinates must contain numbers, which makes no sense to me?

Basic reproduction can be seen here: https://repl.it/repls/DeafeningWelloffNumericalanalysis#index.js

@stebogit
Copy link
Collaborator

@stebogit stebogit commented Jul 1, 2020

@MattIPv4 Turf coords must follow the WGS84 standards, therefore in [longitude, latitude] order, where latitude has values between -90 and 90.
Many values in your coords array are outside the map:

Screen Shot 2020-06-30 at 5 32 32 PM

@MattIPv4
Copy link
Author

@MattIPv4 MattIPv4 commented Jul 1, 2020

Ah, didn't realise that, makes sense. Will look for another solution to rotating the poly -- I'm only using turf for working with polys are no other library seems to be able to take arbitrary coordinates and create polys, then merge them cleanly.

@stebogit stebogit closed this Jul 1, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
2 participants