All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Groups Pages
MD_Metadata.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 terralib/metadata//iso19115/MD_Metadata.cpp
22  */
23 
24 // TerraLib
25 #include "../../srs/Config.h"
26 #include "MD_Distribution.h"
27 #include "MD_Metadata.h"
28 
29 // STL
30 #include <cassert>
31 
32 
34  m_characterSet(te::md::MD_utf8),
35  m_referenceSystemInfo(TE_UNKNOWN_SRS),
36  m_distribution(0)
37 {
38  if (contact)
39  m_contact.push_back(contact);
40 }
41 
43 {
44  if (m_distribution)
45  delete m_distribution;
46 }
47 
48 void
49 te::md::MD_Metadata::setFileId(const std::string& fileid)
50 {
51  assert(!fileid.empty());
52 
53  m_fileIdentifier = fileid;
54 }
55 
56 
57 const std::string&
59 {
60  return m_fileIdentifier;
61 }
62 
63 void
64 te::md::MD_Metadata::setMetadataURI(const std::string& mdid)
65 {
66  assert(!mdid.empty());
67 
68  m_metadataURI = mdid;
69 }
70 
71 const std::string&
73 {
74  return m_metadataURI;
75 }
76 
77 void
78 te::md::MD_Metadata::setLanguage(const std::string& lang)
79 {
80  assert(!lang.empty());
81 
82  m_language = lang;
83 }
84 
85 const std::string&
87 {
88  return m_language;
89 }
90 
91 void
93 {
94  m_characterSet = chaset;
95 }
96 
99 {
100  return m_characterSet;
101 }
102 
103 void
104 te::md::MD_Metadata::setStandardInfo(const std::string& sname, const std::string& sversion)
105 {
106  assert(!sname.empty());
107  assert(!sversion.empty());
108 
109  m_standardName = sname;
110  m_standardVersion = sversion;
111 }
112 
113 const std::string&
115 {
116  return m_standardName;
117 }
118 
119 const std::string&
121 {
122  return m_standardVersion;
123 }
124 
125 void
127 {
128  assert(mdid);
129  m_identificationInfo.push_back(mdid);
130 }
131 
132 const boost::ptr_vector<te::md::MD_Identification>&
134 {
135  return m_identificationInfo;
136 }
137 
138 void
140 {
141  assert(contact);
142  m_contact.push_back(contact);
143 }
144 
145 const boost::ptr_vector<te::md::CI_ResponsibleParty>&
147 {
148  return m_contact;
149 }
150 
151 void
152 te::md::MD_Metadata::setDateStamp(const boost::gregorian::date& date)
153 {
154  m_dateStamp = date;
155 }
156 
157 const boost::gregorian::date&
159 {
160  return m_dateStamp;
161 }
162 
163 void
165 {
166  m_referenceSystemInfo = srid;
167 }
168 
169 int
171 {
172  return m_referenceSystemInfo;
173 }
174 
175 void
177 {
178  assert(d);
179 
180  if (m_distribution)
181  delete m_distribution;
182 
183  m_distribution = d;
184 }
185 
188 {
189  return m_distribution;
190 }
191 
192 void
193 te::md::MD_Metadata::setLineage(const std::string& stm)
194 {
195  assert(!stm.empty());
196 
197  m_lineage = stm;
198 }
199 
200 const std::string&
202 {
203  return m_lineage;
204 }
205 
void setReferenceSystem(int srid)
Sets the referency system.
const boost::ptr_vector< MD_Identification > & getIdentifications() const
Gets the resources identification associated to the metadata.
void setLanguage(const std::string &lang)
Sets the language of the metadata.
Definition: MD_Metadata.cpp:78
te::md::MD_CharacterSetCode getCharset() const
Returns metadata charset.
Definition: MD_Metadata.cpp:98
const std::string & getMetadataURI() const
Returns URI to the metadata.
Definition: MD_Metadata.cpp:72
const MD_Distribution * getDistribution() const
Gets the distribution information.
Information about the distributor of and the options for obtaining the resource.
void setDistribution(MD_Distribution *d)
Sets a distribution information to the metadata.
const std::string & getLanguage() const
Returns metadata language.
Definition: MD_Metadata.cpp:86
void addIdentification(MD_Identification *mdid)
Adds a dataset identification to the metadata.
void setStandardInfo(const std::string &sname, const std::string &sversion)
Sets the name of the metadata standard/profile used.
const std::string & getStandardVersion() const
Returns the version of the metadata standard/profile used.
MD_Metadata(CI_ResponsibleParty *contact=0)
Constructor.
Definition: MD_Metadata.cpp:33
#define TE_UNKNOWN_SRS
A numeric value to represent a unknown SRS identification in TerraLib.
Definition: Config.h:44
int getReferenceSystem() const
Returns the referency system.
void setFileId(const std::string &fileid)
Sets a unique phrase or string which uniquely identifies the metadata file.
Definition: MD_Metadata.cpp:49
const boost::gregorian::date & getDateStamp() const
Get metadata date stamp.
void setCharset(MD_CharacterSetCode chaset)
Sets the charset code used in the metadata.
Definition: MD_Metadata.cpp:92
boost::ptr_vector< CI_ResponsibleParty > m_contact
Definition: MD_Metadata.h:184
void setLineage(const std::string &stm)
Sets the lineage statement. General explanation of the data producer’s knowledge of the dataset line...
Contains the identify of person(s), and/or position, and/or organization(s) associated with the resou...
void setMetadataURI(const std::string &mdURI)
Sets URI to the metadata .
Definition: MD_Metadata.cpp:64
void setDateStamp(const boost::gregorian::date &date)
Set metadata date stamp.
Identification information contains information to uniquely identify the data.
const std::string & getStandardName() const
Returns the name of the metadata standard/profile used.
const std::string & getLineage() const
Gets the lineage statemente.
const boost::ptr_vector< CI_ResponsibleParty > & getContacts() const
Gets the metadata contacts.
MD_CharacterSetCode
name of the character coding standard used in the resource
Definition: CodeList.h:204
const std::string & getFileId() const
Returns the unique phrase or string which uniquely identifies the metadata file.
Definition: MD_Metadata.cpp:58
void addContact(CI_ResponsibleParty *contact)
Adds a contact information to the metadata.
~MD_Metadata()
Destructor.
Definition: MD_Metadata.cpp:42