Releases: Guria/gleojson
Releases · Guria/gleojson
v0.3.0
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
v0.2.0
First version that does makes sense
Major Features
- JSON Encoding: The
encode_geojson
function now returns a properjson.Json
type 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
FeatureId
type. - 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.