问题
I have an array of latitudes and longitudes like this:
arr =
[[[52.451466, 8.669105]
[52.450689, 8.683759]
[52.449911, 8.698414]
...
[49.358081, 29.464242]
[49.354822, 29.477067]
[49.351562, 29.489892]]
[[52.442744, 8.667857]
[52.441966, 8.682509]
[52.441187, 8.69716 ]
...
[49.349625, 29.459223]
[49.346366, 29.472047]
[49.343107, 29.48487 ]]]
which defines a polygon like this one:
The polygon segments or edges are arr[0] for the top, arr[-1] bottom, arr[:, 0] left and arr[:, -1] right.
The polygon corners or vertices are arr[0][0], arr[0][-1], arr[-1][0], arr[-1][-1].
How can I create an image of country borders having this array? Please note that it is not a perfect rectangle. Also, the country name or other informations are not important, only the borders.
来源:https://stackoverflow.com/questions/57220788/create-country-borders-image-inside-a-specific-area