<html>
<head>
<meta http-equiv="Content-Type" content="text/html;
charset=windows-1252">
</head>
<body>
<p><span lang="EN-US">OGR_G_GetX() can only work on a Point or a
LineString/LinearRing</span></p>
<p><span lang="EN-US">for a polygon, you need to extract the ring
first with OGR_G_GetGeometryRef() / OGR_G_GetGeometryCount()<br>
</span></p>
<p><span lang="EN-US">Even<br>
</span></p>
<div class="moz-cite-prefix">Le 29/03/2021 à 17:26, Joaquim Manuel
Freire Luís a écrit :<br>
</div>
<blockquote type="cite"
cite="mid:AM6PR04MB3959C265F190C7F5592EF08CA67E9@AM6PR04MB3959.eurprd04.prod.outlook.com">
<meta name="Generator" content="Microsoft Word 15 (filtered
medium)">
<div class="WordSection1">
<p class="MsoNormal"><span lang="EN-US">OK, one more from the
Julia wrappers. Playing with buffers now, and it works but I
want to get the points and that fails</span></p>
<p class="MsoNormal"><span lang="EN-US"> </span></p>
<p class="MsoNormal">julia> wkt = "POINT (1198054.34
648493.09)";</p>
<p class="MsoNormal"> </p>
<p class="MsoNormal">julia> dbf =
Gdal.buffer(Gdal.fromWKT(wkt), 500)</p>
<p class="MsoNormal"><span lang="EN-US">Geometry: POLYGON
((1198554.34 648493.09,1198553.65476738 64 ... .09))</span></p>
<p class="MsoNormal"><span lang="EN-US"> </span></p>
<p class="MsoNormal"><span lang="EN-US">julia>
toWKT(dbf)[1:90]</span></p>
<p class="MsoNormal"><span lang="EN-US">"POLYGON ((1198554.34
648493.09,1198553.65476738 648466.922021879,1198551.60094768
648440.8"</span></p>
<p class="MsoNormal"><span lang="EN-US"> </span></p>
<p class="MsoNormal"><span lang="EN-US">The ‘toWKT()’ function
calls OGR_G_ExportToWkt()</span></p>
<p class="MsoNormal"><span lang="EN-US"> </span></p>
<p class="MsoNormal"><span lang="EN-US">But now if I try to
extract the points with OGR_G_GetX() it errors</span></p>
<p class="MsoNormal"><span lang="EN-US"> </span></p>
<p class="MsoNormal"><span lang="EN-US">julia>
Gdal.OGR_G_GetX(dbf.ptr, 0)</span></p>
<p class="MsoNormal"><span lang="EN-US">ERROR 6: Incompatible
geometry for operation #
</span><span lang="EN-US">ç</span><span lang="EN-US">=============
????</span></p>
<p class="MsoNormal"><span lang="EN-US">0.0</span></p>
<p class="MsoNormal"><span lang="EN-US"> </span></p>
<p class="MsoNormal"><span lang="EN-US">julia>
Gdal.OGR_G_GetPointCount(dbf.ptr)
#
</span><span lang="EN-US">ç</span><span lang="EN-US">=============
Why so?</span></p>
<p class="MsoNormal"><span lang="EN-US">0</span></p>
<p class="MsoNormal"><span lang="EN-US"> </span></p>
<p class="MsoNormal"><span lang="EN-US">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.</span></p>
<p class="MsoNormal"><span lang="EN-US"> </span></p>
<p class="MsoNormal"><span lang="EN-US"> </span></p>
<p class="MsoNormal"><span lang="EN-US">Joaquim</span></p>
</div>
<br>
<fieldset class="mimeAttachmentHeader"></fieldset>
<pre class="moz-quote-pre" wrap="">_______________________________________________
gdal-dev mailing list
<a class="moz-txt-link-abbreviated" href="mailto:gdal-dev@lists.osgeo.org">gdal-dev@lists.osgeo.org</a>
<a class="moz-txt-link-freetext" href="https://lists.osgeo.org/mailman/listinfo/gdal-dev">https://lists.osgeo.org/mailman/listinfo/gdal-dev</a>
</pre>
</blockquote>
<pre class="moz-signature" cols="72">--
<a class="moz-txt-link-freetext" href="http://www.spatialys.com">http://www.spatialys.com</a>
My software is free, but my time generally not.</pre>
</body>
</html>