libLAS API Reference (svn-trunk)
liblas::SpatialReference Class Reference

Spatial Reference System container for libLAS. More...

#include <spatialreference.hpp>

Collaboration diagram for liblas::SpatialReference:
Collaboration graph

Public Types

enum  WKTModeFlag { eHorizontalOnly = 1 , eCompoundOK = 2 }
enum  GeoVLRType { eGeoTIFF = 1 , eOGRWKT = 2 }

Public Member Functions

 SpatialReference ()
 Default constructor.
 ~SpatialReference ()
 Destructor.
 SpatialReference (std::vector< VariableRecord > const &vlrs)
 Constructor creating SpatialReference instance from given Variable-Length Record.
 SpatialReference (SpatialReference const &other)
 Copy constryctor.
SpatialReference & operator= (SpatialReference const &rhs)
 Assignment operator.
bool operator== (const SpatialReference &other) const
bool operator!= (const SpatialReference &other) const
const GTIF * GetGTIF ()
 Returns a pointer to the internal GTIF*.
void SetGTIF (GTIF *pgtiff, ST_TIFF *ptiff)
std::string GetWKT (WKTModeFlag mode_flag=eHorizontalOnly) const
 Returns the OGC WKT describing Spatial Reference System.
std::string GetWKT (WKTModeFlag mode_flag, bool pretty) const
void SetWKT (std::string const &v)
 Sets the SRS using GDAL's OGC WKT.
void SetVerticalCS (int32_t verticalCSType, std::string const &citation=std::string(0), int32_t verticalDatum=-1, int32_t verticalUnits=9001)
 Sets the vertical coordinate system using geotiff key values.
void SetFromUserInput (std::string const &v)
 Sets the SRS using GDAL's SetFromUserInput function.
std::string GetProj4 () const
 Returns the Proj.4 string describing the Spatial Reference System.
void SetProj4 (std::string const &v)
 Sets the Proj.4 string describing the Spatial Reference System.
void SetVLRs (std::vector< VariableRecord > const &vlrs)
 Set the LASVLRs for the SpatialReference.
void AddVLR (VariableRecord const &vlr)
 Add a VLR representing GeoTIFF keys to the SRS.
std::vector< VariableRecord > GetVLRs () const
 Return a copy of the LASVLRs that SpatialReference maintains.
void ClearVLRs (GeoVLRType eType)
liblas::property_tree::ptree GetPTree () const

Detailed Description

Spatial Reference System container for libLAS.

Member Enumeration Documentation

◆ GeoVLRType

Enumerator
eGeoTIFF 
eOGRWKT 

◆ WKTModeFlag

Enumerator
eHorizontalOnly 
eCompoundOK 

Constructor & Destructor Documentation

◆ SpatialReference() [1/3]

liblas::SpatialReference::SpatialReference ( )

Default constructor.

Referenced by operator!=(), operator=(), operator==(), and SpatialReference().

Here is the caller graph for this function:

◆ ~SpatialReference()

liblas::SpatialReference::~SpatialReference ( )

Destructor.

If libgeotiff is enabled, deallocates libtiff and libgeotiff objects used internally.

◆ SpatialReference() [2/3]

liblas::SpatialReference::SpatialReference ( std::vector< VariableRecord > const & vlrs)

Constructor creating SpatialReference instance from given Variable-Length Record.

◆ SpatialReference() [3/3]

liblas::SpatialReference::SpatialReference ( SpatialReference const & other)

Copy constryctor.

References SpatialReference().

Here is the call graph for this function:

Member Function Documentation

◆ AddVLR()

void liblas::SpatialReference::AddVLR ( VariableRecord const & vlr)

Add a VLR representing GeoTIFF keys to the SRS.

◆ ClearVLRs()

void liblas::SpatialReference::ClearVLRs ( GeoVLRType eType)

◆ GetGTIF()

const GTIF * liblas::SpatialReference::GetGTIF ( )

Returns a pointer to the internal GTIF*.

Only available if you have libgeotiff linked in.

◆ GetProj4()

std::string liblas::SpatialReference::GetProj4 ( ) const

Returns the Proj.4 string describing the Spatial Reference System.

If GDAL is linked, it uses GDAL's operations and methods to determine the Proj.4 string – otherwise, if libgeotiff is linked, it uses that. Note that GDAL's operations are much more mature and support more coordinate systems and descriptions.

◆ GetPTree()

liblas::property_tree::ptree liblas::SpatialReference::GetPTree ( ) const

◆ GetVLRs()

std::vector< VariableRecord > liblas::SpatialReference::GetVLRs ( ) const

Return a copy of the LASVLRs that SpatialReference maintains.

◆ GetWKT() [1/2]

std::string liblas::SpatialReference::GetWKT ( WKTModeFlag mode_flag,
bool pretty ) const

◆ GetWKT() [2/2]

std::string liblas::SpatialReference::GetWKT ( WKTModeFlag mode_flag = eHorizontalOnly) const

Returns the OGC WKT describing Spatial Reference System.

If GDAL is linked, it uses GDAL's operations and methods to determine the WKT. If GDAL is not linked, no WKT is returned.

Parameters
mode_flagMay be eHorizontalOnly indicating the WKT will not include vertical coordinate system info (the default), or eCompoundOK indicating the the returned WKT may be a compound coordinate system if there is vertical coordinate system info available.

References eHorizontalOnly.

◆ operator!=()

bool liblas::SpatialReference::operator!= ( const SpatialReference & other) const
inline

References SpatialReference().

Here is the call graph for this function:

◆ operator=()

SpatialReference & liblas::SpatialReference::operator= ( SpatialReference const & rhs)

Assignment operator.

References SpatialReference().

Here is the call graph for this function:

◆ operator==()

bool liblas::SpatialReference::operator== ( const SpatialReference & other) const

References SpatialReference().

Here is the call graph for this function:

◆ SetFromUserInput()

void liblas::SpatialReference::SetFromUserInput ( std::string const & v)

Sets the SRS using GDAL's SetFromUserInput function.

If GDAL is not linked, this operation has no effect.

Parameters
v- a string containing the definition (filename, proj4, wkt, etc).

◆ SetGTIF()

void liblas::SpatialReference::SetGTIF ( GTIF * pgtiff,
ST_TIFF * ptiff )

◆ SetProj4()

void liblas::SpatialReference::SetProj4 ( std::string const & v)

Sets the Proj.4 string describing the Spatial Reference System.

If GDAL is linked, it uses GDAL's operations and methods to determine the Proj.4 string – otherwise, if libgeotiff is linked, it uses that. Note that GDAL's operations are much more mature and support more coordinate systems and descriptions.

Parameters
v- a string containing the Proj.4 string.

◆ SetVerticalCS()

void liblas::SpatialReference::SetVerticalCS ( int32_t verticalCSType,
std::string const & citation = std::string(0),
int32_t verticalDatum = -1,
int32_t verticalUnits = 9001 )

Sets the vertical coordinate system using geotiff key values.

This operation should normally be done after setting the horizontal portion of the coordinate system with something like SetWKT(), SetProj4(), SetGTIF() or SetFromUserInput()

Parameters
verticalCSType- An EPSG vertical coordinate system code, normally in the range 5600 to 5799, or -1 if one is not available.
citation- a textual description of the vertical coordinate system or an empty string if nothing is available.
verticalDatum- the EPSG vertical datum code, often in the range 5100 to 5299 - implied by verticalCSType if that is provided, or -1 if no value is available.
verticalUnits- the EPSG vertical units code, often 9001 for Metre.

◆ SetVLRs()

void liblas::SpatialReference::SetVLRs ( std::vector< VariableRecord > const & vlrs)

Set the LASVLRs for the SpatialReference.

SetVLRs will only copy VLR records that pertain to the GeoTIFF keys, and extraneous VLR records will not be copied.

Parameters
vlrs- A list of VLRs that contains VLRs describing GeoTIFF keys

◆ SetWKT()

void liblas::SpatialReference::SetWKT ( std::string const & v)

Sets the SRS using GDAL's OGC WKT.

If GDAL is not linked, this operation has no effect.

Parameters
v- a string containing the WKT string.

The documentation for this class was generated from the following file: