Installing GDAL for the Geodata Workbench

Having trouble installing or compiling FreeCAD? Get help here.
Forum rules
Be nice to others! Respect the FreeCAD code of conduct!
User avatar
cnirbhay
Posts: 115
Joined: Wed Aug 17, 2016 4:24 pm

Re: Installing GDAL for the Geodata Workbench

Post by cnirbhay »

Installing the animation wb seems to fix it.
Thank you so much, @sgrogan. Installing animation workbench made it run. :-)
User avatar
Kunda1
Veteran
Posts: 13434
Joined: Thu Jan 05, 2017 9:03 pm

Re: Installing GDAL for the Geodata Workbench

Post by Kunda1 »

FYI I've opened a ticket on FreeCAD-addons to create a pre-requisite checker that would simplify this process of checking what pre-reqs each addon would need but it is no small task.
Alone you go faster. Together we go farther
Please mark thread [Solved]
Want to contribute back to FC? Checkout:
'good first issues' | Open TODOs and FIXMEs | How to Help FreeCAD | How to report Bugs
User avatar
Kunda1
Veteran
Posts: 13434
Joined: Thu Jan 05, 2017 9:03 pm

Re: Installing GDAL for the Geodata Workbench

Post by Kunda1 »

Alone you go faster. Together we go farther
Please mark thread [Solved]
Want to contribute back to FC? Checkout:
'good first issues' | Open TODOs and FIXMEs | How to Help FreeCAD | How to report Bugs
User avatar
Kunda1
Veteran
Posts: 13434
Joined: Thu Jan 05, 2017 9:03 pm

Re: Installing GDAL for the Geodata Workbench

Post by Kunda1 »

rotgut wrote:ping
Have you had any success fiddling with gdal in FC?
Alone you go faster. Together we go farther
Please mark thread [Solved]
Want to contribute back to FC? Checkout:
'good first issues' | Open TODOs and FIXMEs | How to Help FreeCAD | How to report Bugs
rachdatu
Posts: 15
Joined: Thu Jun 22, 2017 10:26 am
Location: Switzerland

Re: Installing GDAL for the Geodata Workbench

Post by rachdatu »

Hello

Firstly, thanks to the developper of this workbench, it is fantastic.

I am trying to install GDAL, that's why I am continuing this thread.
I have installed the GeoData Workbench from Github. To install GDAL, I was "inspired" by this document located at http://geotribu.net/node/636.
It's in French but there are lots of screenshots. Basically I downloaded and installed "gdal-202-1800-x64-core.msi" and "GDAL-2.2.2.win-amd64-py2.7.msi" from http://www.gisinternals.com/stable.php.

The Workbench works I would say at 98% but I would like to import an ASTER file and here is my problem.
I have tested the following modules in the FreeCAD Python console and they all work well.

Code: Select all

from osgeo import gdal
from osgeo import ogr
from osgeo import osr
from osgeo import gdalconst
However, this one returns an error:

Code: Select all

from osgeo import gdal_array
RuntimeError: module compiled against API version 0xb but this version of numpy is 0x9
Traceback (most recent call last):
  File "<input>", line 1, in <module>
  File "D:\prive\applications\FreeCAD 0.17_11827\bin\lib\site-packages\osgeo\gdal_array.py", line 26, in <module>
    _gdal_array = swig_import_helper()
  File "D:\prive\applications\FreeCAD 0.17_11827\bin\lib\site-packages\osgeo\gdal_array.py", line 22, in swig_import_helper
    _mod = imp.load_module('_gdal_array', fp, pathname, description)
ImportError: numpy.core.multiarray failed to import
When I open my aster file, I get a similar error message:

Code: Select all

RuntimeError: module compiled against API version 0xb but this version of numpy is 0x9
Traceback (most recent call last):
  File "D:\prive\applications\FreeCAD 0.17_11827\Mod\geodata\geodat\import_aster.py", line 182, in runbl
    import_heights(float(b),float(l),float(s))
  File "D:\prive\applications\FreeCAD 0.17_11827\Mod\geodata\geodat\import_aster.py", line 218, in import_heights
    pcl=import_ast(b,l)
  File "D:\prive\applications\FreeCAD 0.17_11827\Mod\geodata\geodat\import_aster.py", line 85, in import_ast
    data = band.ReadAsArray(0, 0, cols, rows)
  File "D:\prive\applications\FreeCAD 0.17_11827\bin\lib\site-packages\osgeo\gdal.py", line 2344, in ReadAsArray
    import gdalnumeric
  File "D:\prive\applications\FreeCAD 0.17_11827\bin\lib\site-packages\osgeo\gdalnumeric.py", line 1, in <module>
    from osgeo.gdal_array import *
  File "D:\prive\applications\FreeCAD 0.17_11827\bin\lib\site-packages\osgeo\gdal_array.py", line 26, in <module>
    _gdal_array = swig_import_helper()
  File "D:\prive\applications\FreeCAD 0.17_11827\bin\lib\site-packages\osgeo\gdal_array.py", line 22, in swig_import_helper
    _mod = imp.load_module('_gdal_array', fp, pathname, description)
ImportError: numpy.core.multiarray failed to import

Can someone help?
Thanks


OS: Windows 7
Word size of OS: 64-bit
Word size of FreeCAD: 64-bit
Version: 0.17.11827 (Git)
Build type: Release
Branch: master
Hash: ca4488f4387f761df47322038585b23cb5a1bd73
Python version: 2.7.8
Qt version: 4.8.7
Coin version: 4.0.0a
OCC version: 7.1.0
Locale: French/Switzerland (fr_CH)
User avatar
microelly2
Veteran
Posts: 4688
Joined: Tue Nov 12, 2013 4:06 pm
Contact:

Re: Installing GDAL for the Geodata Workbench

Post by microelly2 »

There are some problems with the common version of numpy,
for windows there is a way, see the links from this
https://forum.freecadweb.org/viewtopic. ... 50#p196630
rachdatu
Posts: 15
Joined: Thu Jun 22, 2017 10:26 am
Location: Switzerland

Re: Installing GDAL for the Geodata Workbench

Post by rachdatu »

Thanks for your quick answer.

I read this thread (https://forum.freecadweb.org/viewtopic.php?f=4&t=20674) and I think I will be stuck with FreeCAD 0.17.
I have the 0.16 64 bits and with that one, it will not work either.

Solution is to move to 0.16 32 bits or to another OS...

Walter
Jee-Bee
Veteran
Posts: 2566
Joined: Tue Jun 16, 2015 10:32 am
Location: Netherlands

Re: Installing GDAL for the Geodata Workbench

Post by Jee-Bee »

Don't know if it is possible... what i was thinking add a terminal inside FreeCAD/ make terminal work within the FreeCAD location... than it is easy to do a pip install
User avatar
microelly2
Veteran
Posts: 4688
Joined: Tue Nov 12, 2013 4:06 pm
Contact:

Re: Installing GDAL for the Geodata Workbench

Post by microelly2 »

I'm at home for the next days, so I will spend the time to make a tutorial to install some powerful moduls (scipy,cv2,networkx,gdal, ...) around freecad to get the jobs running.
Jee-Bee
Veteran
Posts: 2566
Joined: Tue Jun 16, 2015 10:32 am
Location: Netherlands

Re: Installing GDAL for the Geodata Workbench

Post by Jee-Bee »

For windows, Ubuntu etc/ osx or more than one?
Post Reply