chuyentt / geojson_vi

An Open-Source Dart and Flutter Library for Efficiently Handling GeoJSON Data in Compliance with RFC 7946
https://pub.dev/packages/geojson_vi
MIT License
15 stars 10 forks source link

Range error during equalize polygons, multi polygons or multi line strings #23

Closed dmisiek closed 6 months ago

dmisiek commented 6 months ago

Describe the bug During equality some cases of GeoJSONPolygon, GeoJSONMultiPolygon or GeoJSONMultiLineString it throws RangeError.

To Reproduce

  1. Create variable polygon1 as type GeoJSONPolygon with some vertices (for example 10)
  2. Create second variable polygon2 with same type, but with less quantity of vertices (for exmaple 5)
  3. Equal polygon1 == polygon2 - it will throw an RangeError (index): Invalid value: Not in inclusive range 0..4: 5

I have created sample Flutter project for testing where FilledButton with primary color throws described error (tonals makes equalities which working as expected): https://github.com/dmisiek/geojson_vi_test

Expected behavior Not throwing an RangeError during equality GeoJSONPolygon, GeoJSONMultiPolygon or GeoJSONMultiLineString.

Screenshots image

Desktop

Smartphone:

Additional context