QGIS – Exporting Your Maps
Exporting your heightmap
With your elevation data all ready in a new clipped raster layer, you can now start wrapping up your time in QGIS by finally getting to the Heightmap Export plugin.
- From the
Raster
menu, go down toHeightmap Export
and chooseHeightmap Export
. (Yeah, it’s redundant; I may fix that up a bit in the next release.) - Under
Create Heightmap From Layer
, choose your elevation data raster layer.- The
Map Area
box will show the height (N/S), width (E/W), highest elevation, and lowest elevation in meters.
- The
- In the
Model Dimensions
section, enter a value inHeight (mm)
,Width (mm)
, orDepth (mm)
. The other values will be adjusted to scale.- The
Scaled Depth (mm)
andScale Factor (1:?)
boxes allow you to easily try out expanding or compressing the vertical axis.
- The
- In the
Image Dimensions
section, enter a value forImage Height
(in pixels),Image Width
(in pixels), orResolution (mm/pixel)
. The other values will be adjusted to scale. - Click the
Export Heightmap
button. - Choose a name and location to save the exported file. (The default name is the layer name with “_heightmap.png” tacked on the end.)
- Click
Save
.The plugin saves a 16-bit greyscale PNG heightmap image plus an additional file with the same name and an .ini extension. This .ini file contains the bounds, size, model dimensions, and image dimensions and can be opened in any text editor for easy reference. (It is also used to pre-fill values in the PathTracer dialog, should you later use that.)
- Your heightmap is ready. You can close the Heightmap Export dialog.
Exporting and SVG-ifying your path data
While there is apparently an alleged SVG export plugin for QGIS, I have found that it does not yield cromulent results. To get the path data into a nice SVG, we just have to take the slightly longer way around.
- In the
Layers
box, right-click the path data’s vector layer, go down toExport
and chooseSave Features As...
- Select
AutoCAD DXF
from theFormat
drop-down. - Click the
...
to the right of theFile name
box and choose your filename and save location. - Uncheck
Add saved file to map
, as we’re just exporting it. - Click
OK
to save.You have now saved a DXF with your path data, but the scale is all wrong and you’d really like a properly scaled SVG instead. Never fear, Inkscape is here!
- Open Inkscape.
- From the
File
menu, chooseImport... (Ctrl-I)
and choose your DXF file, or if you prefer drag and drop, grab the DXF file and drop it onto the Inkscape window. TheDXF Input
dialog will pop up. - For
Method of Scaling
, chooseAutomatic scaling to size A4
.This is almost certainly not the actual scale you’re using, but the important thing is that it gives sane dimensions on import. You’re going to enter the correct dimensions, anyway, and starting with it scaled to A4 means that it won’t be inconveniently huge or tiny. Sometimes being “wrong” is just plain convenient.
- Click
OK
to load the DXF. - Select everything from the DXF (e.g. drag a box or whatever).
- Press Ctrl-G (or choose
Group (Ctrl-G)
from theObject
menu) to group the pieces. - Edit the width (
W:
) and height (H:
) input boxes up in the toolbar above the window (with the aspect ratio icon unlocked) to match your model’s intended dimensions (which are in that .ini file if you’ve forgotten them). - From the
File
menu, chooseDocument Properties (Shift-Ctrl-D)
. - With the grouped path data selected, click the
Resize page to drawing or selection
button. - Save your file as a new, wonderful SVG.
If you added temporary line segments, they’ve done their job helping you get the scaling and alignment right. I would, however, suggest keeping them around in the design and only deleting them right before making any toolpaths. Keeping them around allows you to rescale, crop, and so on, and if you load the SVG into something like Carbide Create, they really help with alignment there, too.