Tuesday, March 31, 2009

Trust No One

Here is my "new" approach to topological integration of the planar map for X-Plane scenery.  (I say new because it's new to the code, not because this is a new approach.)

Trust no one.

  • Topological data is never read from disk.  It is never imported.  We don't trust TIGER or VMAP0 to be correctly integrated.  In the case of VMAP0, I can tell you for a fact that it has errors.  (I've never caught TIGER, but the older code wasn't very sensitive.
  • Instead, all data is imported and sanitized on input by CGAL.
  • Once CGAL has the data, we are home free; the 3.3.1 Planar map with an exact numeric type is rock solid.
Of course, this means integrating the data every time we use it, which means my big bad new workstation isn't as big and bad as you'd think, relative to a much more expensive problem.

The advantages of this are:
  • It's as good as CGAL is (and CGAL is very, very good). Bad data can't ruin the party.
  • Because bad data can't ruin the party, it's safe for third party use - that is, the tools can handle third party data that hasn't been "degunked".

Monday, March 30, 2009

CGAL on OS X - Compiler Settings

I was getting random precondition failures with CGAL's arrangement_2.  (Arrangement_2 is a set of C++ templates that manage planar intersections.  It is totally wicked awesome.)

Turns out that the Mac does not default with -frounding-math on, and, well, CGAL needs that.