TransWikia.com

Displaying annotation data from CSV file on qgsmapcanvas

Geographic Information Systems Asked on June 28, 2021

I am developing a custom Qt application using QGIS(3.14) C++ API. I need to display the annotation layer on qgsmapcanvas.CSV files contains lat, long, and country name and comma as a delimiter. I followed PYQGIS developer CookBook(used it in C++ manner) and tried to render it as a vector layer on qgsmapcanvas. But it saying invalid file.

1.URL for my CSV file is :

QString uri = QString("C:/Users/Puneet/Desktop/annotation/COUNTRY.csvdelimiter=%1&xField=%2&yField=%3").arg(";").arg("latitude").arg("longitude");

2.vector layer formation:

QgsVectorLayer *layer = new QgsVectorLayer(uri, baseName , "delimitedtext");
what is going wrong in it ?

Add your own answers!

Ask a Question

Get help from others!

© 2024 TransWikia.com. All rights reserved. Sites we Love: PCI Database, UKBizDB, Menu Kuliner, Sharing RPP