[Gdal-dev] GetGeometryRef in scripts

Frank Warmerdam warmerdam at pobox.com
Tue Sep 20 20:09:09 EDT 2005


On 9/20/05, Kevin Ruland <kruland at ku.edu> wrote:
> It seems, if the script bindings operate on the GeometryGuy (instead of
> OGRGeometryH), we can drop the distinction between the SetGeometry &
> SetGeometryDirectly and have the wrapper function determine which method
> to envoke.  Of course, the method is determined by which of the parent*
> pointers is populated.

Kevin,

I don't really see that this is practical.  Even if we have a "free"
geometry we don't know that we ought to use SetGeometryDirectly()
since we don't know whether the script will continue to use the
geometry reference later. 
 
> I believe a strategy like this would hide the troubles of passing the
> wrong kind of Geometry into the wrong method, and at the same time
> provide for maximum efficiency.  Yes there would be code overhead to
> provide the safety -- extra tests, more complex implementation of
> constructors (Clone etc).
 
> Also instead of using OGRFeatureH, we would have to add some reference
> counting for the handle in order to allow for chained calls.

I am depressed by this whole concept of bending over backward
to support chaining.  I seems wrong to do all this backward referencing
of objects and I feel like it will one day make us all sorry.  

However, I leave it in your hands. 

Best regards,
-- 
---------------------------------------+--------------------------------------
I set the clouds in motion - turn up   | Frank Warmerdam, warmerdam at pobox.com
light and sound - activate the windows | http://pobox.com/~warmerdam
and watch the world go round - Rush    | Geospatial Programmer for Rent




More information about the Gdal-dev mailing list