[Gdal-dev] Expose Array Based Coordinate Transformation Methods in CoordinateTransformation (#1615)

Tamas Szekeres szekerest at gmail.com
Sun May 6 17:08:40 EDT 2007


Ok, I've recognized lately that I was a bit indulged by the C# default
marshaler which handles this kind of allocation internally so the C#
typemaps doesn't rely on the $dim0 substitution.

Now, I've made the explicit %apply typemap redirection internal to C#
so anyone can implement this new typemap for the other languages
anytime in the future.

To avoid a number of unnecessary memory copy I'll continue to suggest the
(int nCount, double *x, double *y, double *z)  signature of this
function. One can possibly implement this new typemap by replacing
$dim0 with nCount in the typemap implementation to achieve the desired
results. I guess we can agree in using  the nCount name every time
when this typemap will come into the picture.

Best regards,

Tamas


2007/5/6, Ari Jolma <ari.jolma at tkk.fi>:
> Tamas Szekeres kirjoitti:
> > Hi All,
> >
> > I had a first crack at adding CoordinateTransformation.TransformPoints
> > to the SWIG interface to provide the transformation of the given
> > number of points passed as arrays of coordinates.
> > I've tested the code for the C# bindings and worked pretty well. If
> > someone have further issues please give me a comment at:
> > http://trac.osgeo.org/gdal/ticket/1615
>
> Sorry, I'll comment here. This is from point of view of Perl bindings.
>
> You are using typemap "double argout[ANY]" which seems to require that
> you know the ANY beforehand. The same typemap is implicitly used
> elsewhere in GCPsToGeoTransform where ANY is 6.
>
> This case seems to require a malloc, a copy to the malloced array, and
> after the call a copy to a new Perl array, and  freeing of the malloced
> array.
>
> I need to at least define a new typemap and that seems to mean that I
> can't use "double argout[ANY]". The new typemap could be something like
> "double *inout", but I don't know how the nCount gets set (and there are
> possibly three values for it since there are three input arrays). I'd be
> inclined to use something like "int, double *, double *, double *"
> typemap since this kind of data is easiest to keep in one 2D array in Perl.
>
> At this point, however, I'd like to postpone implementing this method in
> the Perl bindings.
>
> Regards,
>
> Ari
>
> >
> > Best regards,
> >
> > Tamas
> > _______________________________________________
> > Gdal-dev mailing list
> > Gdal-dev at lists.maptools.org
> > http://lists.maptools.org/mailman/listinfo/gdal-dev
>
>
>



More information about the Gdal-dev mailing list