getH3UnidirectionalEdgeBoundary method

  1. @override
List<GeoCoord> getH3UnidirectionalEdgeBoundary(
  1. BigInt edgeIndex
)
override

Get the vertices of a given edge as an array of lat, lng points. Note that for edges that cross the edge of an icosahedron face, this may return 3 coordinates.

Implementation

@override
List<GeoCoord> getH3UnidirectionalEdgeBoundary(BigInt edgeIndex) {
  return using((arena) {
    final out = arena<c.GeoBoundary>();
    _h3c.getH3UnidirectionalEdgeBoundary(edgeIndex.toInt(), out);
    final coordinates = <GeoCoord>[];
    for (var i = 0; i < out.ref.numVerts; i++) {
      coordinates
          .add(out.ref.verts[i].toPure().toDegrees(_geoCoordConverter));
    }
    return coordinates;
  });
}