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

Method computeUTMZone

pdal/SpatialReference.cpp:572–593  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

570
571
572int SpatialReference::computeUTMZone(const BOX3D& cbox) const
573{
574 SrsTransform transform(*this, SpatialReference("EPSG:4326"));
575
576 // We made the argument constant so copy so that we can modify.
577 BOX3D box(cbox);
578
579 transform.transform(box.minx, box.miny, box.minz);
580 transform.transform(box.maxx, box.maxy, box.maxz);
581
582 int minZone = calculateZone(box.minx, box.miny);
583 int maxZone = calculateZone(box.maxx, box.maxy);
584
585 if (minZone != maxZone)
586 {
587 std::ostringstream msg;
588 msg << "computeUTMZone failed due to zone crossing. Zones "
589 "are " << minZone << " and " << maxZone << ".";
590 throw pdal_error(msg.str());
591 }
592 return minZone;
593}
594
595
596MetadataNode SpatialReference::toMetadata() const

Callers 1

TESTFunction · 0.80

Calls 3

strMethod · 0.80
SpatialReferenceClass · 0.70
transformMethod · 0.45

Tested by 1

TESTFunction · 0.64