Defining Polygon Shapes in GeoJSON

Johan Louwers
2 min readJun 22, 2023

In geometry, a polygon is a closed two-dimensional shape with straight sides. It is formed by connecting multiple line segments called edges. A polygon consists of vertices (corner points) and edges that connect these vertices. The edges do not cross each other, and the last vertex is connected to the first vertex, creating a closed shape. Polygons can have different numbers of sides, ranging from three to infinity.

A polygon shape represents a specific instance of a polygon. It defines the exact coordinates of its vertices, allowing for the precise representation of the polygon on a two-dimensional plane. Polygons are commonly used to represent various geographic features such as land boundaries, city boundaries, lakes, or countries.

The below image shows a polygon shape which represents the postal code area 3273 in the Netherlands visualized in kepler.gl

Postal code area 3273 in the Netherlands

The above shape, when defined in a GeoJSON format looks, a bit, like the JSON structure below. the “a bit” part is because we did not show all coordinates pairs is a full set of 895 vertices, which is inconvient to display in a blogpost.

{
"type": "Feature",
"properties": {
"postalCode": "3273"
},
"geometry": {
"type": "Polygon",
"coordinates": [
[

[4.437842656838879, 51.79863262764456],
[4.437848550343165…

--

--

Johan Louwers

Johan Louwers is a technology enthousiasts with a long background in supporting enterprises and startups alike as CTO, Chief Enterprise Architect and developer.