38 m_id = json_node[
"gcpId"].asString();
40 m_id = json_node[
"pointId"].asString();
42 if (json_node.isMember(
"lat") && json_node.isMember(
"lon") && json_node.isMember(
"hgt"))
45 refGpt.
lat = json_node[
"lat"].asDouble();
46 refGpt.
lon = json_node[
"lon"].asDouble();
47 refGpt.
hgt = json_node[
"hgt"].asDouble();
50 else if (json_node.isMember(
"x") && json_node.isMember(
"y") && json_node.isMember(
"z"))
52 m_gcp.
x() = json_node[
"x"].asDouble();
53 m_gcp.
y() = json_node[
"y"].asDouble();
54 m_gcp.
z() = json_node[
"z"].asDouble();
58 xmsg<<
"Ground point coordinates JSON not correct. JSON: \n"<<json_node.toStyledString()<<endl;
62 const Json::Value& covariance = json_node[
"covariance"];
63 unsigned int covSize = covariance.size();
64 if ((covSize != 6) || (covSize != 9))
66 xmsg<<
"No covariance information in JSON or not correctly formatted (must be 6 or 9 element array)";
94 if (json_node.isMember(
"crossCovariances") || json_node.isMember(
"gpCrossCovList"))
97 " capability is not yet implemented!"<<endl;
104 json_node[
"gcpId"] =
m_id;
107 json_node[
"X"] =
m_gcp.
x();
108 json_node[
"Y"] =
m_gcp.
y();
109 json_node[
"Z"] =
m_gcp.
z();
111 Json::Value covJson (Json::arrayValue);
119 json_node[
"covariance"] = covJson;
std::basic_ostringstream< char > ostringstream
Class for char output memory streams.
NEWMAT::SymmetricMatrix m_covariance
This code was derived from https://gist.github.com/mshockwave.
ossim_float64 hgt
Height in meters above the ellipsiod.
virtual ~GroundControlPoint()
virtual void loadJSON(const Json::Value &json)
virtual void saveJSON(Json::Value &json) const
OSSIMDLLEXPORT std::ostream & ossimNotify(ossimNotifyLevel level=ossimNotifyLevel_WARN)