[gdal-dev] OGR_G_ExportToWkt make MEX crash

Joaquim Luis jluis at ualg.pt
Tue Sep 6 11:48:57 EDT 2011


> 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
> WKT representation.
>
> Best regards,

Thanks Frank.

This is also a result of my attempt to understand all the OGR model plus 
inventing a way of wrapping it all inside a single StructureArray (the 
C-MEX API). So let me ask one further question about the model. Is is 
possible to have the case

Dataset --> SRS
                --> Feature1 --> Geom1 --> SRS1
                --> Feature2 --> Geom2 --> SRS2
                --> ...

that is, different SpatialReferences inside the same Dataset?

Thanks

Joaquim


More information about the gdal-dev mailing list