dartclub / turf_dart

A turf.js-like geospatial analysis library working with GeoJSON, written in pure Dart.
https://pub.dev/packages/turf
MIT License
67 stars 30 forks source link

Override hashCode and overload == operator for GeoJSON types #45

Open lukas-h opened 2 years ago

lukas-h commented 2 years ago

as discussed in #43

tobrun commented 2 years ago

:+1: on this issue, to be able to scale the functionality of this library, this is a must have feature.

For context, was adding a new functionality and couldn't easily compare two FeatureCollections:

GeoJSONObject actual = flip(GeoJSONObject.fromJson(json));
GeoJSONObject expected = GeoJSONObject.fromJson(flippedJson);
expect(actual, expected);
lukas-h commented 2 years ago

Hi @tobrun,

we are currently working on a separate library that offers equality functions for the more complex data types of geojson. https://github.com/dartclub/turf_equality The lib is based on: https://www.npmjs.com/package/geojson-equality

We have to find a way to combine the new lib into turf_dart at a later point.

And I still think it's a problem if we override == with a really performance hungry function that can compare e.g. highly nested FeatureCollections.

CC @armantorkzaban

lukas-h commented 2 years ago

–> DECISION: What should be done with booleanEqual?