Point class
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'}}
Constructors
-
Point(Coordinate coordinate, {Map<
String, 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.
no setteroverride
- center → Point
-
Get the center Point of the Point.
Pretty useless, but needs to overwrite the Feature method.
no setteroverride
- coordinate ↔ Coordinate
-
getter/setter pair
- hashCode → int
-
The hash code for this object.
no setteroverride
- lat → double
-
Get the latitude of the Point.
no setter
- lng → double
-
Get the longitude of the Point.
no setter
-
properties
↔ Map<
String, dynamic> -
getter/setter pairinherited
- runtimeType → Type
-
A representation of the runtime type of the object.
no setterinherited
Methods
-
buffer(
double distance, {DistanceUnit? unit, int steps = 40}) → Polygon -
Returns a buffer Polygon of
distance
around the Point. The defaultunit
isDistanceUnit.meters
. The defaultsteps
is 40. -
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 nonexistent 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 +(
Feature other) → FeatureCollection -
Adds two Features together to form a FeatureCollection.
Each Feature in the FeatureCollection will retain their properties and
coordinates
.inherited -
operator ==(
Object other) → bool -
Checks for equality between two Points, specifically if they have the same coordinate and properties.
override