root/MGET/Branches/Jason/Libraries/geos-3.3.2/src/geom/Coordinate.cpp @ 891

Revision 891, 1.3 KB (checked in by jjr8, 17 months ago)

* Incremented build number.
* Added Libraries/geos-3.3.2

Line 
1/**********************************************************************
2 * $Id: Coordinate.cpp 3521 2011-11-29 14:01:25Z strk $
3 *
4 * GEOS - Geometry Engine Open Source
5 * http://geos.refractions.net
6 *
7 * Copyright (C) 2001-2002 Vivid Solutions Inc.
8 *
9 * This is free software; you can redistribute and/or modify it under
10 * the terms of the GNU Lesser General Public Licence as published
11 * by the Free Software Foundation.
12 * See the COPYING file for more information.
13 *
14 **********************************************************************/
15
16#include <geos/geom/Coordinate.h>
17#include <geos/platform.h> // for ISNAN
18
19#include <sstream>
20#include <string>
21#include <iomanip>
22
23#ifndef GEOS_INLINE
24# include <geos/geom/Coordinate.inl>
25#endif
26
27using namespace std;
28
29namespace geos {
30namespace geom { // geos::geom
31
32Coordinate Coordinate::nullCoord=Coordinate(DoubleNotANumber,DoubleNotANumber,DoubleNotANumber);
33
34Coordinate&
35Coordinate::getNull()
36{
37        return nullCoord;
38}
39
40string
41Coordinate::toString() const
42{
43        ostringstream s;
44        s << std::setprecision(17) << *this;
45        return s.str();
46}
47
48std::ostream& operator<< (std::ostream& os, const Coordinate& c)
49{
50        if ( ISNAN(c.z) )
51        {
52                os << c.x << " " << c.y;
53        } else {
54                os << c.x << " " << c.y << " " << c.z;
55        }
56        return os;
57}
58
59} // namespace geos::geom
60} // namespace geos
61
Note: See TracBrowser for help on using the browser.