@@ -21,6 +21,17 @@ std::string MgValueToString(const mg::ConstValue &value) {
21
21
value_str = std::to_string (value.ValueBool ());
22
22
} else if (value.type () == mg::Value::Type::Double) {
23
23
value_str = std::to_string (value.ValueDouble ());
24
+ } else if (value.type () == mg::Value::Type::Point2d) {
25
+ auto point2d = value.ValuePoint2d ();
26
+ value_str += " Point2D({ srid:" + std::to_string (point2d.srid ()) +
27
+ " , x:" + std::to_string (point2d.x ()) +
28
+ " , y:" + std::to_string (point2d.y ()) + " })" ;
29
+ } else if (value.type () == mg::Value::Type::Point3d) {
30
+ auto point3d = value.ValuePoint3d ();
31
+ value_str += " Point3D({ srid:" + std::to_string (point3d.srid ()) +
32
+ " , x:" + std::to_string (point3d.x ()) +
33
+ " , y:" + std::to_string (point3d.y ()) +
34
+ " , z:" + std::to_string (point3d.z ()) + " })" ;
24
35
} else if (value.type () == mg::Value::Type::List) {
25
36
value_str += " [" ;
26
37
for (auto item : value.ValueList ()) {
@@ -63,7 +74,9 @@ int main(int argc, char *argv[]) {
63
74
64
75
if (!client->Execute (
65
76
" CREATE (:Person:Entrepreneur {id: 0, age: 40, name: 'John', "
66
- " isStudent: false, score: 5.0});" )) {
77
+ " isStudent: false, score: 5.0, "
78
+ " position2D: point({x: 1, y: 2, srid: 4326}), "
79
+ " position3D: point({x: 8, y: 9, z: 10, srid: 9757}) });" )) {
67
80
std::cerr << " Failed to add data." << std::endl;
68
81
return 1 ;
69
82
}
0 commit comments