Files
secondo/Algebras/OSM/NodeData.cpp
2026-01-23 17:03:45 +08:00

151 lines
3.1 KiB
C++

/*
----
This file is part of SECONDO.
Copyright (C) 2004, University in Hagen, Department of Computer Science,
Database Systems for New Applications.
SECONDO is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation; either version 2 of the License, or
(at your option) any later version.
SECONDO is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with SECONDO; if not, write to the Free Software
Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
----
//paragraph [1] Title: [{\Large \bf \begin {center}] [\end {center}}]
//[TOC] [\tableofcontents]
//[_] [\_]
[1] Implementation of the OSM Algebra
June-November, 2011. Thomas Uchdorf
[TOC]
1 Overview
This implementation file contains the implementation of the class
~NodeData~.
For more detailed information see NodeData.h.
2 Defines and Includes
*/
// [...]
#undef __TRACE__
//#define __TRACE__ cout << __FILE__ << "::" << __LINE__;
#define __TRACE__
// --- Including header-files
#include "NodeData.h"
#include "OsmImportOperator.h"
#include <iostream>
// --- Constructors
// Constructor
NodeData::NodeData ()
: m_id (0), m_lon (0.), m_lat (0.),
m_amenity (OsmImportOperator::getUndefinedStr ()),
m_name (OsmImportOperator::getUndefinedStr ()),
m_values ()
{
// empty
}
// Destructor
NodeData::~NodeData ()
{
// empty
}
// --- Methods
void NodeData::setId (const int & id)
{
m_id = id;
}
void NodeData::setLon (const double & lon)
{
m_lon = lon;
}
void NodeData::setLat (const double & lat)
{
m_lat = lat;
}
void NodeData::setAmenity (const std::string & amenity)
{
m_amenity = amenity;
}
void NodeData::setName (const std::string & name)
{
m_name = name;
}
const int & NodeData::getId () const
{
return m_id;
}
const double & NodeData::getLon () const
{
return m_lon;
}
const double & NodeData::getLat () const
{
return m_lat;
}
const std::string & NodeData::getAmenity () const
{
return m_amenity;
}
const std::string & NodeData::getName () const
{
return m_name;
}
const std::vector<std::string> & NodeData::getValues ()
{
m_values.clear ();
m_values.push_back (OsmImportOperator::convIntToStr (getId ()));
m_values.push_back (OsmImportOperator::convDblToStr (getLon ()));
m_values.push_back (OsmImportOperator::convDblToStr (getLat ()));
m_values.push_back (getAmenity ());
m_values.push_back (getName ());
return m_values;
}
void NodeData::print () const
{
printNode (*this);
}
std::ostream &operator<<(std::ostream &ostr, const NodeData &node)
{
ostr << "NODE Id = " << node.getId ();
ostr << ", Lon = " << node.getLon ();
ostr << ", Lat = " << node.getLat ();
ostr << ", Amenity = " << node.getAmenity ();
ostr << ", Name = " << node.getName ();
return ostr;
}
void printNode (const NodeData &node)
{
std::cout << node << std::endl;
}