GeoValue class

Data to store location information.

Specify the latitude in latitude and longitude in longitude. Specify the radius of the range in radiusKm to generate a GeoHash accordingly.

Using distance and direction, you can calculate the distance and direction to other location information.

Using neighbors, you can get the surrounding GeoHash.

位置情報を保存するためのデータ。

latitudeに緯度、longitudeに経度を指定します。radiusKmに範囲の半径を指定するとそれに応じたGeoHashが生成されます。

distancedirectionを使うことで、他の位置情報との距離や方向を計算することができます。

neighborsを使うことで、周辺のGeoHashを取得することができます。

Implemented types
Available Extensions
Annotations

Constructors

GeoValue({required double latitude, required double longitude, double radiusKm = 1.0})
Data to store location information.
const

Properties

geoHash String
Returns a GeoHash that contains latitude and longitude and has a range of radiusKm.
no setter
hashCode int
The hash code for this object.
no setteroverride
latitude double
Latitude.
final
longitude double
Longitude.
final
neighbors List<String>
Returns the adjacent GeoHash.
no setter
radiusKm double
Radius to determine the extent of the GeoHash.
final
runtimeType Type
A representation of the runtime type of the object.
no setterinherited

Methods

compareTo(GeoValue other) int
Compares this object to another object.
override
copyWith({double? latitude, double? longitude, double? radiusKm}) GeoValue
Generate a new GeoValue.
direction(GeoValue target) double
Calculates the direction to target.
distanceKm(GeoValue target) double
Returns the distance to target.
noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
toString() String
A string representation of this object.
override
withRadius(double radiusKm) GeoValue
Specify radiusKm to generate a new GeoValue.

Operators

operator ==(Object other) bool
The equality operator.
override

Static Methods

directionBetween({required GeoValue to, required GeoValue from}) double
Calculates the direction from from to to.
distanceKmBetween({required GeoValue to, required GeoValue from}) double
Calculates the distance between from and to.
neighborsOf({required GeoValue center}) List<String>
Returns the neighboring GeoHash for center.