| 334 | |
| 335 | |
| 336 | std::string Geometry::json(double precision) const |
| 337 | { |
| 338 | CPLStringList aosOptions; |
| 339 | std::string p(std::to_string((int)precision)); |
| 340 | aosOptions.SetNameValue("COORDINATE_PRECISION", p.data()); |
| 341 | |
| 342 | char* json = OGR_G_ExportToJsonEx(gdal::toHandle(m_geom.get()), |
| 343 | aosOptions.List()); |
| 344 | std::string output(json); |
| 345 | OGRFree(json); |
| 346 | return output; |
| 347 | } |
| 348 | |
| 349 | |
| 350 | void Geometry::clear() |