MCPcopy Create free account
hub / github.com/RedisGraph/RedisGraph / _JsonEncoder_Point

Function _JsonEncoder_Point

src/util/json_encoder.c:134–148  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

132}
133
134static sds _JsonEncoder_Point(SIValue point, sds s) {
135 ASSERT(SI_TYPE(point) & T_POINT);
136
137 // default crs == wgs-84 till we support other CRS formats
138 s = sdscat(s, "{\"crs\":\"wgs-84\",\"latitude\":");
139
140 s = sdscatprintf(s, "%f", Point_lat(point));
141 s = sdscat(s, ",\"longitude\":");
142 s = sdscatprintf(s, "%f", Point_lon(point));
143
144 // height is not supported yet
145 s = sdscat(s, ",\"height\":null");
146 s = sdscat(s, "}");
147 return s;
148}
149
150static sds _JsonEncoder_Array(SIValue list, sds s) {
151 // open array with "["

Callers 1

_JsonEncoder_SIValueFunction · 0.85

Calls 4

sdscatFunction · 0.85
sdscatprintfFunction · 0.85
Point_latFunction · 0.85
Point_lonFunction · 0.85

Tested by

no test coverage detected