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

wrong triangulation #159

Open
lzxue opened this issue Dec 9, 2022 · 1 comment
Open

wrong triangulation #159

lzxue opened this issue Dec 9, 2022 · 1 comment
Labels

Comments

@lzxue
Copy link

lzxue commented Dec 9, 2022

Use latitude and longitude coordinates is wrong

draw as polygon

image

draw as line
image

the data

{
    "vertices": [
        57.915138,
        42.457222,
        57.990749,
        45.449139,
        58.578686,
        45.599289,
        59.099235,
        45.341999,
        60.001514,
        44.999783,
        61.111194,
        44.35775,
        61.121418,
        44.268665,
        62.028694,
        43.486527,
        65.294136,
        43.545277,
        66.60611,
        41.251415,
        68.443611,
        40.596111,
        68.617222,
        40.613333,
        57.915138,
        42.457222
    ],
    "holes": [],
    "dimensions": 2
}

Use projected coordinates is ok

draw as polygon
image

draw as line
image

{
    "vertices": [
        -595675.270653422,
        -97137.56776251551,
        -587258.2926350506,
        365653.92892832495,
        -521809.445176526,
        389511.2666772781,
        -463862.19556357805,
        348669.2554599289,
        -363420.9567301143,
        294632.69788446557,
        -239891.94418663438,
        194118.13950136025,
        -238753.81371276453,
        180258.65645650402,
        -137756.31138380617,
        59467.24496770464,
        225751.02927116212,
        68485.68337761611,
        371799.30688517727,
        -277358.2804402346,
        576348.9825373087,
        -373905.20303173736,
        595675.2706534192,
        -371380.04541214835,
        -595675.270653422,
        -97137.56776251551
    ],
    "holes": [],
    "dimensions": 2
}
@mourner mourner added the bug label Dec 9, 2022
@mtschanen
Copy link

Can this really be considered a bug? Spherical coordinates are not euclidian, so it's no wonder earcut can't work with them.

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

No branches or pull requests

3 participants