Boost logo

Geometry :

Subject: [ggl] Hello + some newbie questions
From: Barend Gehrels (Barend.Gehrels)
Date: 2009-04-27 09:03:40


Hi Mateusz,

>
>> It is an automatic conversion of proj4 code. [...]
>
> Barend,
>
> Do you mean automatic that the code of PROJ.4 is automatically
> processed by some script/program and C++ template-based output
> is generated?
Sure. I saw yesterdaynight that you editted one or two files and was
this morning starting a mail about this (didn't finish yet), pasted here:

"One thing more about this. These types of warnings sometimes come from
the projection sources. They are converted automatically, so they origin
from the proj4 sources. This should actually not be corrected here but
either in the conversion program (not a beauty) or should be turned off
by pragma (in MS) or compiler flag (?)"

> I'm asking because I've spent some time recently on
> refactoring the code according to the guidelines, fixing some
> annoyances and cleaning warnings.
Sorry about this. It is also written in the projection files: "This file
is automatically generated. DO NOT EDIT". But in multi-editing you can
oversee these things so I could have mentioned this, but didn't think
about it.
As far as I can see you've edited two projection files, nell.hpp and
robin.hpp, so we're not much too late. Most files you editted were in
the subfolder "impl", which were manually converted and will not be
regenerated. So no big problem.

There is more to say about projections. They currently live in another
namespace, "projections". This was to distinguish them from the rest,
but now that the rest is not in "geometry" anymore we might consider to
set these in "ggl::projection".

The template parameters are always LL, XY and PAR and I propose to
change them in LatLong, Cartesian and Parameter to follow the guidelines.

The XY had to be changed anyway because we can also project 3d points
(where height as the third dimension is either untouched, or might be
taken into account in projection parameters in the future).

The coordinate types are now always double but should be changed to
extracted-from-point-type, where it can be a big number.

The constants HALFPI etc should be replaced by / forwarded to
boost::math::constants::pi<T> / 2.0 etc (this should also be done for
our own ggl::math)

The projection/transformer is actually a strategy and should be moved,
I've created an inverse_transformer.

The functions forward/inverse return true/false and I will come back to
these.

This inspired by David's mail but also because I happened to need more
projection things this morning, will mail about this later.

> But, if this code was generated automatically it may look this
> refactoring was pointless and will get lost once the C++ wrapper
> is being re-generated.
The conversion program should be updated and then it can be regenerated
following the guidelines, this is much easier anyway.

Regards, Barend


Geometry list run by mateusz at loskot.net