MD_DataIdentification.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 terralib/metadata/iso19115/MD_DataIdentification.h
22 
23  \brief Information required to identify a dataset.
24  */
25 
26 #ifndef __TERRALIB_METADATA_INTERNAL_ISO19115_MD_DATAIDENTIFICATION_H
27 #define __TERRALIB_METADATA_INTERNAL_ISO19115_MD_DATAIDENTIFICATION_H
28 
29 // TerraLib
30 #include "../../geometry/Envelope.h"
31 #include "../Config.h"
32 #include "CodeList.h"
33 #include "MD_Identification.h"
34 
35 // STL
36 #include <vector>
37 #include <string>
38 
39 namespace te
40 {
41  namespace md
42  {
43  class CI_Citation;
44 
45  /*!
46  \class MD_DataIdentification
47 
48  \brief Information required to identify a dataset.
49 
50  \note Only the mandatory elements for the core metadata are implemented.
51  */
53  {
54  public:
55 
56  /*!
57  \brief Constructor.
58  \param citation Pointer to the citation to the resource. Class takes ownership. Do not pass null.
59  \param abstract Brief narrative summary of the resource.
60  \param status The development phase of the resource.
61  \param lang A language used within the dataset. using standard ISO three-letter codes. Do not pass empty.
62  */
63  MD_DataIdentification(CI_Citation* cite, const std::string& abstract, MD_ProgressCode status, const std::string& lang);
64 
65  //! Destructor.
67 
68  /** @name Accessor methods
69  * Methods used to get or set properties.
70  */
71  //@{
72 
73  /*!
74  \brief Adds a language used within the dataset.
75  \param lang Language description using standard ISO three-letter codes. Do not pass empty string.
76  */
77  void addLanguage(const std::string& lang);
78 
79  //! Returns the set of languages associated to the dataset.
80  const std::vector<std::string>& getLanguages() const;
81 
82  //! Adds a character coding standard in the dataset.
83  void addCharacterSet(MD_CharacterSetCode code);
84 
85  //! Returns a character coding standard in the dataset.
86  const std::vector<MD_CharacterSetCode>& getCharsetCodes() const;
87 
88  //! Adds a theme of the dataset.
89  void addTopicCategory(MD_TopicCategoryCode code);
90 
91  //! Return the themes associated to the dataset.
92  const std::vector<MD_TopicCategoryCode>& getTopicCategories() const;
93 
94  /*!
95  \brief Adds the spatial description of the dataset.
96  \param llx Westernmost coordinate of the limit of the dataset extent, expressed in longitude in decimal degrees.
97  \param lly Southernmost coordinate of the limit of the dataset extent, expressed in latitude in decimal degrees.
98  \param urx Easternmost coordinate of the limit of the dataset extent, expressed in longitude in decimal degrees.
99  \param lly Northernmost coordinate of the limit of the dataset extent, expressed in latitude in decimal degrees.
100  \param isInside True if the bounding polygon encompasses an area covered by the data or false if an area where data is not present. Default true.
101  */
102  void addGeographicBBoxExt(const double& llx, const double& lly,
103  const double& urx, const double& ury,
104  bool isInside=true);
105 
106  /*!
107  \brief Adds the spatial description of the dataset.
108  \param bbx Pointer to the enclosing boounding box. Do not pass null.
109  \param isInside True if the bounding polygon encompasses an area covered by the data or false if an area where data is not present. Default true.
110  */
111  void addGeographicBBoxExt(const te::gm::Envelope* bb, bool isInside=true);
112 
113  //! Returns the set of extents for the dataset.
114  const te::gm::Envelope& getExtent() const;
115 
116  //! Returns true if the bounding polygon encompasses an area covered by the data or false if is an area where data is not present.
117  bool dataIsCovered() const;
118 
119  //! Sets the spatial representation type.
120  void setSpatialRepType(te::md::MD_SpatialRepresentationTypeCode code);
121 
122  //! Returns the spatial representation type.
123  te::md::MD_SpatialRepresentationTypeCode getSpatialRepTypeCode() const;
124 
125  /*!
126  \brief Sets resource scale.
127  The scale of a map or other cartographic object expressed as a fraction or ratio which relates unit distance on the map or other cartographic object to distance, measured in the same units, on the ground.
128  \param d The scale denominator. Do not pass <= 0;
129  */
130  void setScale(long d);
131 
132  //! Returns the scale information. If equal to 0 the denominator is not valid.
133  long getScale() const;
134 
135  //@}
136 
137  MD_Identification* clone() const;
138 
139  private:
140 
141  std::vector<std::string> m_language;
142  std::vector<MD_CharacterSetCode> m_charSet;
143  std::vector<MD_TopicCategoryCode> m_topicCategory;
147  long m_scale;
148  };
149  } // end namespace md
150 } // end namespace te
151 
152 #endif // __TERRALIB_METADATA_INTERNAL_ISO19115_MD_DATAIDENTIFICATION_H
153 
te::md::MD_SpatialRepresentationTypeCode m_spatialRepresentationType
#define TEMDEXPORT
Definition: Config.h:61
Identification information contains information to uniquely identify the data.
Provides a standardized method for citing a resource (dataset, feature, source, publication, etc.)
Definition: CI_Citation.h:53
std::vector< std::string > m_language
MD_SpatialRepresentationTypeCode
Definition: CodeList.h:523
An Envelope defines a 2D rectangular region.
Definition: Envelope.h:51
Information required to identify a dataset.
std::vector< MD_TopicCategoryCode > m_topicCategory
URI C++ Library.
MD_ProgressCode
status of the dataset or progress of a review
Definition: CodeList.h:459
std::vector< MD_CharacterSetCode > m_charSet
Identification information contains information to uniquely identify the data.
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