onsdag 15 april 2015

3D vizualization in QGIS with three.js javascript library

With the Qgis2threejs plugin you can export DEM-data and vector data to html/javascript and look at the result in a web browser.


Here is a little example with a forest-DSM, vector building polygons with a height attribute, an orthophoto and a terrain model: 

Input data:

Forest DEM:

Buildings with a height attribute:

Orthophoto:

DTM:

Add the layers that you want to export and zoom in to an area. Then push the threejs-button.
All layers above in QGIS:

Threejs:
The threejs-button: 
To add the button to QGIS you have to click Plugins --> Manage and install plugins... and scroll to the Qgis2threejs plugin.



Used parameters in my example:

You can use the Vertical exaggeration-parameter to exaggerate the heights in the DEM:s:

Select a DTM layer that is representing the ground:
You can add additional DEM:s:
I used a height attribute for the buildings:

The result viewed in Google Chrome:


The result with a map as background instead of an orthophoto: 


More info about threejs:
https://github.com/minorua/Qgis2threejs

fredag 10 april 2015

Add LASTools to QGIS 2.6.0

1. Copy LASTools from http://lastools.org/download/lastools.zip
2. Extract the LASTools folder to a directory without space in the path, e.g.: d:\download





3. Start QGIS and open the Processing Toolbox (Processing-->Toolbox)
http://docs.qgis.org/2.0/en/docs/user_manual/processing/toolbox.html

4. Change to Advanced interface in the Processing Toolbox.





















5. Open Options (Processing-->Options...)
6. Under Tools for LiDAR data: Click the Activate checkbox and fill in the path to your unzipped LASTools directory:











The Tools for LiDAR data is now shown in the toolbox:




















When I tried this I first got this error message:
global name 'os' is not defined See log for more details
How to solve this problem is written here:
http://osgeo-org.1560.x6.nabble.com/Problems-running-LAStools-in-2-6-1-td5179484.html
1. Search for the LAStoolsUtils.py file and open it









2. Add the line 
import os 
to the code just under the line
import subprocess