| 267 | } |
| 268 | |
| 269 | void TextWriter::processOneGeoJSON(PointRef& point) |
| 270 | { |
| 271 | if (m_idx > 0) |
| 272 | *m_stream << ","; |
| 273 | *m_stream << "{ \"type\":\"Feature\",\"geometry\": " |
| 274 | "{ \"type\": \"Point\", \"coordinates\": ["; |
| 275 | |
| 276 | m_stream->precision(m_xDim.precision); |
| 277 | *m_stream << point.getFieldAs<double>(Dimension::Id::X) << ","; |
| 278 | m_stream->precision(m_yDim.precision); |
| 279 | *m_stream << point.getFieldAs<double>(Dimension::Id::Y) << ","; |
| 280 | m_stream->precision(m_zDim.precision); |
| 281 | *m_stream << point.getFieldAs<double>(Dimension::Id::Z) << "]},"; |
| 282 | |
| 283 | *m_stream << "\"properties\": {"; |
| 284 | |
| 285 | for (auto di = m_dims.begin(); di != m_dims.end(); ++di) |
| 286 | { |
| 287 | if (di != m_dims.begin()) |
| 288 | *m_stream << ","; |
| 289 | |
| 290 | *m_stream << "\"" << di->name << "\":"; |
| 291 | *m_stream << "\""; |
| 292 | m_stream->precision(di->precision); |
| 293 | *m_stream << point.getFieldAs<double>(di->id); |
| 294 | *m_stream <<"\""; |
| 295 | } |
| 296 | *m_stream << "}"; // end properties |
| 297 | *m_stream << "}"; // end feature |
| 298 | } |
| 299 | |
| 300 | |
| 301 | bool TextWriter::processOne(PointRef& point) |