Professional Documents
Culture Documents
GDAL is a popular and powerful geospatial data processing library. GDAL is available as a set of
commandline utilities (ready to use binaries files). The developer oriented library is available as a C/C++
API. Bindings in other languages, including Python, are also available.
GDAL is an optional dependency, most of the functionalities of BlenderGIS are available without it. If the
addon does not works as expected, installing GDAL will not solve the issue. GDAL can be useful for
advanced users who need more support for GIS specific fomats and reprojection tasks directly in Blender.
However, if you want to deal with heterogeneous data formats, projections or extents, the most
straightforward strategy is to preprocess your data with QGIS before trying the import into Blender. QGIS
is a powerful open source desktop GIS software, this is an essential tool for working with BlenderGIS
because it will help prepare the data for a smooth import. Futhermore, installing GDAL with Blender can
be really tricky because Blender bundle it's how Python installation.
Windows
On Windows, the most easiest way to install GDAL Python Binding is to use the packages build by
Christoph Gohlke and available here. Choose the package that match the version of Python bundle with
Blender, you can determine it by opening the Python console in Blender. In the following screenshoot this
is Python 3.5.3, the corresponding package is named GDAL-2.2.4-cp35-cp35m-win_amd64.whl.
The *.whl package file contains a stand alone GDAL installation including all needed files (binaries,
libraries, Python binding...), so you don't need to install any other file.
You need pip utility to install *.whl package files, so the first step is to install pip with the following
command :
python.exe -m ensurepip
Then you can install the wheel file:
GDAL Python binding needs Numpy to correctly working. Numpy is already included with Blender Python
installation, but most of time this version does not match the one used to compile GDAL module. So, to
ensure the best compatibility it's more careful to also install Christoph Gohlke's Numpy wheel package.
To finalize the installation, it's necessary to define a new Windows environment variable named
GDAL_DATA and pointing the following directory : blender_install_folder\2.7x\python\lib\site-
packages\osgeo\data\gdal
osr.SpatialReference().ImportFromProj4('+init=epsg:3857')
The second statement must return zero, a value >0 refers to an error code.