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

invariant.dart getCoords return type #108

Closed armantorkzaban closed 2 years ago

armantorkzaban commented 2 years ago

It now returns a List, without checking the types of the contents, which should be Position. @lukas-h, what do you think?

lukas-h commented 2 years ago

This line, right? https://github.com/dartclub/turf_dart/blob/1e8329739cab41417a51b58f079d00d002982d06/lib/src/invariant.dart#L56

lukas-h commented 2 years ago

Maybe we should check for List<CoordinateType>, but there might be some other reason, why we implemented it that way.

armantorkzaban commented 2 years ago

It is about coordinates, in other words we are dealing with Positions. I do not see any reference to or need for BBox, therefore I would suggest we return a list of positions in that case.

lukas-h commented 2 years ago

Ok then, go ahead

lukas-h commented 2 years ago

We decided to leave it as it is, because we don't want to have too strict type checking for cases like nested lists of Position.