
Building Location-Based AR Content Discovery with PostGIS and Three.js
When I started building a location-based AR platform, the part I thought would be easy turned out to be the hardest: efficiently querying which AR objects are "near" a user in real time, then rendering them correctly in 3D space relative to the camera. GPS coordinates feel simple until you're trying to do spatial radius queries on thousands of user-placed objects and then translate those coordinates into a Three.js scene that doesn't drift or jitter as the user moves. This post is about that problem. If you're building anything with geo-anchored content — AR apps, location games, place-based social features — you've probably run into the same wall. The Core Problem: Bridging GPS Space and 3D Render Space GPS gives you latitude and longitude (and sometimes altitude). Three.js works in a local coordinate system measured in meters (or whatever unit you define). These two worlds don't talk to each other naturally. The naive approach is to just subtract coordinates: // DON'T do this const d
Continue reading on Dev.to Tutorial
Opens in a new tab


