fredag 9 oktober 2015

Potree getting started tutorial

Potree is a WebGL based viewer for large point clouds.It is free and open source to enable anyone to view, analyze and publicly share their large datasets. (http://potree.org/)

Download PotreeConverter from this site:
https://github.com/potree/PotreeConverter/

Unzip the PotreeConverter and run it like this, example:
PotreeConverter.exe D:\lasfile.las -o c:\xampp\tomcat\webapps\examples\potreeTest\ --generate-page testpage



If you get an error message that the dll msvcp140.dll is missing when you try to run the converter then you have to download an install the Visual C++ Redistributable for Visual Studio 2015 from this site:

For me it didn't work to download it with Chrome so I had to download it through IE.

To view the files you have to put them on a webserver. You can for example use XAMPP:
Or if you have Python on your computer you can use Pythons SimpleHTTPServer:
1. Open the command prompt
2. CD to the directory you wish to have accessible via browsers and HTTP:
Ex: cd d:\temp\httptest
3. Start the server:
Ex (I have Python in my ArcGIS directory):
"c:\Program Files (x86)\Python27\ArcGIS10.3\python" -m SimpleHTTPServer 8080


Then you can look at the generated web page in a browser, ex:


More images from my little example:











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