PostgreSQL: Enable Earthdistance Module
July 25, 2015
If you need to do any dynamic distance calculations within a PostgreSQL database, I highly recommend the earthdistance module. We are currently using it for locating and sorting target entities within a set radius using geocoded addresses. Earthdistance takes care of all of the heavy lifting, and allows for much more efficient queries.
Here’s how you enable it within PostgreSQL: