[GIS] GDAL with GEOS support, pandas and VTK using python on Windows

gdalgeospython

So far I have been using OSGeo4W shell (or OSGEO install) as really convenient way to use python together with additional packages, namely gdal, shapely, numpy, scipy and matplotlib.

I was happy till I came to the point where I need to start use also pandas and VTK packages.

I came across Anaconda, which allows me to easily install everything including the needed pandas and VTK packages. But when I run my scripts which were working well with OSGEO, with Anaconda it comes with:

ERROR 6: GEOS support not enabled.

I have installed GDAL from https://binstar.org/osgeo/gdal where it is written: "Built with all command line tools and with GEOS and HDF5 support". But obviously something is wrong. I also tried install additionaly first geos and after that gdal from https://conda.binstar.org/osgeo but ended up with the same error.

I found a post talking about this issue linking to special package build gdal_geos on binstar. But there is verion only for linux-64.

So ideally both ways or at least one of these: Can I easily add pandas and VTK support to OSGeo4W shell? And/Or how to make work GDAL with GEOS support on Anaconda install?

Update: I have installed Fiona package to Anaconda and replaced OGR part (load (and buffer with Shapely) objects from shapefile) by it and the code works. If I switch back to OGR, error comes up again.

Best Answer

As one of the maintainers of the 'osgeo' conda channel (which, as noted on the project description had no affiliation with the OSGEO foundation and was only intended for internal builds of 'osgeo' packages) I would highly recommend you don't use these builds of GDAL.

Instead install from the conda-forge channel, their builds of GDAL are kept much more up to date than the default and build with a lot more options (including GEOS) support.

To install GDAL from conda-forge use:

conda create -n gdal_env -c conda-forge gdal
activate gdal_env

Installing in a separate environment is needed so that environmental variables required by GDAL are set correctly.

We have now removed the osgeo channel.