From https://github.com/PDAL/PDAL/commit/516e33ad7f40e54affd5754617fbe26d70ef2dd4 From: Jorge Gustavo Rocha Date: Thu, 20 Apr 2023 13:11:46 +0100 Subject: [PATCH] prevent invalid conversion from const compile error (#4030) squashed with From https://github.com/dg0yt/PDAL/commit/49eb31840dc1c07d6ff235ea292c7c0703f8a884 From: Kai Pastor Date: Fri, 12 May 2023 07:44:59 +0200 Subject: [PATCH] Don't use const_cast Amends #4030. --- pdal/Geometry.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/pdal/Geometry.cpp b/pdal/Geometry.cpp index 10d185dbe4..8b010d3378 100644 --- a/pdal/Geometry.cpp +++ b/pdal/Geometry.cpp @@ -153,7 +153,7 @@ Geometry& Geometry::operator=(const Geometry& input) bool Geometry::srsValid() const { - OGRSpatialReference *srs = m_geom->getSpatialReference(); + const OGRSpatialReference *srs = m_geom->getSpatialReference(); return srs && srs->GetRoot(); } @@ -172,7 +172,7 @@ Utils::StatusWithReason Geometry::transform(SpatialReference out) return StatusWithReason(-2, "Geometry::transform() failed. NULL target SRS."); - OGRSpatialReference *inSrs = m_geom->getSpatialReference(); + const OGRSpatialReference *inSrs = m_geom->getSpatialReference(); SrsTransform transform(*inSrs, OGRSpatialReference(out.getWKT().data())); if (m_geom->transform(transform.get()) != OGRERR_NONE) return StatusWithReason(-1, "Geometry::transform() failed.");