Releases: csanfilippo/sfera
Releases · csanfilippo/sfera
Release list
0.1.0
The first release of sfera: RFC 7946 GeoJSON for Swift, valid by construction.
Highlights
- Every GeoJSON object type.
Position, all seven geometries (Point, LineString, Polygon, MultiPoint, MultiLineString, MultiPolygon, GeometryCollection),Feature,FeatureCollection, andGeoJSONfor decoding input of unknown kind. - Invalid values cannot exist. Coordinates are validated when a
Positionis created, with a typedPositionError. A line string needs two positions and a ring three vertices, both checked at compile time. - Rings close themselves, and polygons follow the right-hand rule. Rings given in the wrong direction are reversed, both when building a
Polygonand when decoding one. - Exact numbers. Whole numbers in properties and identifiers are stored as
Int64, so 64-bit identifiers survive a round trip exactly, also on 32-bit platforms. - Decoding enforces the same rules as the initializers, so a decoded value is always valid. Rejections are
DecodingErrors with the coding path of the offending value. Codable,SendableandHashablethroughout, with no third-party dependencies.
Platforms
Swift 6.4, on iOS, macOS, watchOS and tvOS 26, Linux, and WebAssembly (WASI). All are tested in CI. Embedded Swift is not supported.
Installation
.package(url: "https://github.com/csanfilippo/sfera.git", from: "0.1.0"),Known limitations
bboxand foreign members are not modelled: decoding ignores them, so they are lost in a round trip.- Encoding a
.numberholding NaN or infinity throws, because JSON cannot represent them.
The API may still change before 1.0. Breaking changes will bump the minor version.