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/serialization/xml/MD_Metadata.cpp
22 
23  \brief Support for MD_Metadata serialization.
24  */
25 
26 // TerraLib
27 #include "../../../common/Translator.h"
28 #include "../../../metadata/iso19115/CI_Citation.h"
29 #include "../../../metadata/iso19115/CI_ResponsibleParty.h"
30 #include "../../../metadata/iso19115/MD_Format.h"
31 #include "../../../metadata/iso19115/MD_Metadata.h"
32 #include "../../../metadata/iso19115/MD_Distribution.h"
33 #include "../../../srs/Config.h"
34 #include "../../../xml/AbstractWriter.h"
35 #include "../../../xml/Reader.h"
36 #include "MD_Metadata.h"
37 
38 // STL
39 #include <cassert>
40 
41 // Boost
42 #include <boost/foreach.hpp>
43 #include <boost/format.hpp>
44 
45 
47 {
48  writer.writeStartDocument("UTF-8", "no");
49  writer.writeStartElement("gmd:MD_Metadata");
50 
51  writer.writeAttribute("xmlns:gco", "http://www.isotc211.org/2005/gco");
52  writer.writeAttribute("xmlns:gmd", "http://www.isotc211.org/2005/gmd");
53  writer.writeAttribute("xmlns:gml", "http://www.opengis.net/gml");
54  writer.writeAttribute("xmlns:gts", "http://www.isotc211.org/2005/gts");
55  writer.writeAttribute("xmlns:xsi", "http://www.w3.org/2001/XMLSchema-instance");
56 
57  // metadata file identifier - core optional element
58  if (!md->getFileId().empty())
59  {
60  writer.writeStartElement("gmd:fileIdentifier");
61  writer.writeStartElement("gco:CharacterString");
62  writer.writeValue(md->getFileId());
63  writer.writeEndElement("gco:CharacterString");
64  writer.writeEndElement("gmd:fileIdentifier");
65  }
66 
67  // metadata language - core conditional element, if not defined by encoding
68  writer.writeStartElement("gmd:language");
69  if (!md->getLanguage().empty())
70  {
71  writer.writeStartElement("gco:CharacterString");
72  writer.writeValue(md->getLanguage());
73  writer.writeEndElement("gco:CharacterString");
74  }
75  else
76  writer.writeAttribute("gco:nilReason", "unknown");
77  writer.writeEndElement("gmd:language");
78 
79  // metadata character set - core conditional element
80  // Here we have a problema: how to map codes to their name values?!
81  writer.writeStartElement("gmd:characterSet");
82  writer.writeStartElement("gmd:MD_CharacterSetCode");
83  writer.writeAttribute("codeList","http://www.isotc211.org/2005/resources/codeList.xml#MD_CharacterSetCode");
84  writer.writeAttribute("codeSpace",md->getCharset());
85  //writer.writeValue(md->getCharset());
86  //writer.writeEndElement("gmd:MD_CharacterSetCode");
87  writer.writeEndElement("gmd:MD_CharacterSetCode");
88  writer.writeEndElement("gmd:characterSet");
89 
90  // these are not core elements, this is the default
91  writer.writeStartElement("gmd:parentIdentifier");
92  writer.writeAttribute("gco:nilReason","inapplicable");
93  writer.writeEndElement("gmd:parentIdentifier");
94 
95  writer.writeStartElement("gmd:hierarchyLevel");
96  writer.writeStartElement("gmd:MD_ScopeCode");
97  writer.writeAttribute("codeList","http://www.isotc211.org/2005/resources/Codelist/gmxCodelists.xml#MD_ScopeCode");
98  writer.writeAttribute("codeListValue","dataset");
99  writer.writeAttribute("codeSpace","005");
100  writer.writeValue("dataset");
101  writer.writeEndElement("gmd:MD_ScopeCode");
102  writer.writeEndElement("gmd:hierarchyLevel");
103 
104  writer.writeStartElement("gmd:hierarchyLevelName");
105  writer.writeAttribute("gco:nilReason","inapplicable");
106  writer.writeEndElement("gmd:hierarchyLevelName");
107 
108  // metadata point of contact is core and mandatory element
109  writer.writeStartElement("gmd:contact");
110  const boost::ptr_vector<te::md::CI_ResponsibleParty>& mycontacts = md->getContacts();
111  if (!mycontacts.empty())
112  {
113  for (boost::ptr_vector<te::md::CI_ResponsibleParty>::const_iterator it = mycontacts.begin();
114  it != mycontacts.end(); ++it)
115  te::md::Save(*it,writer);
116  }
117  else
118  writer.writeAttribute("gco:nilReason", "unknown");
119  writer.writeEndElement("gmd:contact");
120 
121  // metadata date stamp - core mandatory element
122  writer.writeStartElement("gmd:dateStamp");
123  if (!md->getDateStamp().is_not_a_date())
124  {
125  writer.writeStartElement("gco:Date");
126  writer.writeValue(boost::gregorian::to_iso_extended_string(md->getDateStamp()));
127  writer.writeEndElement("gco:Date");
128  }
129  else
130  writer.writeAttribute("gco:nilReason", "unknown");
131  writer.writeEndElement("gmd:dateStamp");
132 
133  // metadata standard name - core optional element
134  if (!md->getStandardName().empty())
135  {
136  writer.writeStartElement("gmd:metadataStandardName");
137  writer.writeStartElement("gco:CharacterString");
138  writer.writeValue(md->getStandardName());
139  writer.writeEndElement("gco:CharacterString");
140  writer.writeEndElement("gmd:metadataStandardName");
141  }
142 
143  // metadata standard version - core optional element
144  if (!md->getStandardName().empty())
145  {
146  writer.writeStartElement("gmd:metadataStandardVersion");
147  writer.writeStartElement("gco:CharacterString");
148  writer.writeValue(md->getStandardVersion());
149  writer.writeEndElement("gco:CharacterString");
150  writer.writeEndElement("gmd:metadataStandardVersion");
151  }
152 
153  // because of the context, this is the link to the metadata file, not the dataset file. It is not core.
154  if (!md->getMetadataURI().empty())
155  {
156  writer.writeStartElement("gmd:dataSetURI");
157  writer.writeStartElement("gco:CharacterString");
158  writer.writeValue(md->getMetadataURI());
159  writer.writeEndElement("gco:CharacterString");
160  writer.writeEndElement("gmd:dataSetURI");
161  }
162 
163  // reference system - core optional SRS
164  // for now... lets suppose we are dealing with EPSG codes only.
165  if (md->getReferenceSystem() != TE_UNKNOWN_SRS)
166  {
167  writer.writeStartElement("gmd:referenceSystemInfo");
168  writer.writeStartElement("gmd:MD_ReferenceSystem");
169  writer.writeStartElement("gmd:referenceSystemIdentifier");
170  writer.writeStartElement("gmd:RS_Identifier");
171  std::string scode;
172  scode= boost::str(boost::format("urn:ogc:def:crs:EPSG::%d") % md->getReferenceSystem());
173  writer.writeStartElement("gmd:code");
174  writer.writeValue(scode);
175  writer.writeEndElement("gmd:code");
176  writer.writeEndElement("gmd:RS_Identifier");
177  writer.writeEndElement("gmd:referenceSystemIdentifier");
178  writer.writeEndElement("gmd:MD_ReferenceSystem");
179  writer.writeEndElement("gmd:referenceSystemInfo");
180  }
181 
182  // this is core and mandatory element from at least one dataset.
183  writer.writeStartElement("gmd:identificationInfo");
184  const boost::ptr_vector<te::md::MD_Identification>& ids = md->getIdentifications();
185  if (!ids.empty())
186  {
187  for (boost::ptr_vector<te::md::MD_Identification>::const_iterator itd = ids.begin();
188  itd != ids.end(); ++itd)
189  te::md::Save(*itd,writer);
190  }
191  else
192  writer.writeAttribute("gco:nilReason", "unknown");
193  writer.writeEndElement("gmd:identificationInfo");
194 
195  const te::md::MD_Distribution* dist = md->getDistribution();
196  if (dist)
197  {
198  writer.writeStartElement("gmd:distributionInfo");
199  writer.writeStartElement("gmd:MD_Distribution");
200 
201  const boost::ptr_vector<te::md::MD_Format>& fmts = dist->getFormats();
202  if (!fmts.empty())
203  {
204  writer.writeStartElement("gmd:distributionFormat");
205  for (boost::ptr_vector<te::md::MD_Format>::const_iterator itf = fmts.begin(); itf != fmts.end(); ++itf)
206  {
207  writer.writeStartElement("gmd:MD_Format");
208 
209  // distribution format name - core optional element
210  writer.writeStartElement("gmd:name");
211  if (!itf->m_name.empty())
212  {
213  writer.writeStartElement("gco:CharacterString");
214  writer.writeValue(itf->m_name);
215  writer.writeEndElement("gco:CharacterString");
216  }
217  else
218  writer.writeAttribute("gco:nilReason", "unknown");
219  writer.writeEndElement("gmd:name");
220 
221  // distribution format version - core optional element
222  writer.writeStartElement("gmd:version");
223  if (!itf->m_version.empty())
224  {
225  writer.writeStartElement("gco:CharacterString");
226  writer.writeValue(itf->m_version);
227  writer.writeEndElement("gco:CharacterString");
228  }
229  else
230  writer.writeAttribute("gco:nilReason", "inapplicable");
231  writer.writeEndElement("gmd:version");
232 
233  writer.writeEndElement("gmd:MD_Format");
234  }
235  writer.writeEndElement("gmd:distributionFormat");
236  }
237  if (!dist->getURL().empty())
238  {
239  writer.writeStartElement("gmd:transferOptions");
240  writer.writeStartElement("gmd:MD_DigitalTransferOptions");
241  writer.writeStartElement("gmd:onLine");
242  writer.writeStartElement("gmd:CI_OnlineResource");
243  writer.writeStartElement("gmd:linkage");
244  writer.writeStartElement("gmd:URL");
245  writer.writeValue(dist->getURL());
246  writer.writeEndElement("gmd:URL");
247  writer.writeEndElement("gmd:linkage");
248  writer.writeEndElement("gmd:CI_OnlineResource");
249  writer.writeEndElement("gmd:onLine");
250  writer.writeEndElement("gmd:MD_DigitalTransferOptions");
251  writer.writeEndElement("gmd:transferOptions");
252  }
253  writer.writeEndElement("gmd:MD_Distribution");
254  writer.writeEndElement("gmd:distributionInfo");
255  }
256 
257  if (!md->getLineage().empty())
258  {
259  writer.writeStartElement("gmd:DQ_DataQuality");
260 
261  writer.writeStartElement("gmd:scope");
262  writer.writeStartElement("gmd:DQ_Scope");
263  writer.writeStartElement("gmd:level");
264  writer.writeStartElement("gmd:MD_ScopeCode");
265  writer.writeAttribute("codeList","http://www.isotc211.org/2005/resources/Codelist/gmxCodelists.xml#MD_ScopeCode");
266  writer.writeAttribute("codeListValue","dataset");
267  writer.writeAttribute("codeSpace","005");
268  writer.writeValue("dataset");
269  writer.writeEndElement("gmd:MD_ScopeCode");
270  writer.writeEndElement("gmd:level");
271  writer.writeEndElement("gmd:DQ_Scope");
272  writer.writeEndElement("gmd:scope");
273 
274  writer.writeStartElement("gmd:lineage");
275  writer.writeStartElement("gmd:LI_Lineage");
276  writer.writeStartElement("gmd:statement");
277  writer.writeStartElement("gco:CharacterString");
278  writer.writeValue(md->getLineage());
279  writer.writeEndElement("gco:CharacterString");
280  writer.writeEndElement("gmd:statement");
281  writer.writeEndElement("gmd:LI_Lineage");
282  writer.writeEndElement("gmd:lineage");
283 
284  writer.writeEndElement("gmd:DQ_DataQuality");
285  }
286 
287  writer.writeEndElement("gmd:MD_Metadata");
288 }
289 
291 {
292  writer.writeStartElement("gmd:CI_ResponsibleParty");
293 
294  writer.writeStartElement("gmd:individualName");
295  if (!ctc.getIndividualName().empty())
296  {
297  writer.writeStartElement("gco:CharacterString");
298  writer.writeValue(ctc.getIndividualName());
299  writer.writeEndElement("gco:CharacterString");
300  }
301  else
302  writer.writeAttribute("gco:nilReason", "inapplicable");
303  writer.writeEndElement("gmd:individualName");
304 
305  writer.writeStartElement("gmd:organisationName");
306  if (!ctc.getOrganizationName().empty())
307  {
308  writer.writeStartElement("gco:CharacterString");
309  writer.writeValue(ctc.getOrganizationName());
310  writer.writeEndElement("gco:CharacterString");
311  }
312  else
313  writer.writeAttribute("gco:nilReason", "inapplicable");
314  writer.writeEndElement("gmd:organisationName");
315 
316  writer.writeStartElement("gmd:positionName");
317  if (!ctc.getPositionName().empty())
318  {
319  writer.writeStartElement("gco:CharacterString");
320  writer.writeValue(ctc.getPositionName());
321  writer.writeEndElement("gco:CharacterString");
322  }
323  else
324  writer.writeAttribute("gco:nilReason", "inapplicable");
325  writer.writeEndElement("gmd:positionName");
326 
327  writer.writeStartElement("gmd:role");
328  writer.writeStartElement("gmd:CI_RoleCode");
329  writer.writeAttribute("codeList","http://www.isotc211.org/2005/resources/codeList.xml#CI_RoleCode");
330  writer.writeAttribute("codeListValue",ctc.getRoleCode());
331  writer.writeValue(ctc.getRoleCode());
332  writer.writeEndElement("gmd:CI_RoleCode");
333  writer.writeEndElement("gmd:role");
334 
335  writer.writeEndElement("gmd:CI_ResponsibleParty");
336 }
337 
339 {
340  // assuming that it is a data identification
341  writer.writeStartElement("gmd:MD_DataIdentification");
342 
343  // citation has some core and mandatory elements
344  te::md::Save(id.getCitation(),writer);
345 
346  // abstract is a core and mandatory element
347  writer.writeStartElement("gmd:abstract");
348  writer.writeStartElement("gco:CharacterString");
349  writer.writeValue(id.getAbstract());
350  writer.writeEndElement("gco:CharacterString");
351  writer.writeEndElement("gmd:abstract");
352 
353  // status is not a core element, but it is mandatory in MGB
354  writer.writeStartElement("gmd:status");
355  writer.writeStartElement("gmd:MD_ProgressCode");
356  writer.writeAttribute("codeList", "http://www.isotc211.org/2005/resources/codeList.xml#MD_ProgressCode");
357  writer.writeAttribute("codeListValue", id.getStatus());
358  //writer.writeValue(id.getStatus());
359  writer.writeEndElement("gmd:MD_ProgressCode");
360  writer.writeEndElement("gmd:status");
361 
362  // dataset responsible party - core optional element
363  const boost::ptr_vector<te::md::CI_ResponsibleParty>& ctcs = id.getPointsOfContact();
364  if (!ctcs.empty())
365  {
366  writer.writeStartElement("gmd:pointOfContact");
367  for (boost::ptr_vector<te::md::CI_ResponsibleParty>::const_iterator it = ctcs.begin();
368  it != ctcs.end(); ++it)
369  te::md::Save(*it,writer);
370  writer.writeEndElement("gmd:pointOfContact");
371  }
372 
373  const te::md::MD_DataIdentification* did = static_cast<const te::md::MD_DataIdentification*>(&id);
374 
375  // spatial representation type - core optional element, but it has a default
376  writer.writeStartElement("gmd:spatialRepresentationType");
377  writer.writeStartElement("gmd:MD_SpatialRepresentationTypeCode");
378  writer.writeAttribute("codeList","http://www.isotc211.org/2005/resources/codeList.xml#MD_SpatialRepresentationTypeCode");
379  writer.writeAttribute("codeListValue", did->getSpatialRepTypeCode());
380  writer.writeValue(did->getSpatialRepTypeCode());
381  writer.writeEndElement("gmd:MD_SpatialRepresentationTypeCode");
382  writer.writeEndElement("gmd:spatialRepresentationType");
383 
384 
385  // dataset language - core mandatory element
386  writer.writeStartElement("gmd:language");
387  const std::vector<std::string>& mlang = did->getLanguages();
388  if (!mlang.empty())
389  {
390  BOOST_FOREACH(const std::string& lang, mlang)
391  {
392  writer.writeStartElement("gmd:LanguageCode");
393  writer.writeAttribute("codeList","http://www.isotc211.org/2005/resources/codeList.xml#LanguageCode");
394  writer.writeAttribute("codeListValue",lang);
395  writer.writeValue(lang);
396  writer.writeEndElement("gmd:LanguageCode");
397  }
398  }
399  else
400  writer.writeAttribute("gco:nilReason", "unknown");
401  writer.writeEndElement("gmd:language");
402 
403  // dataset character set - core conditional element
404  writer.writeStartElement("gmd:characterSet");
405  const std::vector<te::md::MD_CharacterSetCode>& mchars = did->getCharsetCodes();
406  if (!mchars.empty())
407  {
408  BOOST_FOREACH(const te::md::MD_CharacterSetCode& cs, mchars)
409  {
410  writer.writeStartElement("gmd:MD_CharacterSetCode");
411  writer.writeAttribute("codeList","http://www.isotc211.org/2005/resources/codeList.xml#MD_CharacterSetCode");
412  writer.writeAttribute("codeListValue",cs);
413  writer.writeValue(cs);
414  writer.writeEndElement("gmd:MD_CharacterSetCode");
415  }
416  }
417  else
418  writer.writeAttribute("gco:nilReason", "unknown");
419  writer.writeEndElement("gmd:characterSet");
420 
421  // dataset topic category - core mandatory element
422  writer.writeStartElement("gmd:topicCategory");
423  const std::vector<te::md::MD_TopicCategoryCode>& mtop = did->getTopicCategories();
424  if (!mtop.empty())
425  {
426  BOOST_FOREACH(const te::md::MD_TopicCategoryCode& t, mtop)
427  {
428  writer.writeStartElement("gmd:MD_TopicCategoryCode");
429  writer.writeAttribute("codeList","http://www.isotc211.org/2005/resources/codeList.xml#MD_TopicCategoryCode");
430  writer.writeAttribute("codeListValue",t);
431  writer.writeValue(t);
432  writer.writeEndElement("gmd:MD_TopicCategoryCode");
433  }
434  }
435  else
436  writer.writeAttribute("gco:nilReason", "unknown");
437  writer.writeEndElement("gmd:topicCategory");
438 
439  // geographic location of the dataset - core conditional element
440  writer.writeStartElement("gmd:extent");
441  writer.writeStartElement("gmd:EX_Extent");
442 
443  writer.writeStartElement("gmd:description");
444  writer.writeAttribute("gco:nilReason","inapplicable");
445  writer.writeEndElement("gmd:description");
446 
447  writer.writeStartElement("gmd:geographicElement");
448  const te::gm::Envelope& ext = did->getExtent();
449  if (ext.isValid())
450  {
451  writer.writeStartElement("gmd:EX_GeographicBoundingBox");
452 
453  writer.writeStartElement("gmd:westBoundLongitude");
454  writer.writeStartElement("gco:Decimal");
455  writer.writeValue(ext.getLowerLeftX());
456  writer.writeEndElement("gco:Decimal");
457  writer.writeEndElement("gmd:westBoundLongitude");
458 
459  writer.writeStartElement("gmd:eastBoundLongitude");
460  writer.writeStartElement("gco:Decimal");
461  writer.writeValue(ext.getUpperRightX());
462  writer.writeEndElement("gco:Decimal");
463  writer.writeEndElement("gmd:eastBoundLongitude");
464 
465  writer.writeStartElement("gmd:southBoundLatitude");
466  writer.writeStartElement("gco:Decimal");
467  writer.writeValue(ext.getLowerLeftY());
468  writer.writeEndElement("gco:Decimal");
469  writer.writeEndElement("gmd:southBoundLatitude");
470 
471  writer.writeStartElement("gmd:northBoundLatitude");
472  writer.writeStartElement("gco:Decimal");
473  writer.writeValue(ext.getUpperRightY());
474  writer.writeEndElement("gco:Decimal");
475  writer.writeEndElement("gmd:northBoundLatitude");
476 
477  writer.writeEndElement("gmd:EX_GeographicBoundingBox");
478 
479  }
480  else
481  writer.writeAttribute("gco:nilReason", "unknown");
482  writer.writeEndElement("gmd:geographicElement");
483 
484  // aditional extent information for the dataset - core optional element
485  writer.writeStartElement("gmd:temporalElement");
486  writer.writeAttribute("gco:nilReason","inapplicable");
487  writer.writeEndElement("gmd:temporalElement");
488 
489  writer.writeStartElement("gmd:verticalElement");
490  writer.writeAttribute("gco:nilReason","inapplicable");
491  writer.writeEndElement("gmd:verticalElement");
492 
493  writer.writeEndElement("gmd:EX_Extent");
494  writer.writeEndElement("gmd:extent");
495 
496  // spatial resolution of the dataset - core optional element
497  if (did->getScale() > 0)
498  {
499  writer.writeStartElement("gmd:spatialResolution");
500  writer.writeStartElement("gmd:MD_Resolution");
501  writer.writeStartElement("gmd:equivalenteScale");
502  writer.writeStartElement("gmd:MD_RepresentativeFraction");
503  writer.writeStartElement("gmd:denominator");
504  writer.writeStartElement("gco:Integer");
505  did->getScale();
506  writer.writeEndElement("gco:Integer");
507  writer.writeEndElement("gmd:denominator");
508  writer.writeEndElement("gmd:MD_RepresentativeFraction");
509  writer.writeEndElement("gmd:equivalenteScale");
510  writer.writeEndElement("gmd:MD_Resolution");
511  writer.writeEndElement("gmd:spatialResolution");
512  }
513 
514  writer.writeEndElement("gmd:MD_DataIdentification");
515 }
516 
518 {
519  writer.writeStartElement("gmd:citation");
520  writer.writeStartElement("gmd:CI_Citation");
521 
522  // dataset title - core mandatory element
523  writer.writeStartElement("gmd:title");
524  writer.writeStartElement("gco:CharacterString");
525  writer.writeValue(cite->getTitle());
526  writer.writeEndElement("gco:CharacterString");
527  writer.writeEndElement("gmd:title");
528 
529  // dataset reference date - core mandatory element
530  writer.writeStartElement("gmd:date");
531  writer.writeStartElement("gmd:CI_Date");
532  writer.writeStartElement("gmd:date");
533  writer.writeStartElement("gco:Date");
534  writer.writeValue(boost::gregorian::to_iso_extended_string(cite->getDate()));
535  writer.writeEndElement("gco:Date");
536  writer.writeEndElement("gmd:date");
537  writer.writeStartElement("gmd:dateType");
538  writer.writeStartElement("gmd:CI_DateTypeCode");
539  writer.writeAttribute("codeList","http://www.isotc211.org/2005/resources/codeList.xml#CI_DateTypeCode");
540  writer.writeAttribute("codeListValue",cite->getDateType());
541  writer.writeEndElement("gmd:CI_DateTypeCode");
542  writer.writeEndElement("gmd:dateType");
543  writer.writeEndElement("gmd:CI_Date");
544  writer.writeEndElement("gmd:date");
545 
546  writer.writeEndElement("gmd:CI_Citation");
547  writer.writeEndElement("gmd:citation");
548 }
549 
const boost::ptr_vector< MD_Identification > & getIdentifications() const
Gets the resources identification associated to the metadata.
const std::string & getOrganizationName() const
Returns the individual name.
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 boost::gregorian::date & getDate() const
Returns the citation date.
Definition: CI_Citation.cpp:46
virtual void writeStartElement(const std::string &qName)=0
const MD_Distribution * getDistribution() const
Gets the distribution information.
Information about the distributor of and the options for obtaining the resource.
const std::vector< MD_CharacterSetCode > & getCharsetCodes() const
Returns a character coding standard in the dataset.
virtual void writeValue(const std::string &value)=0
const boost::ptr_vector< MD_Format > & getFormats() const
Gets the distribution formats.
const double & getUpperRightX() const
It returns a constant refernce to the x coordinate of the upper right corner.
Definition: Envelope.h:410
const std::string & getLanguage() const
Returns metadata language.
Definition: MD_Metadata.cpp:86
const double & getLowerLeftY() const
It returns a constant refernce to the y coordinate of the lower left corner.
Definition: Envelope.h:400
const std::vector< std::string > & getLanguages() const
Returns the set of languages associated to the dataset.
const std::vector< MD_TopicCategoryCode > & getTopicCategories() const
Return the themes associated to the dataset.
long getScale() const
Returns the scale information. If equal to 0 the denominator is not valid.
const double & getUpperRightY() const
It returns a constant refernce to the x coordinate of the upper right corner.
Definition: Envelope.h:420
This class models a XML writer object.
Provides a standardized method for citing a resource (dataset, feature, source, publication, etc.)
Definition: CI_Citation.h:53
te::md::MD_SpatialRepresentationTypeCode getSpatialRepTypeCode() const
Returns the spatial representation type.
const std::string & getTitle() const
Returns the citation title.
Definition: CI_Citation.cpp:40
const std::string & getPositionName() const
Returns the position name.
const std::string & getIndividualName() const
Returns the individual name.
const std::string & getStandardVersion() const
Returns the version of the metadata standard/profile used.
CI_RoleCode getRoleCode() const
Returns the responsible party role.
An Envelope defines a 2D rectangular region.
Definition: Envelope.h:51
#define TE_UNKNOWN_SRS
A numeric value to represent a unknown SRS identification in TerraLib.
Definition: Config.h:44
Information required to identify a dataset.
const te::gm::Envelope & getExtent() const
Returns the set of extents for the dataset.
Root entity which defines metadata for a resource or resources.
Definition: MD_Metadata.h:58
TEMDEXPORT void Save(const te::md::MD_Metadata *md, te::xml::AbstractWriter &writer)
Definition: MD_Metadata.cpp:46
int getReferenceSystem() const
Returns the referency system.
virtual void writeAttribute(const std::string &attName, const std::string &value)=0
const boost::gregorian::date & getDateStamp() const
Get metadata date stamp.
const double & getLowerLeftX() const
It returns a constant reference to the x coordinate of the lower left corner.
Definition: Envelope.h:390
CI_DateTypeCode getDateType() const
Returns the citation date type.
Definition: CI_Citation.cpp:52
virtual void writeEndElement(const std::string &qName)=0
Contains the identify of person(s), and/or position, and/or organization(s) associated with the resou...
virtual void writeStartDocument(const std::string &encoding, const std::string &standalone)=0
Identification information contains information to uniquely identify the data.
const std::string & getURL() const
Gets an online resource.
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
MD_TopicCategoryCode
high-level geographic data thematic classification to assist in the grouping and search of available ...
Definition: CodeList.h:540
bool isValid() const
It tells if the rectangle is valid or not.
Definition: Envelope.h:438
const std::string & getFileId() const
Returns the unique phrase or string which uniquely identifies the metadata file.
Definition: MD_Metadata.cpp:58