We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 14c33a5 commit 2542121Copy full SHA for 2542121
1 file changed
Sources/AgroAPI/AgroProtocol.swift
@@ -43,15 +43,15 @@ public struct AgroPolygon: Codable {
43
public let name: String
44
public let geo_json: Feature
45
46
- init(name: String, coords: [[[Double]]]) {
+ public init(name: String, coords: [[[Double]]]) {
47
self.name = name
48
let prop = Properties(name: nil)
49
let geom = Geometry(type: "Polygon", coordinates: coords)
50
self.geo_json = Feature(type: "Feature", properties: prop, geometry: geom)
51
}
52
53
/// check that the coords are polygons, and that the first and last positions of all polygons contain the same value.
54
- func isValidPoly() -> Bool {
+ public func isValidPoly() -> Bool {
55
for coords in geo_json.geometry.coordinates {
56
if coords.count < 3 { return false }
57
if coords.first != coords.last { return false }
0 commit comments