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

What Unit of Measurement is Being Used for The Area, Square Meters? #20

Open
danielverapax opened this issue Feb 18, 2022 · 3 comments
Open

Comments

@danielverapax
Copy link

No description provided.

@gigalala
Copy link

it gives incorrect answer anyways. I compared with online tools and with js package

@vkbaloda
Copy link

vkbaloda commented Jul 22, 2022

yes, it's giving wrong for me too. The unit is square meters, it's given in the method comments.

@kb0
Copy link
Owner

kb0 commented Jul 24, 2022

Yes it's square meters. And polygon must be "closed", i.e. first point = last point, for ex.:

    final p1 = LatLng(45.153474463955796, 39.33852195739747);
    final p2 = LatLng(45.153474463955796, 39.33972358703614);
    final p3 = LatLng(45.15252112936569, 39.33972358703614);
    final p4 = LatLng(45.1525022138355, 39.3385460972786);

    expect(
        SphericalUtil.computeArea([p1, p2, p3, p4, p1]),
        closeTo(9987, 1));

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

No branches or pull requests

4 participants