Selecting location data from a spatial database