Use the near calculation from PostGIS. Also, ponies.