SpatialReferenceSystem.cpp
Go to the documentation of this file.
1 /* Copyright (C) 2008 National Institute For Space Research (INPE) - Brazil.
2 
3  This file is part of the TerraLib - a Framework for building GIS enabled applications.
4 
5  TerraLib is free software: you can redistribute it and/or modify
6  it under the terms of the GNU Lesser General Public License as published by
7  the Free Software Foundation, either version 3 of the License,
8  or (at your option) any later version.
9 
10  TerraLib is distributed in the hope that it will be useful,
11  but WITHOUT ANY WARRANTY; without even the implied warranty of
12  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13  GNU Lesser General Public License for more details.
14 
15  You should have received a copy of the GNU Lesser General Public License
16  along with TerraLib. See COPYING. If not, write to
17  TerraLib Team at <terralib-team@terralib.org>.
18  */
19 
20 /*!
21  \file SpatialReferenceSystem.cpp
22  */
23 
24 // TerraLib
25 #include "SpatialReferenceSystem.h"
26 
27 te::srs::SpatialReferenceSystem::SpatialReferenceSystem(const std::string& name, const std::string& unitName) :
28  m_name(name),
29  m_unitName(unitName),
30  m_srid(std::pair<unsigned int,std::string>(0,""))
31 {
32 }
33 
35 
36 void te::srs::SpatialReferenceSystem::setName(const std::string& name)
37 {
38  m_name = name;
39 }
40 
41 const std::string& te::srs::SpatialReferenceSystem::getName() const
42 {
43  return m_name;
44 }
45 
46 void te::srs::SpatialReferenceSystem::setUnitName(const std::string& unitName)
47 {
48  m_unitName = unitName;
49 }
50 
52 {
53  return m_unitName;
54 }
55 
56 void te::srs::SpatialReferenceSystem::getSRID(int& id, std::string& authName) const
57 {
58  id = m_srid.first;
59  authName = m_srid.second;
60 }
61 
62 void te::srs::SpatialReferenceSystem::setSRID(int id, const std::string& authName)
63 {
64  m_srid.first = id;
65  m_srid.second = authName;
66 }
67 
void setUnitName(const std::string &name)
Sets the SRS unit name.
std::pair< unsigned int, std::string > m_srid
void setName(const std::string &name)
Sets the SRS name.
const std::string & getUnitName() const
Returns the SRS unit name.
This file contains the structs necessary to represent a Spatial Reference System. ...
virtual ~SpatialReferenceSystem()
Virtual destructor.
void setSRID(int id, const std::string &authName="EPSG")
Sets the SRS integer identification.
SpatialReferenceSystem(const std::string &name="", const std::string &unitName="")
Default constructor.
const std::string & getName() const
Returns the SRS name.
void getSRID(int &id, std::string &authName) const
Returns SRS integer identification.