added check for coordinate format of getNearest