Bit of a challenge here which I've been grappling with for some time. I'll explain my full work flow so you can reproduce if needed.

I'm creating virtual landscapes in Google SketchUp which I ultimately would like to use in Netlogo to examine how turtles interact with them.

My problem is that by the time I get the landscapes into Netlogo the units don't seem to relate to the original 3D model.

Step 1: Create simple hill on a 50m by 50m square in Sketchup using the Toposhaper extension.

Step 2: Export to .dae file and import into Meshlab, ensure the Meshlab model has the same dimensions as the Sketchup model by adjusting the units with the assistance of the measuring tool. Export from meshlab as .xyz file.

Step 3: Import .xyz file into QGis as points by adding a new layer from delimited file. Selecting field_1 and field_2 as X and Y fields.

Step 4: Create raster of points using Raster > Interpolation > Interpolation. Add field_3 as interpolation attribute, set number of columns to 50 by 50 (to correspond to the 50m x 50m 3D model). The cell size of X and Y should match exactly to ensure Netlogo will read the resulting .asc file.

Step 5: Finally, I setup a model in Netlogo to receive the raster. Firstly, in model settings I set the the min and max pxor and pycor to 0 and 49 (creating 50 x 50 patches). Then, using the Gis Extension, I import the raster apply the z-value to a patch variable called elevation:

to load-gis
  set elevation gis:load-dataset "cone_50.asc"
  gis:set-world-envelope-ds gis:envelope-of elevation
  gis:apply-raster  elevation target-elev

Now, each patch of my 50 by 50 Netlogo world should have an elevation value taken from my 50 by 50 raster. In theory, adding all the elevation values together should (roughly) give me the total volume of the raised area of the hill? The figure I get is higher however and the problem gets worse with larger volumes.

Can anyone help?

  • When you initially setup your SketchUp project, how do you reference your AOI. The usual procedure is the obtain terrain and or aerial photo from the Google Earth utility then proceed to step 1 in your list.. My guess is that your .dea is not correctly referenced but I can't be of much help as I have only done these things in ArcGIS and Sketchup. – Jakub Sisak GeoGraphics Sep 30 '15 at 18:04
  • Thanks for commenting. I simply draw non-geographically referenced features (hills, ditches etc.) by hand. I am working with archaeological features that don't exist anymore so cannot download georeferenced data as such. – Beeman Oct 1 '15 at 15:42
  • Managed to pretty much crack this now. Much of the problem was realising that to calculate the (say, the positive) volume of a DEM you sum all the positive elevation values and multiply this by the pixel size squared. – Beeman Oct 1 '15 at 15:43

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.