Point class Null safety

A Point is a single position in a coordinate system, with properties. A Point can be created from a Coordinate, from a WKT String, or from a GeoJSON Map. A Point can be converted to a WKT String or GeoJSON Map.

Example:

Point(Coordinate(1, 2), {'name': 'point'}); // Point(Coordinate(1, 2), {'name': 'point'})
Point(Coordinate(1, 2), {'name': 'point'}).toWKT(); // POINT(1 2)
Point(Coordinate(1, 2), {'name': 'point'}).toJson(); // {'type': 'Feature', 'geometry': {'type': 'Point', 'coordinates': [1, 2]}, 'properties': {'name': 'point'}}
Inheritance

Constructors

Point(Coordinate coordinate, {dynamic properties = const <String, dynamic>{}})
Point.fromJson(Map<String, dynamic> json)
Creates a Point from a GeoJSON Map.
factory
Point.fromLatLong(double latitude, double longitude)
Creates a Point from a Lat/Long pair.
factory
Point.fromWKT(String wkt)
Creates a Point from a WKT String.
factory
Point.random()
Creates a Point randomly. Example:
factory

Properties

bbox BoundingBox
Returns the BoundingBox of the Point Note: SINGLE POINTS CANNOT BE BOUNDED. WILL ALWAYS RETURN BoundingBox.empty.
read-only, override
center Point
Get the center Point of the Point. Pretty useless, but needs to overwrite the Feature method.
read-only, override
coordinate Coordinate
read / write
hashCode int
The hash code for this object.
read-only, override
lat double
Get the latitude of the Point.
read-only
lng double
Get the longitude of the Point.
read-only
properties Map<String, dynamic>
read / write, inherited
runtimeType Type
A representation of the runtime type of the object.
read-only, inherited

Methods

explode() List<Point>
Explodes the Point into a list of Points Pretty useless, but needs to overwrite the Feature method.
override
isContainedIn(Feature feature) bool
Returns whether or not the Point is contained within the Polygon or MultiPolygon. Uses the Ray Casting algorithm.
noSuchMethod(Invocation invocation) → dynamic
Invoked when a non-existent method or property is accessed.
inherited
toJson() Map<String, dynamic>
Converts the Point to a GeoJSON Map.
override
toString() String
A string representation of this object.
override
toWKT() String
Converts the Point to a WKT String.
override

Operators

operator ==(Object other) bool
Checks for equality between two Points, specifically if they have the same coordinate and properties.
override

Static Properties

type String
final