/**
 * This function calculates the area of intersection between two geospatial areas.
 *
 * @param area1 The area of the first geospatial area.
 * @param area2 The area of the second geospatial area.
 * @return The area of intersection between the two geospatial areas.
 */
fun intersectionArea(area1: Float?, area2: Float?): Float? {

    var intersection: Float? = null

    // Check if both areas are valid
    if (area1 != null && area2 != null) {

        // Check if there is an area of intersection
        if (area1 > 0 || area2 > 0) {

            // Calculate the area of intersection
            intersection = minOf(area1, area2)
        }
    }

    return intersection
}
/**
 * This function calculates the area of intersection between two geospatial areas.
 *
 * @param area1 The area of the first geospatial area.
 * @param area2 The area of the second geospatial area.
 * @return The area of intersection between the two geospatial areas.
 */
fun intersectionArea(area1: Float?, area2: Float?): Float? {
/**
 * This function calculates the area of intersection between two geospatial areas.
 *
 * @param area1 The area of the first geospatial area.
 * @param area2 The area of the second geospatial area.
 * @return The area of intersection between the two geospatial areas.
 */
fun intersectionArea(area1: Float?, area2: Float?): Float? {

    var intersection: Float? = null

    // Check if both areas are valid
    if (area1 != null && area2 != null) {

        // Check if there is an area of intersection
        if (area1 > 0 || area2 > 0) {

            // Calculate the area of intersection
            intersection = minOf(area1, area2)
        }
    }

    return intersection
}