[QGIS-Developer] On the fly on MapCanvas

Erick Duran duranerick17 at gmail.com
Mon Mar 16 20:20:57 PDT 2020


Estimados muy buenas noches

Necesito alguien me ayude, no soy muy experto en el uso de qgis, estoy
usando la versión 3.12, quiero utilizar el complemento azimut y distancia y
me aparece este error TypeError: 'NoneType' object is not subscriptable

Traceback (most recent call last):
  File "C:/Users/ERICK/AppData/Roaming/QGIS/QGIS3\profiles\default/python/plugins\AzimuthDistanceCalculator\azimuthsAndDistances\azimuthsAndDistances.py",
line 169, in fillTable
    if self.points[0] == self.points[len(self.points) - 1]:
TypeError: 'NoneType' object is not subscriptable


Versión de Python: 3.7.0 (v3.7.0:1bf9cc5093, Jun 27 2018, 04:59:51)
[MSC v.1914 64 bit (AMD64)]
Versión de QGIS: 3.12.0-București București, cd141490ec

Agradere mucho me ayuden como soluciono este problema

saludos..

*Erick E. Duran*

*Técnico* *agrícola*

*El. 3172-93-35*

*Email. duranerick17 at gmail.com <duranerick17 at gmail.com> *






El lun., 16 de mar. de 2020 a la(s) 20:54, <bachgist at gmail.com> escribió:

> Dear QGIS-Developer,
>
> I am writing a simple program to display raster data using qgis api C++.
>
> When I open raster data that has different coordinate systems, the
> on-the-fly feature does not work on my mapCanvas.
>
> Can someone help me?
>
> This is my code:
>
> OpenGisData::OpenGisData(QWidget *parent)
>
> : QMainWindow(parent)
>
> {
>
>     setupUi(this);
>
>     QWidget* centralWidget = OpenGisDataClass::centralWidget;
>
>     mMapCanvas = new QgsMapCanvas(centralWidget);
>
>     QGridLayout* gridLayout = new QGridLayout;
>
>     gridLayout->addWidget(mMapCanvas);
>
>     centralWidget->setLayout(gridLayout);
>
>     connect(actionOpen, &QAction::triggered, this, &OpenGisData::open);
>
> }
>
> void OpenGisData::open()
>
> {
>
>     QString fileName = QFileDialog::getOpenFileName(this, "Open data",
> "D:\\Test");
>
>     if (!fileName.isEmpty())
>
>     {
>
>         QgsRasterLayer* rasterLayer = new QgsRasterLayer(fileName);
>
>         if (rasterLayer && rasterLayer->isValid())
>
>         {
>
>             QList<QgsMapLayer*> layers = mMapCanvas->layers();
>
>             layers.append(rasterLayer);
>
>
>
>             mMapCanvas->setLayers(layers);
>
>             mMapCanvas->zoomToFullExtent();
>
>         }
>
>     }
>
> }
>
>
>
> Thank You
> _______________________________________________
> QGIS-Developer mailing list
> QGIS-Developer at lists.osgeo.org
> List info: https://lists.osgeo.org/mailman/listinfo/qgis-developer
> Unsubscribe: https://lists.osgeo.org/mailman/listinfo/qgis-developer
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.osgeo.org/pipermail/qgis-developer/attachments/20200316/5a7f7e0a/attachment-0001.html>


More information about the QGIS-Developer mailing list