Using GeoJSON and postal codes for data visualizations

Johan Louwers
5 min readJun 22

Postal codes, also known as ZIP codes or postcode, are alphanumeric codes used in various countries to facilitate the sorting and delivery of mail. They serve as a convenient way to organize data records in a geographical manner, allowing for efficient processing and routing of postal items. While postal codes provide a means of ordering data, it’s important to note that they do not inherently represent specific geographical locations.

To visualize data based on postal code information on a map, true geographical data is required. This is because postal codes themselves do not directly correspond to precise geographic coordinates. While neighboring postal codes may indicate proximity, the actual physical location within a postal code area can vary significantly.

When working with simple geographical data, one approach is to use GeoJSON (Geographic JavaScript Object Notation). GeoJSON is a format used to represent geographical features, such as points, lines, and polygons, in a structured manner. It provides a standard way to encode geographic data and is widely supported by mapping libraries and tools.

In the context of postal codes, GeoJSON can be utilized to define the boundaries of postal code areas as polygons. A polygon is a geometric shape that consists of a closed loop of connected points, representing an enclosed region on a map. By defining the postal code area as a polygon in GeoJSON, it becomes possible to overlay and visualize this area accurately on a map.

Additionally, GeoJSON allows for the definition of the centroid of the postal code area as a point. The centroid represents the center point of a polygon, which can be used as a reference for displaying the general location of the postal code area on a map. This centroid point provides a useful visual representation, especially when dealing with larger postal code areas that encompass multiple points of interest.

By leveraging GeoJSON to define postal code areas as polygons and centroids, it becomes easier to visualize and analyze data in a spatial context. Mapping libraries and GIS (Geographic Information System) tools often provide functionalities to process and display GeoJSON data, enabling the creation of visually informative maps based on postal code…

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.