tomojitakasu/RTKLIB — pull request #38 by eltorio (2014-08-10 18:15:13+00:00)
Title: Support for IGN RAF09 geoid

Dear Tomoji,
Thanks again for your work.
I'm french and in France the mandatory geoid is called RAF09 wich is the conversion beetween the ellipsoid and the french geoid (mandatory since 1969).
This model is free and can be downloaded here http://geodesie.ign.fr/contenu/fichiers/documentation/grilles/metropole/RAF09.mnt
The format is specific to our geographical institute (IGN).
Since it is a text only format with variable field length it cannot be directly used.
On my own fork of your work, I made a parser in geoid.c. I send you this pull request since it can be useful for french RTKLIB users.

The parser does not work like your other models.
When opengeoid is called get_raf09_grid is called. It parses the file a places the result in a dynamic 381x421 double grid stored in a static raf09_grid_t struct.
When closegeoid is called free_raf09_grid is called for freeing the memory.
geoidh_raf09 works like geoidh_emb
a small raf09_getline is for avoiding the use of POSIX getline wich is not available on Android (and my fork is for using in an Android project)

I add also the directory test/raf09 wich content a very small utility for testing results, reentrance and memory leaks.
The test is simple a main loop convert 13 french positions (including the 4 corners of the model), with RAF09 model, EGM2008 M25 model, embedded model and with a fake RAF09.mnt file (for testing wrong file detection). This loop is ran 1000 times.
The results are compared to IGN Circé results. IGN Circé is a free software provided by IGN. IGN claims that the precsion is 5cm so I checked if my positions are within Circé with 5cm tolerance.

Hope this can be useful for french users.