[gdal-dev] OGRLinestring from two vectors using GDAL C++

Mateusz Loskot mateusz at loskot.net
Thu Sep 12 01:02:32 PDT 2019


On Thu, 12 Sep 2019 at 09:50, Ahmet Temiz <ahmettemiz88 at gmail.com> wrote:
>
> I have two vectors of vx-values and y_values
>
> like vx { 1.1,2.2 ....} and vy { 3.3,55...}
>
> How can I ogrLinestring from these two vectors using GDAL C++ ?

If you browsed the API reference of OGRLineString and
its base class OGRSimpleCurve,
https://gdal.org/doxygen/classOGRSimpleCurve.html,
you would have figured it out in no time:

OGRLineString line;
for (...)
    line.addPoint(vx[i], vy[i]);

Best regards,
-- 
Mateusz Loskot, http://mateusz.loskot.net


More information about the gdal-dev mailing list