[Addons] ESRI Shapefile import/export and georeferenced raster importer

This addon offers some tools to make the bridge between Blender and geographic data formats commonly used in a Geographic Information System (GIS).

Source and additionnal informations is now available in GitHub:

1 Like

Thanks a lot :slight_smile:

Thanks !
So great

Can you please post some visual examples, I cannot imagine something behind the words you are writing.

Kind regards
Alain

In zip file attached there is a pdf with visual example !

Hi,
great work, I was going to code something like ths (I think) to georeference the house primitives presented here (for next version of it).


I’ll take time to stdy your work before doing anything.

Thanks for sharing


tmaes

House primitive !
Perfect for me

Wow! Fantastic work! I had just worked out how to import georeferenced .ply files via GRASS, but this is even better. Can I ask, it would be great if orthographic renders could include georeferences in a world file. Is that possible?! It would be perfect to put renders back into QGIS/web maps. Is this something you would consider? :yes:

Okay, I’ve given 2D shapefiles a try and they’re fine… Great! Extruding by attribute crashes, however, for me. I’m loading blender under the command line on OS X so I can track the progress:

Read shapefile...
DBF fields : ['legend', 'toid', 'version', 'ver_date', 'theme', 'desc_group', 'desc_term', 'make', 'phys_level', 'feat_code', 'calc_area', 'broken', 'la_ch_date', 'la_ch_reas', 'proc_date', 'chunk_orig', 'dem_hght', 'dtm_hght', 'rel_hght', 'mean_hght', 'min_hght', 'max_hght', 'med_hght', 'mode_hght', 'count']
Process geometry...
Create mesh...
Mesh created
Process extrusion (this step can be very slow...)
0%
10%
20%
30%
40%
50%
60%
70%
80%
90%
Traceback (most recent call last):
  File "/Users/sorbus/Library/Application Support/Blender/2.65/scripts/addons/io_shapefile/op_import_shp.py", line 420, in execute
    extrudeFacesBm(obj, extrudeValues)#with bmesh.ops
  File "/Users/sorbus/Library/Application Support/Blender/2.65/scripts/addons/io_shapefile/op_import_shp.py", line 206, in extrudeFacesBm
    vect=normal*offset[i]
IndexError: list index out of range


location: <unknown location>:-1


location: <unknown location>:-1

My data is projected in OSGB 27700 and the building heights are in real numbers (metres). Would that cause the issues?

I have got data into blender as georeferenced .ply files via GRASS (see image) but have the problem – that you have addressed! – that the ‘origin’ of the file in 10,000s of metres away from blenders… Perhaps the ‘manage_georef’ script could also move other objects after they are imported? I hoping that the bounding box information will hopefully make georeferenced output possible ;). It’s good to see blender getting these features!

Sorbus


Hi Sorbus, I’m glad that this script can help you.

This error mean that there are more faces in the mesh than expected by the list of extrude values. I think you have multipart features in your data and this is what causes this error. I’ll try to correct this later but meantime you can try to split multipart features (in QGIS, vector menu --> Geometry tools --> multipart to singleparts).

Of course you can readjust you ply import with the manage_georef script but you need another georef import as reference. Otherwise you can create your own Delta X / Delta Y custom properties, just copy the location values in these new properties and then set the mesh location to zero.

I think is it possible to georef the render output. This is good idea, I will try to code it when I have time but I don’t know the amount of work that require.

Hi Domlysz,

Thanks for the reply! I’ll try that with QGIS. Once last question (for now ;)), if I import several shape files that share a common CRS and are roughly in the same locality (they don’t have matching bounding boxes), should they automatically be aligned?

Once again, many thanks!

Sorbus

Yes it should work, just make a test !

Hi Sorbus,

I’ve updated the script to correct your bug on shapefile extrusion.

Great work! This comes in very handy.

Hi,

Thanks a lot for the work!

…but I’m in trouble when I want to enable it : no module bmesh in python!!?

Ubuntu 12.04.2 LTS, 64bits, 3.2.0-39-generic
Python 2.7.3
Blender 2.62 (sub 0)

maybe I need to update python or/and blender??? wich version are you using?

Thank you for your help

Guyomji

Hi, it was hopeless to find this one :slight_smile: AMAZING !!! From 1 year, we tried to complete a full version of our city (we have the .shp) in blender by making a model from scratch…this will help…oups ! this will give more free time !
thanks !

wow this looks great! Thanks a lot!

Does this plugin also have to do with the ESRI city generator? Sorry if is a stupid question but I am not really accostumed with this stuff! :slight_smile:

Yeah this is a known problem, another explanation here:
http://blendermama.com/black-faces-error-from-camera-clipping.html

A workaround can be to set the clip start distance closer to the scene, it will help Blender to improve vertex position according to the Z depth of the camera.

Yes I tried increasing the start clipping distance and it works in most cases, but not in the farthest scale overview.

I would like to thank you again for your script. It helped a lot in creating this concept animation, though as you can see I’m still suffering from clipping when the water layer moves up. I used your script to import the seafloor, and the surface topographic map. Also I used it to import shapefiles which give the borders of the regions of interest. I made my own script to import the shipping routes, and buoy placement, from csv data, which then used your offsets to get placed correctly.

I have another question, is it possible to use your script from within a blender python script? I tried to use bpy.ops.import.georaster() but I can’t seem to figure out which arguments it requires to execute correctly.