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