location column typed as GEOGRAPHY(POINT, 4326) to the Users, FormSubmissions, and Addresses tables. Put a GIST index on the technician column to keep spatial filtering fast. Wrote a Sequelize beforeSave hook that converts the legacy latitude and longitude fields into a GEOGRAPHY point on every save, so existing API endpoints kept working without modification. The dispatcher endpoint now geocodes an inbound address, applies ST_DWithin against a 50-mile radius, computes ST_Distance as a selected column, and orders results nearest-first. One indexed query, no application-side coordination.Posted Sep 13, 2026
Integrated PostGIS in PostgreSQL for optimizing technician dispatch with geospatial queries.