New answers tagged

5

You can turn off the whole Marker line if it is too short using built in data driven symbology. For example my data: I want to remove the arrows from the smaller islands. These are all line features, so looking at the length of the line is good. I am working in British National Grid, so my units are in meters. So to switch off the markers from all lines ...


1

For those who'd like to try the code above for the PyQGIS3 version, here is my adaptation (it works for the 'active layer' if run from the console ...). # provide file name index and field's unique values from random import randrange layer = iface.activeLayer() fni = layer.fields().indexFromName('nom') unique_values = layer.uniqueValues(fni) # fill ...


2

Use a "butt" style of line cap. This creates a flat end that stops exactly at the end of the line (as compared to "square" which extends the symbol past the geographic end of the line). Add a marker symbol layer. Make the marker symbol a single black circle, the same width as the line, placed at the endpoint of the line. Note: apparently this method works ...


2

One way of adding paint effects is to add another symbol layer for it. Here is a code snippet to produce following polygon. #Add layer coords = [(20, 60), (32, 60), (32, 70), (20, 70), (20, 60)] polygon = QgsGeometry.fromPolygonXY( [[ QgsPointXY( pair[0], pair[1] ) for pair in coords ]] ) layer = QgsVectorLayer("Polygon?crs=EPSG:4326", "polygon_0", "...


0

This is a bit late but in QGIS 3.10 you can multiple symbols for the same layer. Simply click the plus arrow (underlined in red below) However to get the offset you will need to go to the option below.


1

You can build an attribute table and read the values into a set using da.SearchCursor: arcpy.BuildRasterAttributeTable_management(r"C:\GIS\data\testdata\Classes.tif") values = {i[0] for i in arcpy.da.SearchCursor(r"C:\GIS\data\testdata\Classes.tif","Value")} #arcpy.DeleteRasterAttributeTable_management(r"C:\GIS\data\testdata\Classes.tif") values set([0, 1, ...


8

A one-step scenario : you add a virtual field in your airports table using the following expression : angle_at_vertex( make_line( centroid($geometry), centroid( geometry( get_feature( 'destinations', 'name', 'PARIS')))), 0) And you use that angle value ("angle") as data-defined rotation as mentionned by @wfgeo I assume your "PARIS" point layer is called '...


12

I am making the following assumptions: You are using a projected coordinate system Your data is in two separate layers called cities and planes This solution should also extend to the case of multiple cities Onto the solution: Add a unique id field to planes called plane_id Add a unique id field to cities called city_id (it will just be one value in OP's ...


Top 50 recent answers are included