[GRASS-user] OpenFileGDB input error

Markus Metz markus.metz.giswork at gmail.com
Thu Sep 28 13:22:10 PDT 2017


On Thu, Sep 28, 2017 at 7:56 PM, Even Rouault <even.rouault at spatialys.com>
wrote:
>
> > As of trunk r71513, v.in.ogr converts any curve types to linear
equivalents
>
> > with OGR_G_GetLinearGeometry().
>
>
>
> r71513 is going to leak memory. The return of OGR_G_GetLinearGeometry()
must be freed with OGR_G_DestroyGeometry()

I must have missed that "The ownership of the returned geometry belongs to
the caller."

In contrast, with OGR_G_ForceTo() "a new [geometry is] returned (or
potentially the same one)", therefore OGR_G_GetLinearGeometry() is easier
to use.

>
> (be careful to call it only on a Ogr_geometry returned by
OGR_G_GetLinearGeometry() and not the one returned by
OGR_F_GetGeometryRef())

OK, done in trunk r71514.

By now, v.in.ogr is peppered with #if GDAL_VERSION_NUM >= X, looks like at
some stage we should have two versions, one for GDAL 1.x, another one for
GDAL 2.x...

Markus M
> --
>
> Spatialys - Geospatial professional services
>
> http://www.spatialys.com
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.osgeo.org/pipermail/grass-user/attachments/20170928/ed9d32b1/attachment.html>


More information about the grass-user mailing list