poly library

Library for checking if given point is present in Polygon or not

Classes

Point<T extends num>
A utility class for representing two-dimensional positions.
Polygon
A class for representing two-dimensional Polygon defined with List<Point<num>> points.

Functions

containsSpace(String inputString) → bool
  • returns true if String contains Space
  • csvToListOfList(dynamic csvString, { bool noHeader: false }) → Future<List<List>>
  • Returns Future<List<List>> based on csvString
    • which then can be used - convert that list into Polygon
  • Optional parameter: bool noHeader
    • By passing optional parameter: noHeader as true, Resulting List will not contain header row
    • Default value false
  • csvToPoly(dynamic csvString, { bool isReversed: false }) → Future<Polygon>
  • Returns Future<Polygon> based on csvString
  • csvString may or may not contain header row
  • This function checks if latitude,longitude or x,y are reversed
    • By checking Header row label
    • i.e. By checking 1st row 1st element is neither "longitude" or "y"
    • If they are reversed, Returned Polygon will be Polygon(latitude,longitude), instead of Polygon(longitude,latitude)
    • This can be manually set by passing optional parameter: isReversed as true
  • Optional parameter: isReversed
    • isReversed has default value = false
  • listAppend(List one, List two) → List
    pointsToList(List<Point<num>> inputListOfPoint) → List<List<num>>
    List<Point> to List<List (x,y)>
    pointToList(Point<num> inPoint) → List<num>
    Point to List<num>
    toListListNum(List _inputListOfList, { bool swapXAndY: false, bool replaceWithZero: false }) → List<List<num>>
    Returns List<List<num>> from a List<List<dynamic>> [...]
    toListNum(List _inputList, { bool reverseIt: false, bool replaceWithZero: false, bool sizeTwo: true }) → List<num>
    Returns List<num> from a List<dynamic> [...]
    toListOfPoint(List<List<num>> list_of_list) → List<Point<num>>
    List<List (x,y)> to List<Point>
    toPoint(List<num> list_of_xy) Point<num>
    List<num> to Point
    toPolyFromListOfList(List<List<num>> list_of_list) Polygon
    List<List (x,y)> to Polygon

    Exceptions / Errors

    NeedsAtLeastThreePoints
  • NeedsAtLeastThreePoints is thrown if Polygon.points contains less than 3 points
  • WrongSizeForPoint
  • WrongSizeForPoint is thrown if to_Point() has more or less than 2 element. Point has only x and y.