Polygon: Difference between revisions
Jump to navigation
Jump to search
No edit summary |
No edit summary |
||
| (2 intermediate revisions by the same user not shown) | |||
| Line 5: | Line 5: | ||
In [[GeoJSON]], a Polygon looks like this: | In [[GeoJSON]], a Polygon looks like this: | ||
< | <pre> | ||
{ | { | ||
"type": "Feature", | "type": "Feature", | ||
"properties": { "name": "Square" }, | "properties": { | ||
"geometry": { | "name": "Square" | ||
"type": "Polygon", | }, | ||
"coordinates": [[ | "geometry": { | ||
[0, 0], [1, 0], [1, 1], [0, 1], [0, 0] | "type": "Polygon", | ||
]] | "coordinates": [ | ||
[ | |||
[0, 0], [1, 0], [1, 1], [0, 1], [0, 0] | |||
] | |||
] | |||
} | |||
} | } | ||
</ | </pre> | ||
{{article end | {{article end | ||
Latest revision as of 13:53, 15 July 2026
A polygon is a 2D (flat) geometry made from straight line segments that connect end-to-end to form a closed loop.
Each individual polygon is still stored as a list of linear rings (outer boundary, plus optional holes). The outer array contains one entry per polygon.
In GeoJSON, a Polygon looks like this:
{
"type": "Feature",
"properties": {
"name": "Square"
},
"geometry": {
"type": "Polygon",
"coordinates": [
[
[0, 0], [1, 0], [1, 1], [0, 1], [0, 0]
]
]
}
}