Skip to content

Commit 4937997

Browse files
authored
Fix boundingBox.center when spanning antimeridian (#13)
1 parent 57b356d commit 4937997

1 file changed

Lines changed: 1 addition & 1 deletion

File tree

Sources/GeoJSONKitTurf/Turf+BoundingBox.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@ extension GeoJSON.BoundingBox {
3232
public var center: GeoJSON.Position {
3333
.init(
3434
latitude: (southWesterlyLatitude + northEasterlyLatitude) / 2,
35-
longitude: (southWesterlyLongitude + northEasterlyLongitude) / 2
35+
longitude: (southWesterlyLongitude + northEasterlyLongitude) / 2 + (spansAntimeridian ? 180 : 0)
3636
)
3737
}
3838

0 commit comments

Comments
 (0)