react-globe.gl icon indicating copy to clipboard operation
react-globe.gl copied to clipboard

Borders of country polygons not lining up

Open phocks opened this issue 1 year ago • 6 comments

The country borders don't always line up

To Reproduce Add polygon countries and borders. Look at Russia

Expected behavior Borders line up

Screenshots Screen Shot 2023-03-21 at 11 48 50 am

Desktop (please complete the following information):

  • macOS Chrome Edge Firefox etc

Additional context Just wondering if anyone knows what's going on here. I've seen it in a few other examples.

phocks avatar Mar 21 '23 01:03 phocks

@phocks could be related to the coordinate resolution of your polygon geoJson, or to the value set in polygonCapCurvatureResolution.

vasturiano avatar Mar 21 '23 19:03 vasturiano

@vasturiano thanks. Seems to happen with default polygons and curve cap resolution, though with different results (see https://observablehq.com/@vasturiano/corona-virus-covid-19-globe) something to do with how the geojson gets converted into polygons creating different shapes to the original. Oh well, thanks. I'll keep trying different things.

Screenshot 2023-03-22 071253

phocks avatar Mar 21 '23 21:03 phocks

@phocks did you find a solution? I have a lot of troubles with it. For example polygonCapCurvatureResolution={2000} image

  polygonCapCurvatureResolution={20}

Screenshot from 2023-10-29 20-25-51

idk why this is happened, any ideas? I could leave it on sandbox, for example

data example

    "type": "Feature",
    "geometry": {
        "type": "Polygon",
        "coordinates": [
            [
                [
                    25.65,
                    40.275
                ],
                [
                    25.5,
                    40.3
                ],
                [
                    24.966666666666665,
                    40.583333333333336
                ],
                [
                    24.55,
                    40.18333333333333
                ],
                [
                    24.75,
                    40.15
                ],
                [
                    24.933333333333334,
                    40.333333333333336
                ],
                [
                    25.55,
                    40.11666666666667
                ],
                [
                    25.65,
                    40.275
                ]
            ]
        ]
    },
    "properties": {
        "noticeType": "NOTMAR",
    },
    "__id": "03030303030"
}```

meshbor avatar Oct 29 '23 17:10 meshbor

Haven't yet found a solution @meshbor unfortunately. I think I'll have to go back to the drawing board and roll my own three.js globe.

phocks avatar Oct 30 '23 01:10 phocks

@phocks if you have some guideline it will be cool.

meshbor avatar Oct 30 '23 05:10 meshbor

@phocks could be related to the coordinate resolution of your polygon geoJson, or to the value set in polygonCapCurvatureResolution.

@vasturiano is my geoJson correct?

meshbor avatar Oct 30 '23 07:10 meshbor