Skip to content

Instantly share code, notes, and snippets.

@datagistips
Last active April 10, 2020 04:06
Show Gist options
  • Save datagistips/6450aea4f5c083fc924d4ce4e88796ee to your computer and use it in GitHub Desktop.
Save datagistips/6450aea4f5c083fc924d4ce4e88796ee to your computer and use it in GitHub Desktop.
Use symbology > centroid > geometry generator
# Main spikes :
with_variable(
'coords',
array(x(centroid($geometry)),y(centroid($geometry))),
make_triangle(
make_point(@coords[0] - 8000,
@coords[1]),
make_point(@coords[0],
@coords[1] + nb_cas*30),
make_point(@coords[0] + 8000,
@coords[1])
)
)
# Spike shadows :
with_variable(
'coords',
array(x(centroid($geometry)),y(centroid($geometry))),
make_triangle(
make_point(@coords[0] - 8000,
@coords[1]),
make_point(@coords[0] + (cos(pi()/4)*nb_cas*20),
@coords[1] - (sin(pi()/4)*nb_cas*20)),
make_point(@coords[0] + 8000,
@coords[1])
)
)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment