API with NestJS #183. Distance and radius in PostgreSQL with Drizzle ORM
Briefly

In PostgreSQL with PostGIS, calculating distances between geographical coordinates requires understanding Spatial Reference System Identifiers (SRID) crucial for accurate data interpretation.
Using SRID 4326 specifies latitude and longitude while SRID 3857 works with meter-based flat map coordinates, ensuring correct alignment of geographical data.
It is essential to define the SRID explicitly in PostGIS to avoid issues where coordinates from different systems are compared leading to incorrect results.
Currently, Drizzle ORM has a bug related to SRID, requiring manual adjustments in migrations to ensure that the PostGIS extension operates correctly.
Read at Marcin Wanago Blog - JavaScript, both frontend and backend
[
|
]