Boost logo

Geometry :

Subject: [ggl] Projections: Patch to get access to parameters
From: Mateusz Loskot (mateusz)
Date: 2009-06-18 20:14:15


Chris Browet wrote:
>> BTW, I don't quite get the reasoning behind templatizing the
>> "parameters" struct... It's quite static and expected by all
>> proj4 related functions. It only obfuscates/complicates the
>> code, IMHO.
>
> Hmm, it is not a template, is it?
>
> struct parameters : public impl::pj_const_pod
> {
> std::string name;
> std::vector<impl::pvalue> params;
> };
>
> or I don't understand the problem :-)
>
> Sorry if I was not clear. I meant that, in the projections base classes
> (e.g. base_t_f in base_static.hpp), the parameter type is templatized,
> while, AFAIK, there is no way to use anything else than the stock
> parameter struct (or, at least, it doesn't make any sense).

In theory, it would be possible for users to define custom base_t_f
class and provide custom collection of types of projections.
It could be improved if parameters type is a tuple.
Though at this moment, it sounds like a science fiction I think -
no need to dig it.

Back to complicated code, I'm not sure how it complicates it.
If "complex-looking code" would be the only reasons, I think it's better
to leave it as is.

Cheers,

-- 
Mateusz Loskot, http://mateusz.loskot.net
Charter Member of OSGeo, http://osgeo.org

Geometry list run by mateusz at loskot.net