[Gdal-dev] importFromWkt() problem

Petteri Packalen packalen at cs.joensuu.fi
Sat Sep 2 13:56:34 EDT 2006


Frank,

> Yes, that is correct.  You should not need to do anything to deallocate
> the geometry after using SetGeometryDirectly().
>
> How do you deallocate geo_trans though?  You can't use delete on the
> geo_trans pointer after passing it to ImportFromWkt() since the pointer
> is changed by that function.  I suspect this is your problem.

I don't de-allocate it at all, I use the same buffer all the time. There 
was a small bug in my first mail, see the longer version of the code. I 
pass the address of the COPY of the pointer to createFromWkt() or 
importFromWkt(). Thus original pointer always points to the beginning of 
the memory allocation.I will use the *now* working version also later 
because it is more simple (I don't have to instantiate proper geometry type, I may 
use OGRGeometry). I just don't understand why the another approach 
does not work.

Best Regards,
Petteri





More information about the Gdal-dev mailing list