Loading...
Searching...
No Matches
SpatialReferenceSystem.h
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.h
22
23 \brief This file contains the structs necessary to represent a Spatial Reference System.
24 */
25
26#ifndef __TERRALIB_SRS_INTERNAL_SPATIALREFERENCESYSTEM_H
27#define __TERRALIB_SRS_INTERNAL_SPATIALREFERENCESYSTEM_H
28
29// TerraLib
30#include "Config.h"
31
32// STL
33#include <memory>
34#include <string>
35
36namespace te
37{
38 namespace srs
39 {
40 /*!
41 \class SpatialReferenceSystem
42 \brief A Spatial Reference System, also known as a Coordinate System.
43
44 A spatial reference system (SRS) or coordinate reference system (CRS) is a coordinate-based local,
45 regional or global system used to locate geographical entities.
46
47 \ingroup srs
48 */
50 {
51
52 public:
53 /*!
54 \brief Default constructor.
55 \param name The SRS name. Default empty string.
56 \param unitName The SRS unit name. Default empty string;
57 */
58 SpatialReferenceSystem(const std::string& name="", const std::string& unitName="");
59
60 //! Virtual destructor.
62
63 /*!
64 \brief Sets the SRS name.
65 \param name the SRS name.
66 */
67 void setName(const std::string& name);
68
69 //! Returns the SRS name.
70 const std::string& getName() const;
71
72 /*!
73 \brief Sets the SRS unit name.
74 \param name the SRS unit name.
75 */
76 void setUnitName(const std::string& name);
77
78 //! Returns the SRS unit name.
79 const std::string& getUnitName() const;
80
81 /*!
82 \brief Sets the SRS integer identification.
83
84 Spatial reference systems can be referred to using a SRID integer,
85 given by an authority, such as the EPSG codes defined by the International
86 Association of Oil and Gas Producers.
87
88 \param id The SRS integer identifier.
89 \param authName The authority responsible for the identifier. Default "EPSG".
90 */
91 void setSRID(int id, const std::string& authName="EPSG");
92
93 /*!
94 \brief Returns SRS integer identification.
95 \param id To return the unique id (output);
96 \param authName To return the authority responsible for the id (output).
97 */
98 void getSRID(int& id, std::string& authName) const;
99
100 /*!
101 \brief Returns an OGC's WKT representation for the SRS.
102
103 The WKT definition based on document "OpenGIS Implementation Specification: Coordinate Transformation Services Revision 1.00 - pages 18 and 19.
104 */
105 virtual std::string getWKT() const = 0;
106
107 //! Returns true is a geographic coordinate system and false otherwise.
108 virtual bool isGeographic() const = 0;
109
110 protected:
111
112 std::string m_name;
113 std::string m_unitName;
114
115 std::pair<unsigned int,std::string> m_srid;
116 };
117
118 /*!
119 \typedef SpatialReferenceSystemPtr an auto pointer to a SpatialReferenceSystem.
120 */
121 typedef std::unique_ptr<SpatialReferenceSystem> SpatialReferenceSystemPtr;
122 }
123}
124
125#endif //__TERRALIB_SRS_INTERNAL_SPATIALREFERENCESYSTEM_H
A Spatial Reference System, also known as a Coordinate System.
virtual bool isGeographic() const =0
Returns true is a geographic coordinate system and false otherwise.
void setUnitName(const std::string &name)
Sets the SRS unit name.
std::pair< unsigned int, std::string > m_srid
const std::string & getUnitName() const
Returns the SRS unit name.
void setSRID(int id, const std::string &authName="EPSG")
Sets the SRS integer identification.
virtual std::string getWKT() const =0
Returns an OGC's WKT representation for the SRS.
const std::string & getName() const
Returns the SRS name.
virtual ~SpatialReferenceSystem()
Virtual destructor.
void setName(const std::string &name)
Sets the SRS name.
SpatialReferenceSystem(const std::string &name="", const std::string &unitName="")
Default constructor.
void getSRID(int &id, std::string &authName) const
Returns SRS integer identification.
std::unique_ptr< SpatialReferenceSystem > SpatialReferenceSystemPtr
TerraLib.
#define TESRSEXPORT
You can use this macro in order to export/import classes and functions from this module.
Definition: Config.h:377
Proxy configuration file for TerraView (see terraview_config.h).