2

I've used GIS for many years, and now I'm moving into 3D GIS, but I have some questions.

Say I have a 3D model of a viliage, I can get this into Blender, but I want to be able to run GIS type queries. So I want to have each building linked to a database, select buildings based upon attributes and spatial location (e.g. every building with a certain type of roof, buildings which are greater than 10m apart).

Is this possible and if so what are the best software for the job? I was expecting to use things like Blender, GRASS GIS (possibly in QGIS), and MySQL using its GRASS connectivity.

Any advice is welcome.

  • Great question. I'd love to know too. I'm not sure Blender is the answer though, as it's more for graphical sculpting for visualization, not GIS and database queries. – Wes Jul 16 '15 at 13:28
  • Thanks Wes, what about paraview? – Spatial Digger Jul 16 '15 at 13:30
  • That looks more likely, but I'm not familiar with it. Thanks for the tip though, I'm going to look into this myself now. – Wes Jul 16 '15 at 13:36
  • It certainly looks promising with its LiDAR/point cloud application (see here paraview.org/lidar) but I want to turn my point clouds into objects (e.g house, tree, bench) which can be connected to a database and queried. I'll download Paraview this evening and see how it fares. – Spatial Digger Jul 16 '15 at 13:45
  • 8 months since I posted this, my question looks embarrassing! I'm now running with a visual problem 'where can you see a clock face from' this seems to be only answerable in 3D GIS, ESRI have a solution for this, but it is less than elegant. – Spatial Digger Mar 14 '16 at 22:13
1

You should check out the 3D capabilities Oslandia is building on top of PostGIS

https://player.vimeo.com/video/54776907

http://www.oslandia.com/sfcgal-10.html

  • I've been in contact with them, its exactly what I need! – Spatial Digger Mar 14 '16 at 22:11
  • @GaryNobles GREAT STUFF! – DPSSpatial Mar 14 '16 at 22:21
0

You can, but... you need to think about things differently.

When you import GIS data into Blender, it will lose the attribute data especially if you use any of the available plugins. To import your data into Blender with attributes you will have to write your own script (as I don't know of one which does not simple import geometry).

The script will need to import each feature separately (all known current scripts, my own included, import an entire shapefile as a single Blender object). You will need your script to assign unique names to the features (which will happen by default but it's nice to control it). At this point you have two options. The first would be to write a separate script that associates the feature name to your attribute table and each select operation would search the table and then add features with a matching name to your selection. The alternative would be to store the attributes in Game Properties. As I write this, I would opt for the former approach (feature name and look up).

For spatial operations you again have two options. The first is to query your original GIS data from with Blender using the Python bindings for GDAL/OGR and then use the unquie feature name as your look-up for the 3D objects in Blender. Alternatively, if you want it more 'native' to Blender and less reliant on external data, then you need to start doing it like a computer games programmer. To do this you could use some of the border select API calls such as: bpy.ops.view3d.select_circle, bpy.ops.view3d.select_border or bpy.ops.view3d.select_lasso etc. and define the geometry of the circle, box or lasso based on the proximity criteria. Another alternative is of course ray casting (cast a ray iteratively from you POI to each object in turn and add to your selection set based on distance and angle etc that the ray returns to you.

So, basically, you are half-way there using the set up you describe but the second half is probably easiest by having GDAL do the heavy lifting on external data and then relate the results to the objects in Blender by unique names (that's what I'd do!). I think this approach will also be faster and easier to script.

EDIT (following up on comment): To turn your point clouds into objects, just treat the point cloud as a Particle system and have tree models on a hidden layer as your particle instance. I do this a lot and it is very straight forward from a modelling perspective. Your problem remains the selection methods as discussed above.

Your Answer

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

Not the answer you're looking for? Browse other questions tagged or ask your own question.