🔙 Visualizing polygon with ST_AsGeoJSON and leaflet

ST_AsGeoJSON is a pretty neat function of postgis, and in fact is supported by many others databases.

It allows you to transform a regular polygon stored in your database to GeoJSON. Plenty of tools and applications adhere to that format, and you can use them visualize your polygons 😄.

After exporting the result looks something like the map below:

peaonunes © 2021, now built with Gatsby