Subject: Re: [geometry] extensions
From: Barend Gehrels (barend_at_[hidden])
Date: 2012-02-09 14:17:16
Thanks for your propositions!
On 9-2-2012 12:44, Krzysztof Czainski wrote:
> Like promised, I present a proposition of functions new_projection()
> and make_shared_projection(). They are useful, when:
> - you have a small set of types of projections you'll use,
> - you know the type of projection during it's creation, and later you
> want to use it through an abstract base pointer,
> - you want to avoid the overhead of factory: generating code for
> creating a projection of every type you don't use, and selecting the
> type from a string.
> Example usecase:
> typedef ... Geo;
> typedef ... Xy;
> typedef stere_ellipsoid<Geo,Xy> ProjA;
> typedef sterea_ellipsoid<Geo,Xy> ProjB;
> projection<Geo,Xy>* proj = 0;
> if ( some_cond )
> proj = new_projection< ProjA, Geo, Xy >( params );
> proj = new_projection< ProjB, Geo, Xy >( params );
I certainly think this is very useful.
> The functions are defined in attached files: new_projection.hpp and
> make_shared_projection.hpp, which are intended to reside
> in geometry\extensions\gis\projections. An overload of both functions
> is provided, which allows a simplified use, omitting the two explicit
> template parameters Geo and Xy, which are part of the ProjA type anyway:
> proj = new_projection< ProjA >( params );
> In order for this to work, the concrete projections must provide
> typedefs for these types. So I propose to add these typedefs to struct
> detail::base_t_f, and also to the class projection for consistency -
> Hope some of the above is useful, and thanks again for Boost.Geometry ;-)
Nice to hear.
I will look at this soon, and apply this patches/additions and from your
previous mail. But not this weekend I'm afraid, because Monday is the
deadline for 1.49 bugs/doc fixes.
I like to hear people involved with the projections again. There was a
year or so not really news or traffic about it.
Geometry list run by mateusz at loskot.net