-
Notifications
You must be signed in to change notification settings - Fork 29
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
Out of range values for longitude and latitude #4
Labels
Comments
That's a good point, I haven't had time to look into this as the project I'm working on right now is completely different, but I'll see if I can figure something out. |
This issue is still present. FYI The out-of-range longitude value const circleToPolygon = require('circle-to-polygon');
const coordinates = [24, 60];
const radius = 5000 * 1000;
const numberOfEdges = 4;
const polygon = circleToPolygon(coordinates, radius, numberOfEdges);
console.log(JSON.stringify(polygon, null, ' '));
// {
// "type": "Polygon",
// "coordinates": [
// [
// [
// 204,
// 75.08423579402391
// ],
// [
// -39.36750067319971,
// 37.82647346052107
// ],
// [
// 23.99999999999999,
// 15.084235794023924
// ],
// [
// 87.36750067319969,
// 37.82647346052106
// ],
// [
// 204,
// 75.08423579402391
// ]
// ]
// ]
// }
|
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Hi, I noticed that if the center of the circle is located up north (e.g. [24, 60]) and the radius is a big number like 5000000( 5000 KM) the output includes out of range values for longitude and latitude.
I resolved it by adding the following part before returning the result but wondering if there are cleaner ways of doing it?
The text was updated successfully, but these errors were encountered: