Skip to content

Releases: Guria/gleojson

v0.3.0

03 Oct 15:43
Compare
Choose a tag to compare

Major Features

  1. Unified GeoJSON Type: All GeoJSON types are now represented by a single GeoJSON type with phantom type parameters for better type safety and flexibility.
  2. Strongly Typed Position: Introduced a new Position type with distinct 2D and 3D variants, replacing the previous list-based representation.
  3. Helper Functions: Added position_2d and position_3d functions to easily create strongly typed Position objects.
  4. Improved Type Safety: The use of phantom types allows for better compile-time checks and more precise type information.
  5. Simplified Decoders: Refactored and simplified the decoding logic for better performance and maintainability.

Breaking Changes

  1. 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.
  2. Position Representation: The Position type is now a variant type (Position2D or Position3D) instead of a list of floats. This affects all functions and types that use or return Position objects.
  3. Geometry Types: Separate types for Geometry, Feature, FeatureCollection have been replaced with variants of the unified GeoJSON type.
  4. Encoder and Decoder Signatures: The signatures of encode_geojson and geojson_decoder have changed to accommodate the new type structure.

Other Improvements

  1. Code Organization: Improved overall code structure for better readability and maintainability.
  2. Documentation: Updated and expanded documentation to reflect the new type system and usage patterns.
  3. 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

02 Oct 08:06
Compare
Choose a tag to compare

First version that does makes sense

Major Features

  1. JSON Encoding: The encode_geojson function now returns a proper json.Json type instead of dynamic.Dynamic, allowing for easy stringification with json.to_string.
  2. Flexible Property Handling: Added support for encoding and decoding arbitrary Feature properties, providing greater flexibility when working with custom GeoJSON structures.
  3. Improved Type Safety: Introduced more type-safe representations of GeoJSON structures, including a dedicated FeatureId type.
  4. Simplified Public API: The main encode and decode functions now cover all possible input types, streamlining the API.

Other Improvements

  1. Documentation: Significantly improved documentation, including more comprehensive docstrings and examples.
  2. Testing: Added more thorough test cases, including tests for real-life GeoJSON examples.

Full Changelog: v0.1.0...v0.2.0

v0.1.0

30 Sep 16:02
Compare
Choose a tag to compare

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.