-
Notifications
You must be signed in to change notification settings - Fork 7
/
Copy pathpoint.dart
43 lines (33 loc) · 977 Bytes
/
point.dart
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
part of backendless_sdk;
class Point extends Geometry {
static final double precision = 0.000000001;
static const String geoJsonType = "Point";
static const String wktType = "POINT";
double x;
double get longitude => x;
set longitude(double longitude) => x = longitude;
double y;
double get latitude => y;
set latitude(double latitude) => y = latitude;
@override
bool operator ==(other) =>
other is Point &&
(other.x - x).abs() < Point.precision &&
(other.y - y).abs() < Point.precision;
@override
int get hashCode => Object.hash(x, y, srs);
Point({this.x = 0.0, this.y = 0.0, SpatialReferenceSystem? srs})
: super(srs: srs);
@override
String getWktType() => Point.wktType;
@override
String getGeoJsonType() => Point.geoJsonType;
@override
String getWktCoordinatePairs() {
return "$x" + " " + "$y";
}
@override
String getJsonCoordinatePairs() {
return "[" + "$x" + "," + "$y" + "]";
}
}