how to compare locations with x and y coordinates with other set of locations having x and y coordinates