Answers:
您可以使用以下步骤添加随机点符号:
2.0在水平位移和垂直位移下,使用以下功能:
5.1对于水平位移:
randf(3,5) 
5.2垂直位移
randf(2,4) 复制点图层,并将水平和垂直距离分别更改为6和3。在水平位移和垂直位移下,使用以下功能:
6.1对于水平位移:
randf(0,1) 
6.2对于垂直位移
randf(1,2) 您需要将符号大小减小到2 Pixels
您可以在下图中看到输出:
在作曲家中,图例将如下所示:
另一种技术涉及使用InkScape创建SVG,并在QGIS中使用SVG填充层。
它可以更好地控制符号系统(例如,您可以绘制随机散布的树,而不仅仅是点),还可以更好地控制间距
尝试设置,Remove如果效果不好,您可以随时单击。
这是我在其中随机制作一个5 x 5个QGIS内置树的副本的网格。通过试验间距和抖动,您可以得到不同的外观。您还可以尝试使用QGIS的“ 水平位移”。通过将其设置为水平距离的一半,可以破坏“平铺”的外观(给墙上的砖块一样的图案)
刚刚找到了经过一些调整的在线脚本,该脚本可以与qgis 3.5.x一起使用
我丢掉了原来的帖子,所以不能相信作者。
您要做的是:
感谢脚本的原始作者。
from qgis.core import *
from qgis.gui import *
import math
import random
"""
Define a grid based on the interval and the bounding box of
the feature. Grid will minimally cover the feature and be centre aligned
Create a multi-point geometry at the grid intersections where
the grid is enclosed by the feature - i.e. apply a clipping mask
Random value determines amount of randomness in X/Y within its
grid square a particular feature is allowed to have
"""
@qgsfunction(args='auto', group='Custom')
def fillGrid(xInterval, yInterval, rand, feature, parent):
  box = feature.geometry().boundingBox()
  #Create a grid that minimally covers the boundary
  #using the supplied intervals and centre it
  countX = math.ceil(box.width() / xInterval)
  countY = math.ceil(box.height() / yInterval)
  #Align the grid
  gridX = countX * xInterval
  gridY = countY * yInterval
  dX= gridX - box.width()
  dY= gridY - box.height()
  xMin = box.xMinimum() - (dX/2)
  yMin = box.yMinimum() - (dY/2)
  points = []
  #+1 to draw a symbol on the n+1th grid element
  for xOff in range(countX+1):
    for yOff in range(countY+1):
      ptX = xMin + xOff*(xInterval) + rand * random.uniform(0,xInterval)
      ptY = yMin + yOff*(yInterval) + rand * random.uniform(0,xInterval)
      pt = QgsPointXY(ptX,ptY)
      point = QgsGeometry.fromPointXY(pt)
      if feature.geometry().contains(point):
        points.append(pt)
  return QgsGeometry.fromMultiPointXY(points)