In the worldborders example, the attribute mpoly
is where the geographic polygon is actually stored.
In your example, you're going to want to access v.mpoly
You're not going to be able to use it directly however because mpoly
is itself a MultiPolygon
field. Consider a country like Canada that has a bunch of islands, each island and the main landmass is a polygon. So to arrive at your points and a complete description of Canada's borders you need to:
- Iterate over the polygons inside of multipolygon. Each polygon corresponds to an area (so your assumption in the example of one area per country is wrong).
- Iterate over the points inside of each polygon.
- Convert your point coordinates (latitude/longitude) into the coordinates used by your svg graphic.