/**
 * This function takes two sets of geographic data and finds the intersection between them.
 *
 * @param geographicData1 A list of geographic data points.
 * @param geographicData2 Another list of geographic data points.
 * @return A list containing the common geographic data points between the two sets.
 */
fun findIntersection(geographicData1: List<Map<String, Double>>, geographicData2: List<Map<String, Double>>): List<Map<String, Double>> {

    val intersection = mutableListOf<Map<String, Double>>()

    // Iterate over each point in geographicData1
    for (point1 in geographicData1) {
        for (point2 in geographicData2) {
            // Check if the latitude and longitude of the two points match
            if (point1["latitude"] == point2["latitude"] && point1["longitude"] == point2["longitude"]) {
                intersection.add(point1)  // Add the common point to the intersection list
            }
        }
    }

    return intersection
}
/**
 * This function takes two sets of geographic data and finds the intersection between them.
 *
 * @param geographicData1 A list of geographic data points.
 * @param geographicData2 Another list of geographic data points.
 * @return A list containing the common geographic data points between the two sets.
 */
fun findIntersection(geographicData1: List<Map<String, Double>>, geographicData2: List<Map<String, Double>>): List<Map<String, Double>> {
/**
 * This function takes two sets of geographic data and finds the intersection between them.
 *
 * @param geographicData1 A list of geographic data points.
 * @param geographicData2 Another list of geographic data points.
 * @return A list containing the common geographic data points between the two sets.
 */
fun findIntersection(geographicData1: List<Map<String, Double>>, geographicData2: List<Map<String, Double>>): List<Map<String, Double>> {

    val intersection = mutableListOf<Map<String, Double>>()

    // Iterate over each point in geographicData1
    for (point1 in geographicData1) {
        for (point2 in geographicData2) {
            // Check if the latitude and longitude of the two points match
            if (point1["latitude"] == point2["latitude"] && point1["longitude"] == point2["longitude"]) {
                intersection.add(point1)  // Add the common point to the intersection list
            }
        }
    }

    return intersection
}