[gdal-dev] Can't access to points in a buffer returned geometry with OGR_G_GetX

Joaquim Manuel Freire Luís jluis at ualg.pt
Mon Mar 29 08:26:24 PDT 2021


OK, one more from the Julia wrappers. Playing with buffers now, and it works but I want to get the points and that fails

julia> wkt = "POINT (1198054.34 648493.09)";

julia> dbf = Gdal.buffer(Gdal.fromWKT(wkt), 500)
Geometry: POLYGON ((1198554.34 648493.09,1198553.65476738 64 ... .09))

julia> toWKT(dbf)[1:90]
"POLYGON ((1198554.34 648493.09,1198553.65476738 648466.922021879,1198551.60094768 648440.8"

The 'toWKT()' function calls OGR_G_ExportToWkt()

But now if I try to extract the points with OGR_G_GetX() it errors

julia> Gdal.OGR_G_GetX(dbf.ptr, 0)
ERROR 6: Incompatible geometry for operation                    # <=============== ????
0.0

julia> Gdal.OGR_G_GetPointCount(dbf.ptr)                           # <=============== Why so?
0

Although the toWKT() works, tat's an ascii representation but I want I want to access them in binary (not in WKB) to send to GMT.


Joaquim
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.osgeo.org/pipermail/gdal-dev/attachments/20210329/b85598b1/attachment.html>


More information about the gdal-dev mailing list