Implement and test location queries.