MCPcopy Create free account
hub / github.com/PDAL/PDAL / processOneGeoJSON

Method processOneGeoJSON

io/TextWriter.cpp:269–298  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

267}
268
269void 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
301bool TextWriter::processOne(PointRef& point)

Callers

nothing calls this directly

Calls 3

precisionMethod · 0.45
beginMethod · 0.45
endMethod · 0.45

Tested by

no test coverage detected