Hi all,

I tracked down my problem with shape-decode to a case of uncaught parallel lines in the function getIntersection in util.cxx. The resulting computed intersection point was obviously very distant, creating the strange coordinates that Curt noticed. I fixed it by raising the "epsilon" constant from 1e-14 to 1e-12 (patch attached).

Regards,
Maxime


Maxime Guillaud wrote:
Curtis Olson wrote:
A bucket coordinate of -593:2 suggests that this shapefile may contain some bogus data. (or there could be a bug leading up to this) but I believe the portion prior to the ":" represents a whole degree coordinate of the bucket, so this should range from -180 to +179 for latitude and -90 to +89 for longitude. -593 is completely outside of possible reality. So the question is, is this a problem with the shapefile data, or some problem processing the data in the shape-decode code. Regards,

Curt.

Thanks for spotting this, Curt ! Looking at the output of shape-decode, it looks like the data read from the shapefile is reasonable:

   Point 5 (0.609977, 46.997)
   Point 6 (0.605342, 46.9964)
   Point 7 (0.601051, 46.9955)

However, in the following processing steps the coordinates for point 7 appear wrong:

point = 6
 0.605333, 46.9964, 0  -  -2828.93, -570.523, 0

The relevant excerpt of the log is here: http://www.mguillaud.net/fg/log2
Anyone familiar with the internals of shape-decode (I am not) can comment on this ?

Regards,
Maxime



------------------------------------------------------------------------------
Let Crystal Reports handle the reporting - Free Crystal Reports 2008 30-Day trial. Simplify your report design, integration and deployment - and focus on what you do best, core application coding. Discover what's new with Crystal Reports now. http://p.sf.net/sfu/bobj-july
_______________________________________________
Flightgear-devel mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/flightgear-devel

--- terragear-cs/src/Lib/Geometry/util.cxx.orig	2009-08-06 09:46:41.000000000 +0200
+++ terragear-cs/src/Lib/Geometry/util.cxx	2009-08-07 22:14:43.000000000 +0200
@@ -24,7 +24,7 @@
 		 const Point3D &p2, const Point3D &p3,
 		 Point3D &intersection)
 {
-    const double my_eps = 0.00000000000001;
+    const double my_eps = 0.000000000001;
     
     double u_num =
         ((p3.x()-p2.x())*(p0.y()-p2.y()))-((p3.y()-p2.y())*(p0.x()-p2.x()));
------------------------------------------------------------------------------
Let Crystal Reports handle the reporting - Free Crystal Reports 2008 30-Day 
trial. Simplify your report design, integration and deployment - and focus on 
what you do best, core application coding. Discover what's new with 
Crystal Reports now.  http://p.sf.net/sfu/bobj-july
_______________________________________________
Flightgear-devel mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/flightgear-devel

Reply via email to