[geos-commits] r3340 - in trunk: include/geos/algorithm
include/geos/geomgraph src/algorithm src/geomgraph
svn_geos at osgeo.org
svn_geos at osgeo.org
Tue May 10 05:51:31 EDT 2011
Author: strk
Date: 2011-05-10 02:51:31 -0700 (Tue, 10 May 2011)
New Revision: 3340
Modified:
trunk/include/geos/algorithm/LineIntersector.h
trunk/include/geos/geomgraph/EdgeIntersection.h
trunk/include/geos/geomgraph/EdgeIntersectionList.h
trunk/src/algorithm/LineIntersector.cpp
trunk/src/geomgraph/Edge.cpp
trunk/src/geomgraph/EdgeIntersectionList.cpp
Log:
Revert "Use long double to compute edge distance." (r3334). Simple double in HCoordinate made #350 pass anyway.
Modified: trunk/include/geos/algorithm/LineIntersector.h
===================================================================
--- trunk/include/geos/algorithm/LineIntersector.h 2011-05-10 09:51:05 UTC (rev 3339)
+++ trunk/include/geos/algorithm/LineIntersector.h 2011-05-10 09:51:31 UTC (rev 3340)
@@ -74,7 +74,7 @@
/// result of <b>rounding</b> points which lie on the line,
/// but not safe to use for <b>truncated</b> points.
///
- static long double computeEdgeDistance(const geom::Coordinate& p, const geom::Coordinate& p0, const geom::Coordinate& p1);
+ static double computeEdgeDistance(const geom::Coordinate& p, const geom::Coordinate& p0, const geom::Coordinate& p1);
static double nonRobustComputeEdgeDistance(const geom::Coordinate& p,const geom::Coordinate& p1,const geom::Coordinate& p2);
@@ -241,7 +241,7 @@
*
* @return the edge distance of the intersection point
*/
- long double getEdgeDistance(int geomIndex,int intIndex) const;
+ double getEdgeDistance(int geomIndex,int intIndex) const;
private:
Modified: trunk/include/geos/geomgraph/EdgeIntersection.h
===================================================================
--- trunk/include/geos/geomgraph/EdgeIntersection.h 2011-05-10 09:51:05 UTC (rev 3339)
+++ trunk/include/geos/geomgraph/EdgeIntersection.h 2011-05-10 09:51:31 UTC (rev 3340)
@@ -49,13 +49,13 @@
geom::Coordinate coord;
// the edge distance of this point along the containing line segment
- long double dist;
+ double dist;
// the index of the containing line segment in the parent edge
int segmentIndex;
EdgeIntersection(const geom::Coordinate& newCoord,
- int newSegmentIndex, long double newDist)
+ int newSegmentIndex, double newDist)
:
coord(newCoord),
dist(newDist),
@@ -74,7 +74,7 @@
int getSegmentIndex() const { return segmentIndex; }
- long double getDistance() const { return dist; }
+ double getDistance() const { return dist; }
};
Modified: trunk/include/geos/geomgraph/EdgeIntersectionList.h
===================================================================
--- trunk/include/geos/geomgraph/EdgeIntersectionList.h 2011-05-10 09:51:05 UTC (rev 3339)
+++ trunk/include/geos/geomgraph/EdgeIntersectionList.h 2011-05-10 09:51:31 UTC (rev 3340)
@@ -77,7 +77,7 @@
* @return the EdgeIntersection found or added
*/
EdgeIntersection* add(const geom::Coordinate& coord,
- int segmentIndex, long double dist);
+ int segmentIndex, double dist);
iterator begin() { return nodeMap.begin(); }
iterator end() { return nodeMap.end(); }
Modified: trunk/src/algorithm/LineIntersector.cpp
===================================================================
--- trunk/src/algorithm/LineIntersector.cpp 2011-05-10 09:51:05 UTC (rev 3339)
+++ trunk/src/algorithm/LineIntersector.cpp 2011-05-10 09:51:31 UTC (rev 3340)
@@ -55,12 +55,12 @@
namespace algorithm { // geos.algorithm
/*public static*/
-long double
+double
LineIntersector::computeEdgeDistance(const Coordinate& p,const Coordinate& p0,const Coordinate& p1)
{
double dx=fabs(p1.x-p0.x);
double dy=fabs(p1.y-p0.y);
- long double dist=-1.0; // sentinel value
+ double dist=-1.0; // sentinel value
if (p==p0) {
dist=0.0;
} else if (p==p1) {
@@ -69,8 +69,8 @@
else
dist=dy;
} else {
- long double pdx=fabsl((long double)p.x - p0.x);
- long double pdy=fabsl((long double)p.y - p0.y);
+ double pdx=fabs(p.x - p0.x);
+ double pdy=fabs(p.y - p0.y);
if (dx > dy)
dist = pdx;
else
@@ -179,10 +179,10 @@
}
/*public*/
-long double
+double
LineIntersector::getEdgeDistance(int segmentIndex,int intIndex) const
{
- long double dist=computeEdgeDistance(intPt[intIndex],
+ double dist=computeEdgeDistance(intPt[intIndex],
*inputLines[segmentIndex][0],
*inputLines[segmentIndex][1]);
return dist;
Modified: trunk/src/geomgraph/Edge.cpp
===================================================================
--- trunk/src/geomgraph/Edge.cpp 2011-05-10 09:51:05 UTC (rev 3339)
+++ trunk/src/geomgraph/Edge.cpp 2011-05-10 09:51:31 UTC (rev 3340)
@@ -162,7 +162,7 @@
#endif
const Coordinate& intPt=li->getIntersection(intIndex);
unsigned int normalizedSegmentIndex=segmentIndex;
- long double dist = li->getEdgeDistance(geomIndex, intIndex);
+ double dist=li->getEdgeDistance(geomIndex,intIndex);
// normalize the intersection point location
unsigned int nextSegIndex=normalizedSegmentIndex+1;
Modified: trunk/src/geomgraph/EdgeIntersectionList.cpp
===================================================================
--- trunk/src/geomgraph/EdgeIntersectionList.cpp 2011-05-10 09:51:05 UTC (rev 3339)
+++ trunk/src/geomgraph/EdgeIntersectionList.cpp 2011-05-10 09:51:31 UTC (rev 3340)
@@ -63,7 +63,7 @@
EdgeIntersection*
EdgeIntersectionList::add(const Coordinate& coord,
- int segmentIndex, long double dist)
+ int segmentIndex, double dist)
{
EdgeIntersection *eiNew=new EdgeIntersection(coord, segmentIndex, dist);
More information about the geos-commits
mailing list