Stack Exchange Network

Stack Exchange network consists of 174 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

Questions tagged [qgsmapcanvas]

The tag has no usage guidance.

1
vote
1answer
38 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
31 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
56 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
81 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
50 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
73 views

QgsMapCanvas Error (Segmentation Core Dump) in standalone ubuntu console

i've tried to access QGIS Map Canvas in external python console. This is my script to call it: canvas = QgsMapCanvas() But then i got this error and python con: Segmentation fault (core dumped) ...
1
vote
0answers
45 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
89 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
68 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
58 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
275 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
24 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
168 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
264 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
536 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
315 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
476 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
59 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 ...