<commit_before>//
//  GKBounds.swift
//  Pods
//
//  Created by <NAME> on 15/03/16.
//
//

import Foundation
import CoreLocation
import AEXML

public final class GKBounds {
    public var minimumCoordinate: CLLocationCoordinate2D?
    public var maximumCoordinate: CLLocationCoordinate2D?
}

extension GKBounds: GKMappable {
    
    convenience init?(fromElement element: AEXMLElement) {
        // When the element misses some coordinate data, don't create the instance.
        guard let minimumLatitude = element.attributes["minlat"], let minimumLongitude = element.attributes["minlon"], let maximumLatitude = element.attributes["maxlat"], let maximumLongitude = element.attributes["maxlon"] else {
            return nil
        }
        self.init()
        
        minimumCoordinate <~ (Double(minimumLatitude)!, Double(minimumLongitude)!)
        maximumCoordinate <~ (Double(maximumLatitude)!, Double(maximumLongitude)!)
    }
    
}<commit_msg>Add the bounds documentation.<commit_after>//
//  GKBounds.swift
//  Pods
//
//  Created by <NAME> on 15/03/16.
//
//

import Foundation
import CoreLocation
import AEXML

/**
 The bounds define the extend of the GPX file. The area of the rectangle _-defined by the minimum coordinate and the maximum coordinate-_ will contain the entire GPX region.
*/
public final class GKBounds {
    /// The minimum coordinate used for the calculation of the region rectangle.
    public var minimumCoordinate: CLLocationCoordinate2D?
    /// The maximum coordinate used for the calculation of the region rectangle.
    public var maximumCoordinate: CLLocationCoordinate2D?
}

extension GKBounds: GKMappable {
    
    convenience init?(fromElement element: AEXMLElement) {
        // When the element misses some coordinate data, don't create the instance.
        guard let minimumLatitude = element.attributes["minlat"], let minimumLongitude = element.attributes["minlon"], let maximumLatitude = element.attributes["maxlat"], let maximumLongitude = element.attributes["maxlon"] else {
            return nil
        }
        self.init()
        
        minimumCoordinate <~ (Double(minimumLatitude)!, Double(minimumLongitude)!)
        maximumCoordinate <~ (Double(maximumLatitude)!, Double(maximumLongitude)!)
    }
    
}
{'fraction_non_alphanumeric': 0.09343323049801674, 'fraction_numerical': 0.007051564565888057, 'mean_word_length': 3.4422700587084147, 'pattern_counts': {'":': 0, '<': 9, '<?xml version=': 0, '>': 5, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '6866539', 'n_tokens_mistral': 628, 'n_tokens_neox': 610, 'n_words': 188}