선을 지그재그로 상징하는 방법이없는 것 같습니다. 불행히도 기본 데이터를 변경해야합니다.
원래 선을 여러 등거리 선 세그먼트로 분할 한 다음 다른 모든 점을 고정 된 양만큼 간격 띄우기를하면 상당히 좋은 지그재그 선을 얻을 수 있습니다.
이 작업을 수행하는 Python 스크립트는 다음과 같습니다. NathanGI의 답변 은 QGIS에서 폴리 라인을 따라 임의의 점 을 어떻게 만들 수 있습니까? 출발점으로. 코드 청크를 디렉토리 (또는 Windows) zigzag.py
에서 호출 된 파일에 저장 한 다음을 입력하여 QGIS Python 콘솔에서 가져옵니다 . 그럼 당신은 당신이 zigzagify하려는 하나 개 이상의 라인을 선택하고 입력 할 수 있습니다 QGIS 파이썬 콘솔에서 와 지도 단위로, 지그재그 세그먼트의 "길이"와 "폭"입니다.~/.qgis/python
{User Directory}\.qgis\python\
import zigzag
zigzag.createZigzag(<wavelength>, <amplitude>)
<wavelength>
<amplitude>
예를 들면 다음과 같습니다.

보시다시피 지그재그는 원래 선의 모퉁이 근처에서는 그리 좋지 않지만 적어도 지그재그 선에는 끊기가 없습니다.
Chaiken의 알고리즘을 사용하여 선을 부드럽게하는 James Conkling의 제안을 사용하면 결과가 훨씬 좋아집니다.

스크립트는 다음과 같습니다.
from qgis.utils import iface
from qgis.core import *
import numpy as np
from cmath import rect, phase
# Function for calculating the mean of two angles.
# Based on http://rosettacode.org/wiki/Averages/Mean_angle#Python
def meanAngle(a1, a2):
return phase((rect(1, a1) + rect(1, a2)) / 2.0)
def createZigzag(wavelength, amplitude):
# Create a new memory layer to store the zigzag line.
vl = QgsVectorLayer("LineString", "Zigzag", "memory")
pr = vl.dataProvider()
# For each selected object in the current layer
layer = iface.mapCanvas().currentLayer()
for feature in layer.selectedFeatures():
geom = feature.geometry()
# Number of zigzag segments
length = geom.length()
segments = np.round(length / wavelength)
# Find equally spaced points that approximate the line
points = [geom.interpolate(distance).asPoint() for
distance in np.linspace(0, length, segments)]
# Calculate the azimuths of the approximating line segments
azimuths = np.radians(
[points[i].azimuth(points[i + 1]) for i in range(len(points) - 1)])
# Average consecutive azimuths and rotate 90 deg counterclockwise
zigzagazimuths = [azimuths[0] - np.pi / 2]
zigzagazimuths.extend([meanAngle(azimuths[i],
azimuths[i - 1]) - np.pi / 2 for i in range(len(points) - 1)]
)
zigzagazimuths.append(azimuths[-1] - np.pi / 2)
# Offset the points along the zigzagazimuths
zigzagpoints = []
for i in range(len(points)):
# Alternate the sign
dst = amplitude * (1 - 2 * np.mod(i, 2))
zigzagpoints.append(
QgsPoint(points[i][0] + np.sin(zigzagazimuths[i]) * dst,
points[i][1] + np.cos(zigzagazimuths[i]) * dst
)
)
# Create new feature from the list of zigzag points
fet = QgsFeature()
fet.setGeometry(QgsGeometry.fromPolyline(zigzagpoints))
pr.addFeatures([fet])
vl.updateExtents()
QgsMapLayerRegistry.instance().addMapLayer(vl)