Hot answers tagged

3

Try the code snippet below. After calling geometry(), we can string together calls to constGet() and vertices(), then traverse the vertex iterator (or use list comprehension to store the vertices in a list) and call x(), y() and z() on the vertex point objects to access the X, Y & Z values: layerT = QgsProject.instance().mapLayersByName('tPolygonLayer')[...


3

How about filtering the joined layer for null values? Right click the joined layer and choose filter. QGIS will ask you to create a virtual layer to filter since it is a join-layer. Then you can filter the virtual layer with: "nameOfColumnThatShouldHaveData" IS NOT NULL I created a small test data set where I joined the column "data" from the layer "table" ...


3

I think you can do that just with the great internal tool from QGIS3 and without any knowledge of python. All within the graphical interface. You can access to the importing format (extension) by clicking in the '...' in the output element. Here you have the complete video with the process (I can't even upload here the complete gif...). Here are some ...


2

What about forgoing 0.5D? ;-) If you don't really need extruded polygons, bot only a 3D-like representation, the 2.5D rendering option might work for you. You can apply a calculated value to be used as "extrusion" height, based on one or multiple fields. Of course this is not a real extrusion, but might suffice in many cases.


2

Solution is to call QgsDataSourceUri.uri with False: QgsVectorLayer(uri.uri(False), "mylayer", "postgres") see docs: https://qgis.org/pyqgis/master/core/QgsDataSourceUri.html#qgis.core.QgsDataSourceUri.uri


2

Usually, you would check after each input event if the conditions for allowing the user to click OK are met and if they are you "enable" to OK button.


1

There's probably a better way but this should work on Windows: #print(pdf_paths) import datetime week_start = datetime.datetime(2019, 10, 14, 8, 30) #Y, M, D, H, M (example returns: 2019-10-14 08:30:00) out_file = 'C:\\Users\\Username\\Desktop\\Example_Folder\\Output_file.gpkg'#change to your own file path for pdf_path in pdf_paths: path_ctime = os.path....


1

I use Mac and QGIS 3.4 and got the same error. After checking the PyQt5 folder in QGIS, I found there is no QtChart file in the folder, which is the reason why we cannot import it. And the version of PyQt5 in QGIS is 5.11.3 The folder for PyQt5 in QGIS is /Applications/QGIS3.app/Contents/Resources/python/PyQt5 I have an anaconda version of PyQt5, which ...


1

There is an Ipython console(A kernel for Jupyter) for QGIS as a plugin, which you can add from QGIS official plugin repository or download from Github and copy to the plugin folder in QGIS. https://github.com/elpaso/qgis-ipythonconsole


1

sure it is too late but others might find it useful: The methods you were looking for were probably: setLayers() and storeCurrentLayerStyles() These are methods of class QgsLayoutItemMap. Consider you have a map object called map1 of a QGIS - Project called project1. To lock all layers of map1 of the current layer tree you could: map1....


Only top voted, non community-wiki answers of a minimum length are eligible