libLAS API Reference  1.8.1
Public Types | Public Member Functions | List of all members
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. More...
 
 ~SpatialReference ()
 Destructor. More...
 
 SpatialReference (std::vector< VariableRecord > const &vlrs)
 Constructor creating SpatialReference instance from given Variable-Length Record. More...
 
 SpatialReference (SpatialReference const &other)
 Copy constryctor. More...
 
SpatialReferenceoperator= (SpatialReference const &rhs)
 Assignment operator. More...
 
bool operator== (const SpatialReference &other) const
 
bool operator!= (const SpatialReference &other) const
 
const GTIFGetGTIF ()
 Returns a pointer to the internal GTIF*. More...
 
void SetGTIF (GTIF *pgtiff, ST_TIFF *ptiff)
 
std::string GetWKT (WKTModeFlag mode_flag=eHorizontalOnly) const
 Returns the OGC WKT describing Spatial Reference System. More...
 
std::string GetWKT (WKTModeFlag mode_flag, bool pretty) const
 
void SetWKT (std::string const &v)
 Sets the SRS using GDAL's OGC WKT. More...
 
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. More...
 
void SetFromUserInput (std::string const &v)
 Sets the SRS using GDAL's SetFromUserInput function. More...
 
std::string GetProj4 () const
 Returns the Proj.4 string describing the Spatial Reference System. More...
 
void SetProj4 (std::string const &v)
 Sets the Proj.4 string describing the Spatial Reference System. More...
 
void SetVLRs (std::vector< VariableRecord > const &vlrs)
 Set the LASVLRs for the SpatialReference. More...
 
void AddVLR (VariableRecord const &vlr)
 Add a VLR representing GeoTIFF keys to the SRS. More...
 
std::vector< VariableRecordGetVLRs () const
 Return a copy of the LASVLRs that SpatialReference maintains. More...
 
void ClearVLRs (GeoVLRType eType)
 
liblas::property_tree::ptree GetPTree () const
 

Detailed Description

Spatial Reference System container for libLAS.

Member Enumeration Documentation

Enumerator
eGeoTIFF 
eOGRWKT 
Enumerator
eHorizontalOnly 
eCompoundOK 

Constructor & Destructor Documentation

liblas::SpatialReference::SpatialReference ( )

Default constructor.

liblas::SpatialReference::~SpatialReference ( )

Destructor.

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

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

Constructor creating SpatialReference instance from given Variable-Length Record.

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

Copy constryctor.

Member Function Documentation

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

Add a VLR representing GeoTIFF keys to the SRS.

void liblas::SpatialReference::ClearVLRs ( GeoVLRType  eType)
const GTIF* liblas::SpatialReference::GetGTIF ( )

Returns a pointer to the internal GTIF*.

Only available if you have libgeotiff linked in.

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.

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

Return a copy of the LASVLRs that SpatialReference maintains.

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.
std::string liblas::SpatialReference::GetWKT ( WKTModeFlag  mode_flag,
bool  pretty 
) const
bool liblas::SpatialReference::operator!= ( const SpatialReference other) const
inline
SpatialReference& liblas::SpatialReference::operator= ( SpatialReference const &  rhs)

Assignment operator.

bool liblas::SpatialReference::operator== ( const SpatialReference other) const
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).
void liblas::SpatialReference::SetGTIF ( GTIF pgtiff,
ST_TIFF ptiff 
)
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.
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.
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
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: