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

Method prepareGeometry

kernels/TIndexKernel.cpp:800–823  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

798
799
800pdal::Polygon TIndexKernel::prepareGeometry(const FileInfo& fileInfo)
801{
802 using namespace gdal;
803
804 Polygon g(fileInfo.m_boundary, fileInfo.m_srs);
805 if (fileInfo.m_gridHeight && m_doSmooth)
806 {
807 double tolerance = 1.1 * fileInfo.m_gridHeight / 2;
808 double cull = (6 * tolerance * tolerance);
809 g.simplify(tolerance, cull);
810 if (g.wkt()[0] == 'P')
811 {
812 std::string multi = makeMultiPolygon(g.wkt());
813 g = Polygon(multi, fileInfo.m_srs);
814 }
815 }
816 if (m_tgtSrsString.size())
817 {
818 SpatialReference out(m_tgtSrsString);
819 g.transform(out);
820 }
821
822 return g;
823}
824
825
826std::string TIndexKernel::makeMultiPolygon(const std::string& wkt)

Callers

nothing calls this directly

Calls 5

simplifyMethod · 0.80
PolygonClass · 0.70
wktMethod · 0.45
sizeMethod · 0.45
transformMethod · 0.45

Tested by

no test coverage detected