MD_DataIdentification.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_DataIdentification.cpp
22  */
23 
24 // TerraLib
25 #include "MD_DataIdentification.h"
26 
27 te::md::MD_DataIdentification::MD_DataIdentification(te::md::CI_Citation* cite, const std::string& abstract,MD_ProgressCode status, const std::string& lang):
28  MD_Identification(cite,abstract, status),
29  m_dataIsCovered(true),
30  m_spatialRepresentationType(te::md::MD_vector),
31  m_scale(0)
32 {
33  m_language.push_back(lang);
34 }
35 
37 
38 void
40 {
41  m_language.push_back(lang);
42 }
43 
44 const std::vector<std::string>&
46 {
47  return m_language;
48 }
49 
50 void
52 {
53  m_charSet.push_back(code);
54 }
55 
56 const std::vector<te::md::MD_CharacterSetCode>&
58 {
59  return m_charSet;
60 }
61 
62 void
64 {
65  m_topicCategory.push_back(code);
66 }
67 
68 const std::vector<te::md::MD_TopicCategoryCode>&
70 {
71  return m_topicCategory;
72 }
73 
74 void
75 te::md::MD_DataIdentification::addGeographicBBoxExt(const double& llx, const double& lly,
76  const double& urx, const double& ury,
77  bool dataIsCovered)
78 {
79  m_extent.init(llx, lly, urx, ury);
81 }
82 
84  const te::gm::Envelope* bb, bool /*dataIsCovered*/)
85 {
86  assert(bb);
88 }
89 
90 
91 const
93 {
94  return m_extent;
95 }
96 
97 
98 void
100 {
102 }
103 
106 {
108 }
109 
110 
111 void
113 {
114  assert(d>0);
115 
116  m_scale = d;
117 }
118 
119 long
121 {
122  return m_scale;
123 }
124 
126 {
127  std::string l;
128  if (!m_language.empty())
129  l = m_language[0];
130 
132 
133  for(const te::md::MD_CharacterSetCode& cs: m_charSet)
134  {
135  mid->addCharacterSet(cs);
136  }
138  {
139  mid->addTopicCategory(t);
140  }
145 
146  return mid;
147 }
148 
149 
void addGeographicBBoxExt(const double &llx, const double &lly, const double &urx, const double &ury, bool isInside=true)
Adds the spatial description of the dataset.
void init(const double &llx, const double &lly, const double &urx, const double &ury)
It initializes (sets) the envelope bounds.
te::md::MD_ProgressCode m_status
~MD_DataIdentification()
Destructor.
const std::vector< MD_CharacterSetCode > & getCharsetCodes() const
Returns a character coding standard in the dataset.
te::md::MD_SpatialRepresentationTypeCode m_spatialRepresentationType
const double & getUpperRightX() const
It returns a constant refernce to the x coordinate of the upper right corner.
void addLanguage(const std::string &lang)
Adds a language used within the dataset.
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.
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.
std::vector< std::string > m_language
MD_DataIdentification(CI_Citation *cite, const std::string &abstract, MD_ProgressCode status, const std::string &lang)
Constructor.
bool dataIsCovered() const
Returns true if the bounding polygon encompasses an area covered by the data or false if is an area w...
MD_SpatialRepresentationTypeCode
Definition: CodeList.h:523
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.
std::vector< MD_TopicCategoryCode > m_topicCategory
URI C++ Library.
Definition: Attributes.h:37
static te::dt::DateTime d(2010, 8, 9, 15, 58, 39)
MD_ProgressCode
status of the dataset or progress of a review
Definition: CodeList.h:459
void addCharacterSet(MD_CharacterSetCode code)
Adds a character coding standard in the dataset.
MD_Identification * clone() const
Gets a copy of this object.
void setScale(long d)
Sets resource scale. The scale of a map or other cartographic object expressed as a fraction or ratio...
const double & getLowerLeftX() const
It returns a constant reference to the x coordinate of the lower left corner.
void addTopicCategory(MD_TopicCategoryCode code)
Adds a theme of the dataset.
std::vector< MD_CharacterSetCode > m_charSet
Information required to identify a dataset.
Identification information contains information to uniquely identify the data.
void setSpatialRepType(te::md::MD_SpatialRepresentationTypeCode code)
Sets the spatial representation type.
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