[gdal-dev] OGR_G_ExportToWkt make MEX crash

2011-09-06 Thread Joaquim Luis
Hi, I wrote a OGR C MEX wrapper to use in Matlab which already works in many cases. However, I had a situation when trying to fetch the reference info. The chunk of code below now works, but if I use the commented line that calls OGR_G_ExportToWkt than Matlab crashes at that line. However,

Re: [gdal-dev] OGR_G_ExportToWkt make MEX crash

2011-09-06 Thread Frank Warmerdam
On 11-09-06 08:10 AM, Joaquim Luis wrote: Hi, I wrote a OGR C MEX wrapper to use in Matlab which already works in many cases. However, I had a situation when trying to fetch the reference info. The chunk of code below now works, but if I use the commented line that calls OGR_G_ExportToWkt than

Re: [gdal-dev] OGR_G_ExportToWkt make MEX crash

2011-09-06 Thread Joaquim Luis
OGR_G_* functions are intended to operate on OGRGeometry objects while OSR* functions operate on OGRSpatialReferences. Your hSRS object is an OGRSpatialReference and not suitable to pass to OGR_G_ExportToWkt(). You should use OSRExportToWkt() to translate an OGRSpatialReference into it's

Re: [gdal-dev] OGR_G_ExportToWkt make MEX crash

2011-09-06 Thread Frank Warmerdam
On Tue, Sep 6, 2011 at 8:48 AM, Joaquim Luis jl...@ualg.pt wrote: OGR_G_* functions are intended to operate on OGRGeometry objects while OSR* functions operate on OGRSpatialReferences.  Your hSRS object is an OGRSpatialReference and not suitable to pass to OGR_G_ExportToWkt(). You should use