7

I've been using QGIS' wonderful geometry generator to dynamically generate root protection zones and crown areas for some tree inventories I've been working on. It's been a massive time saver.

Unfortunately our clients usually insist on CAD drawings for tree plans, and the robust DXF export in QGIS does not support this level of symbology. Neither does OGR2OGR from what I can gather?

I'm still new to GIS, and our workflow is such that I'm not yet confident migrating our data to PostGIS and using ST_MakeLine etc. to dynamically generate geometries.

Are there any other quick alternatives to dynamically generating geometry, which can be successfully exported to DXF? (or is there a way to export this sort of styling to DXF?)

Just as a reference, here's what I've been using to generate the geometries from the tree points. RPZ and N/E/S/W are fields in the data, in meters.

RPZ (Red):

Radius line:

make_line(
 $geometry,
 make_point($x + "RPZ"*cos(radians(45)), $y - ("RPZ"*sin(radians(45))))
)

(2019 update: The above doesn't work for multipoint geometries; you need to convert them to single parts by getting a centroid of the buffer like so:)

make_line(
centroid(buffer($geometry,0.1)),
 make_point($x + "rpz"*cos(radians(45)), $y - ("rpz"*sin(radians(45)))))

Circle:

buffer($geometry,"RPZ")

Crown area (blue):

make_polygon(make_line(
     translate($geometry,0,max("N",0.2)),
     translate($geometry,0.6*max("E",0.2),0.6*max("N",0.2)),
     translate($geometry,max("E",0.2),0),
     translate($geometry,0.6*max("E",0.2),-0.6*max("S",0.2)),
     translate($geometry,0,-max("S",0.2)),
     translate($geometry,-0.6*max("W",0.2),-0.6*max("S",0.2)),
     translate($geometry,-max("W",0.2),0), 
     translate($geometry,-0.6*max("W",0.2),0.6*max("N",0.2)),
     translate($geometry,0,max("N",0.2))))

And the current output looks like this (pretty fugly crown area, I know :-) - are splines even an option?) example of tree protection area and crown area using geometry generator

1 Answer 1

7

I'm not sure which update of QGIS 2.x and 3.x changed it, but as of 2018 November and probably earlier, geometry generator symbology styling does get exported with the native QGIS dxf exporter. Generated polygon geometries styled with outline only will be exported as polylines; albeit with many vertices still.

This site is temporarily in read-only mode and not accepting new answers.

Not the answer you're looking for? Browse other questions tagged .