File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -78,6 +78,14 @@ extension GeoJSON.GeometryObject: Codable {
7878 try container. encode ( triple, forKey: . coordinates)
7979 } else if let quatruple = coordinates as? [ [ [ [ Double ] ] ] ] {
8080 try container. encode ( quatruple, forKey: . coordinates)
81+ } else if let single = coordinates as? [ Decimal ] {
82+ try container. encode ( single, forKey: . coordinates)
83+ } else if let double = coordinates as? [ [ Decimal ] ] {
84+ try container. encode ( double, forKey: . coordinates)
85+ } else if let triple = coordinates as? [ [ [ Decimal ] ] ] {
86+ try container. encode ( triple, forKey: . coordinates)
87+ } else if let quatruple = coordinates as? [ [ [ [ Decimal ] ] ] ] {
88+ try container. encode ( quatruple, forKey: . coordinates)
8189 } else {
8290 throw CodingError . unsupportedCoordinateCount
8391 }
Original file line number Diff line number Diff line change @@ -465,7 +465,7 @@ public struct GeoJSON: Hashable {
465465 }
466466
467467
468- public func toData( options: JSONSerialization . WritingOptions ) throws -> Data {
468+ public func toData( options: JSONSerialization . WritingOptions = [ ] ) throws -> Data {
469469 return try JSONSerialization . data ( withJSONObject: toJSON ( ) , options: options)
470470 }
471471
You can’t perform that action at this time.
0 commit comments