Releases: Guria/gleojson
Releases · Guria/gleojson
v0.3.0
Major Features
- Unified GeoJSON Type: All GeoJSON types are now represented by a single
GeoJSONtype with phantom type parameters for better type safety and flexibility. - Strongly Typed Position: Introduced a new
Positiontype with distinct 2D and 3D variants, replacing the previous list-based representation. - Helper Functions: Added
position_2dandposition_3dfunctions 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
GeoJSONtype 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
Positiontype is now a variant type (Position2DorPosition3D) 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
GeoJSONtype. - Encoder and Decoder Signatures: The signatures of
encode_geojsonandgeojson_decoderhave 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
v0.2.0
First version that does makes sense
Major Features
- JSON Encoding: The
encode_geojsonfunction now returns a properjson.Jsontype instead ofdynamic.Dynamic, allowing for easy stringification withjson.to_string. - Flexible Property Handling: Added support for encoding and decoding arbitrary Feature properties, providing greater flexibility when working with custom GeoJSON structures.
- Improved Type Safety: Introduced more type-safe representations of GeoJSON structures, including a dedicated
FeatureIdtype. - Simplified Public API: The main encode and decode functions now cover all possible input types, streamlining the API.
Other Improvements
- Documentation: Significantly improved documentation, including more comprehensive docstrings and examples.
- Testing: Added more thorough test cases, including tests for real-life GeoJSON examples.
Full Changelog: v0.1.0...v0.2.0
v0.1.0
Full Changelog: https://github.com/Guria/gleojson/commits/v0.1.0
Disclaimer: Do not use this version. Code is mostly autogenerated and doesn't yet follow many spec requirements.
The encoder function is also useless, as it generates dynamic.Dynamic instead of a type that could be easily converted to JSON.