The C++ REST SDK is a Microsoft project for cloud-based client-server communication in native code using a modern asynchronous C++ API design. This project aims to help C++ developers connect to and interact with services.
Other
7.97k
stars
1.65k
forks
source link
GeoJSON parse coordinates and set values to custom structure #1614
auto array = value.as_object()["coordinates"].as_array();
for(auto v = array.begin() ; v < array.end() ; v++ ){
auto a = (*v).as_array();
coords.push_back(createCoord(a));
}
amp::AmpFeature::coordinate createCoord(web::json::array coordsJson) {
coord c;
if(a.size() == XY){
c.lon = a.at(0).as_double();
c.lat = a.at(1).as_double();
}
}
In the above code I need some other way to set the structure values. This is done using cpprest-sdk json parser. We are fetching the data from sqlite db.
We are dealing with tens of thousands of such lineString geometries. Is there more efficient and faster way to set these values?
I need to set GeoJSON coordinates to this structure:
My sample JSON:
The code snippet:
In the above code I need some other way to set the structure values. This is done using cpprest-sdk json parser. We are fetching the data from sqlite db.
We are dealing with tens of thousands of such lineString geometries. Is there more efficient and faster way to set these values?
Environment : OS : Ubuntu 18.04 C++ version : 17