Skip to content

Instantly share code, notes, and snippets.

View abdelghanyMh's full-sized avatar
🕵️
On the hunt for a new gig!

Mahammedi Abdelghani abdelghanyMh

🕵️
On the hunt for a new gig!
View GitHub Profile

Understanding Your Spring Boot Hibernate Spatial Solution

I'm glad the solution worked! Let's break down what happened and why it worked, which will help you understand the entire Spring Boot + Hibernate Spatial + GeoJSON + PostGIS stack better.

The Problem

You were experiencing an issue where your Point geometry field (cityCoordinates) wasn't being serialized correctly to JSON. Instead of getting a proper GeoJSON Point representation, you were getting a deeply nested structure with repeated "envelope" objects:

"cityCoordinates": {