[gdal-dev] OGRGeometry creation

Yuriy Rusinov yrusinov at gmail.com
Fri Nov 23 06:32:48 EST 2007


Dear Colleagues !

I try to create geometry object using wkt-string. I do
    OGRGeometry * poOGRGeom;
    const char* obWkt = "POLYGON((...,...))";
    char * pszWkt = new char [strlen (obWkt)];
    strncpy (pszWkt, obWkt, strlen (obWkt));
    OGRSpatialReference *ref = new OGRSpatialReference ();

    OGRErr ier = OGRGeometryFactory::createFromWkt (&pszWkt, ref,
&poOGRGeom);
    if (ier == OGRERR_NONE)
    {
        char ** wkt = new char*;
        wkt[0] = new char[1000];
        poOGRGeom->exportToWkt (wkt);
        ...
    }

This code works fine under Linux, but under Windows (Visual Studio 2003) it
fails on call of any function-member OGRGeometry class. Where is the
troubles ?

-- 
Best regards,
Sincerely yours,
Yuriy Rusinov
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.osgeo.org/pipermail/gdal-dev/attachments/20071123/15fbc4fa/attachment.html


More information about the gdal-dev mailing list