You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Get rid of the ToCells and ToGeo trait.
The API was quite bad tbh, even if it wasn't too visible on the surface.
It was the result of me rushing the last mile to push out the 0.1
version.
For example, we are always passing a `PolyfillConfig` but it only makes
sense for Polygon and MultiPolygon...
The worst offender here is the ugly hack that sweeps under the rug any
errors generated by `Line`/`LineString`/`MultiLineString`, returning
empty set of cells in that case. It was documented to give me good
conscience, but let's be honnest here: nobody ever saw it (trait docs
are not easily discoverable) and it's still a broken/flawed API to begin
with...
They also made evolution harder. Like it would make sense to have
multithread implementation of some algorithm for `Polygon`, but
retrofitting a trait that also handles `Point` is kinda ugly
Of course, I could add another trait, but then I may tear down the whole
things since I'm at it.
So, let's revisit the bridging between H3 cell indexes and geometry types.
- `Point` and `MultiPoint` can be handled by the caller by going through
the `LatLng` type.
- `Line`, `LineString` and `MultiLineString` are now convertible to set
of cells using the `Plotter` object, which doesn't hide the fact that
it's a faillible operation even on valid geometries (due to current
implementation limitation)
- `Polygon` and `MultiPolygon` are now convertible to set of cells using
the `Tiler` object.
- `Geometry` and `GeometryCollection` are no longer supported since it
requires some trade-off that should be left upon the caller and not
enforced by the library.
- `GeoJSON` support is also gone, it was always a bit out of place to
begin with (why this format and not others? the true reason is that
made debugging easier during the initial development and I left it
here after the release)
Remove `geoJSON` support for output as well.
The trait was also cumbersome to use (though not as bad as ToCells`) due
to the mix of faillible and infallible implementation.
Now the infallible versions are implemented as `From` and the complex
case (set of cell indexes) has a dedicated interface through the new
`Dissolver` entity.
All those changes are a first step toward the stabilization of the API
and the release of the 1.0 at some point.
0 commit comments