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

Method transform

pdal/Geometry.cpp:198–219  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

196
197
198Utils::StatusWithReason Geometry::transform(SpatialReference out)
199{
200 using namespace Utils;
201
202 if (!srsValid() && out.empty())
203 return StatusWithReason();
204
205 if (!srsValid())
206 return StatusWithReason(-2,
207 "Geometry::transform() failed. NULL source SRS.");
208 if (out.empty())
209 return StatusWithReason(-2,
210 "Geometry::transform() failed. NULL target SRS.");
211
212 const OGRSpatialReference *inSrs = m_geom->getSpatialReference();
213 SrsTransform transform(*inSrs, OGRSpatialReference(out.getWKT().data()));
214 if (!transform.valid() || m_geom->transform(transform.get()) != OGRERR_NONE)
215 return StatusWithReason(-1, "Geometry::transform() failed.");
216
217 modified();
218 return StatusWithReason();
219}
220
221
222void Geometry::setSpatialReference(const SpatialReference& srs)

Callers 4

TESTFunction · 0.45
TESTFunction · 0.45
prepareGeometryMethod · 0.45
computeUTMZoneMethod · 0.45

Calls 8

StatusWithReasonClass · 0.85
OGRSpatialReferenceClass · 0.85
getSpatialReferenceMethod · 0.80
getWKTMethod · 0.80
emptyMethod · 0.45
dataMethod · 0.45
validMethod · 0.45
getMethod · 0.45

Tested by 2

TESTFunction · 0.36
TESTFunction · 0.36