Added function to translate from GPS coordinates to array indices