Major Features
- Unified GeoJSON Type: All GeoJSON types are now represented by a single
GeoJSON
type with phantom type parameters for better type safety and flexibility. - Strongly Typed Position: Introduced a new
Position
type with distinct 2D and 3D variants, replacing the previous list-based representation. - Helper Functions: Added
position_2d
andposition_3d
functions to easily create strongly typed Position objects. - Improved Type Safety: The use of phantom types allows for better compile-time checks and more precise type information.
- Simplified Decoders: Refactored and simplified the decoding logic for better performance and maintainability.
Breaking Changes
- GeoJSON Type Structure: The
GeoJSON
type now uses phantom types to distinguish between different GeoJSON object types. This changes how GeoJSON objects are constructed and used throughout the API. - Position Representation: The
Position
type is now a variant type (Position2D
orPosition3D
) instead of a list of floats. This affects all functions and types that use or return Position objects. - Geometry Types: Separate types for Geometry, Feature, FeatureCollection have been replaced with variants of the unified
GeoJSON
type. - Encoder and Decoder Signatures: The signatures of
encode_geojson
andgeojson_decoder
have changed to accommodate the new type structure.
Other Improvements
- Code Organization: Improved overall code structure for better readability and maintainability.
- Documentation: Updated and expanded documentation to reflect the new type system and usage patterns.
- Examples: Updated examples in tests and documentation to demonstrate the use of the new API.
Full Changelog: v0.2.0...v0.3.0