Stack Exchange Network

Stack Exchange network consists of 175 Q&A communities including Stack Overflow, the largest, most trusted online community for developers to learn, share their knowledge, and build their careers.

Visit Stack Exchange
The results are in! See what nearly 90,000 developers picked as their most loved, dreaded, and desired coding languages and more in the 2019 Developer Survey.

Questions tagged [qgsmapcanvas]

The tag has no usage guidance.

1
vote
0answers
35 views

How to switch on snap option in QGIS 2.18 when creating customize polygon

How to switch on snap option in QGIS 2.18 when creating customize polygon as in: class customPoly(QgsMapToolEmitPoint): def __init__(self, iface): self.iface = iface QgsMapToolEmitPoint....
1
vote
1answer
37 views

Overlay raster above uploaded shpfile but behind background?

I have a .shp file of the world oceans (hydropolys.shp) and create a map with it in QGIS, so the background of the image is the land. Does anyone have any suggestions on how I can overlay my raster ...
1
vote
1answer
127 views

Stuck on how to list loaded layers in QGIS 3 via Python

I've stuck on a issue about getting a list of loaded layers. I've two layers loaded, one spatial (point, line or area) and another one non spatial (postgresql table). I've tried this code but it lists ...
1
vote
2answers
47 views

Creating a project without projection/simple Cartesian coordinates?

I want to draw a schematic process diagram in QGIS (yes, I really want, because I can document my data in the table) but it seems impossible to create a CRS that is simple Cartesian (x,y). Anyone can ...
2
votes
1answer
73 views

White stripe when exporting QgsLayout Map to image

I have a problem when I try to export a Map in the Layout of QGIS 3 with the Python API. Here is my code : qpt = QDomDocument() qpt.setContent(content) layout = QgsLayout(QgsProject().instance()) ...
2
votes
1answer
112 views

mapCanvas.saveAsImage() doesn't work properly within loop in standalone script (only .PGW)

I have a problem with the export of QGIS 3 interface screenshots. I run stand-alone scripts and one of them launches QGIS and runs script.py with the following code : mapCanvas = iface.mapCanvas() ...
3
votes
0answers
59 views

QGIS: QgsMapCanvas rotate vs setRotation

Question regarding QgsMapCanvas using python for QGIS : what is the difference between the following two methods? myQgsMapCanvas.rotate(10.0) myQgsMapCanvas.setRotation(10.0) (myQgsMapCanvas ...
1
vote
0answers
49 views

Set QgsMapCanvas extent to be empty

I have a standalone pyqgis program and it uses QgsMapCanvas as map display. I would like to set its extent to be empty. How do I do that? I tried the following but it is not working, in the sense ...
1
vote
0answers
98 views

QgsMapCanvas with no extent

I have a stand-alone PyQGIS application that can load vectors/rasters etc. The problem I am facing is when the application is launched, it has an empty QgsMapCanvas as map display, when it is empty, I ...
0
votes
1answer
70 views

OTF Coordinate Transformation on QgsMapCanvas

I want to be able to reproject the current layer's CRS onto the map canvas' CRS. I am using the C++ library with Qt. I have enable the OTF CRS transformation by calling setCrsTransformEnabled(true); ...
1
vote
0answers
71 views

QGIS raster layer invalid

I am trying to load a georeferenced .tiff file into the map canvas in a Qt application. While it is displayed when the application is running on my laptop, the same image does not get loaded into the ...
1
vote
1answer
296 views

canvasMoveEvent: canvas not refreshing in pyqgis

I wrote a qgis plugin where I can modify some features interactively. I have a class MovePointTool derived from QgsMapToolIdentify. When a point is moved, I call a function that does some (relatively ...
1
vote
0answers
27 views

QgsMapCanvas canvasMoveEvent fails to update mouse position after calling zoomToFullExtent

I have a standalone PyQGis application that can load different types of GIS data including GeoJson. It uses QgsMapCanvas as map display, I have implemented the canvasMoveEvent to capture and display ...
1
vote
1answer
175 views

toMapCoordinates() vs toLayerCoordinates()

I am currently using the QGIS C++ libraries to display a map. I am new to QGIS, and wantd to know what the difference between map and layer coordinates is? From what I understand, map gives the ...
2
votes
0answers
279 views

Scale Text-Annotations according to Map/Composer-Scale

Is there a way to set the size of the QGIS Text Annotations to map units so that they get resized when I choose different scales? I wrote a litte script as a workaround which scales the annotations ...
2
votes
1answer
563 views

Segmentation Fault upon exit of QGIS map canvas

I have simplified my original code. My code is very similar to Pyqgis' cookbook. I am simply loading one VALID layer to QgsMapCanvas and then displaying it. Everything is displayed corectly etc. ...
2
votes
0answers
329 views

Dynamic Label or Annotation in QGIS canvas

I'm creating an animation from several Raster images, and I'd like to add a label or an annotation to the map canvas, not the print composer, that will enable me to show the layer's name, which holds ...
2
votes
1answer
496 views

if __name__==“main”: in standalone Python script for QGIS

I am working on a standalone Python script for loading shapefile layers into an application window with my central widget being canvas. The previous code I had written is almost identical to the code ...
6
votes
1answer
3k views

How to load multiple vector layers into QGIS' map canvas using python scripting?

I am trying to write a standalone script in python to create a QGIS map canvas. The vector layers I am attempting to load are Shapefiles. Currently, I am able to load each vector layer, add them to ...
1
vote
0answers
62 views

coordinate returned by xyCoordinate signal is different

I am working on a project based on the api qgis 2.8 and qt 4.8.5 I have two computer one with the qgis 2.8.1 and the other with the qgis 2.8.3 In my application I have a connect to the signal ...