Subject: [ggl] Hello + some newbie questions
From: Mateusz Loskot (mateusz)
Date: 2009-05-05 17:03:55
Barend Gehrels wrote:
>>> It is an automatic conversion of proj4 code. [...]
>> 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 (?)"
Personally, I like the fixing option :-)
>> 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.
No problem, really.
> 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.
I see, good.
> 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".
Sounds like a good idea.
> The template parameters are always LL, XY and PAR and I propose to
> change them in LatLong, Cartesian and Parameter to follow the guidelines.
I second this idea. The new names are more readable to me.
Where would you propose to start changing it?
I mean, which parts are not generated for sure?
Or we can defer this after the projection generator program is updated.
> 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)
Do you propose to keep constants like
static double const pi = ...
but to change their values to boost::math:: stuff?
Or remove out own constants and use boost::math::* directly in
all ggl:: code?
> 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
> 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.
-- Mateusz Loskot, http://mateusz.loskot.net Charter Member of OSGeo, http://osgeo.org
Geometry list run by mateusz at loskot.net