Skip to content

Commit

Permalink
Clearer naming for ogr-create-srs utility function.
Browse files Browse the repository at this point in the history
  • Loading branch information
connormanning committed Jun 7, 2017
1 parent 22014fc commit f371cb6
Showing 1 changed file with 13 additions and 13 deletions.
26 changes: 13 additions & 13 deletions pdal/SpatialReference.cpp
Expand Up @@ -73,7 +73,7 @@ struct OGRDeleter
using OGRScopedSpatialReference =
std::unique_ptr<OGRSpatialReference, OGRDeleter>;

OGRScopedSpatialReference ogrCreate(std::string s = "")
OGRScopedSpatialReference ogrCreateSrs(std::string s = "")
{
return OGRScopedSpatialReference(
static_cast<OGRSpatialReference*>(
Expand All @@ -99,7 +99,7 @@ bool SpatialReference::empty() const

bool SpatialReference::valid() const
{
OGRScopedSpatialReference current(ogrCreate(m_wkt));
OGRScopedSpatialReference current(ogrCreateSrs(m_wkt));
if (!current)
return false;

Expand Down Expand Up @@ -180,7 +180,7 @@ std::string SpatialReference::getVertical() const
{
std::string tmp;

OGRScopedSpatialReference poSRS = ogrCreate(m_wkt);
OGRScopedSpatialReference poSRS = ogrCreateSrs(m_wkt);

// Above can fail if m_wkt is bad.
if (!poSRS)
Expand All @@ -206,7 +206,7 @@ std::string SpatialReference::getVerticalUnits() const

std::string wkt = getVertical();
const char* poWKT = wkt.c_str();
OGRScopedSpatialReference poSRS = ogrCreate(m_wkt);
OGRScopedSpatialReference poSRS = ogrCreateSrs(m_wkt);
if (poSRS)
{
OGR_SRSNode* node = poSRS->GetAttrNode("VERT_CS");
Expand All @@ -231,7 +231,7 @@ std::string SpatialReference::getHorizontal() const
{
if (m_horizontalWkt.empty())
{
OGRScopedSpatialReference poSRS = ogrCreate(m_wkt);
OGRScopedSpatialReference poSRS = ogrCreateSrs(m_wkt);

if (poSRS)
{
Expand All @@ -250,7 +250,7 @@ std::string SpatialReference::getHorizontalUnits() const
{
std::string wkt = getHorizontal();
const char* poWKT = wkt.c_str();
OGRScopedSpatialReference poSRS = ogrCreate(m_wkt);
OGRScopedSpatialReference poSRS = ogrCreateSrs(m_wkt);

if (!poSRS)
return std::string();
Expand All @@ -272,8 +272,8 @@ bool SpatialReference::equals(const SpatialReference& input) const
if (getWKT() == input.getWKT())
return true;

OGRScopedSpatialReference current = ogrCreate(getWKT());
OGRScopedSpatialReference other = ogrCreate(input.getWKT());
OGRScopedSpatialReference current = ogrCreateSrs(getWKT());
OGRScopedSpatialReference other = ogrCreateSrs(input.getWKT());

if (!current || !other)
return false;
Expand Down Expand Up @@ -305,7 +305,7 @@ const std::string& SpatialReference::getName() const

bool SpatialReference::isGeographic() const
{
OGRScopedSpatialReference current = ogrCreate(m_wkt);
OGRScopedSpatialReference current = ogrCreateSrs(m_wkt);
if (!current)
return false;

Expand All @@ -316,7 +316,7 @@ bool SpatialReference::isGeographic() const

bool SpatialReference::isGeocentric() const
{
OGRScopedSpatialReference current = ogrCreate(m_wkt);
OGRScopedSpatialReference current = ogrCreateSrs(m_wkt);
if (!current)
return false;

Expand Down Expand Up @@ -384,7 +384,7 @@ std::string SpatialReference::prettyWkt(const std::string& wkt)
{
std::string outWkt;

OGRScopedSpatialReference srs = ogrCreate(wkt);
OGRScopedSpatialReference srs = ogrCreateSrs(wkt);
if (!srs)
return outWkt;

Expand All @@ -403,11 +403,11 @@ int SpatialReference::computeUTMZone(const BOX3D& box) const
if (empty())
return 0;

OGRScopedSpatialReference current = ogrCreate(m_wkt);
OGRScopedSpatialReference current = ogrCreateSrs(m_wkt);
if (!current)
throw pdal_error("Could not fetch current SRS");

OGRScopedSpatialReference wgs84 = ogrCreate();
OGRScopedSpatialReference wgs84 = ogrCreateSrs();

if (OSRSetFromUserInput(wgs84.get(), "EPSG:4326") != OGRERR_NONE)
{
Expand Down

0 comments on commit f371cb6

Please sign in to comment.