GDAL trouble

1,432 views
Skip to first unread message

Thomas Pfaff

unread,
Apr 1, 2014, 6:02:59 AM4/1/14
to wradli...@googlegroups.com

Hi guys,

 

I just wanted to use wradlib.georef.reproject to do some coordinate transformations.

 

I do

 

scoo = wradlib.georef.reproject(my_coords,  wradlib.georef.get_default_projection(), wradlib.georef.proj4_to_osr(wradlib.georef.create_projstr('dwd-radolan')))

 

Then I get a really crazy error (I’m sparing you this one).

On the notebook server console, I get the following – a bit more informative – output:

 

ERROR 4: Unable to open EPSG support file gcs.csv.

Try setting the GDAL_DATA environment variable to point to the

directory containing EPSG csv files.

ERROR 6: Unable to load PROJ.4 library (libproj.so), creation of

OGRCoordinateTransformation failed.

 

The setup on the machine, where I’m doing this is a 64bit Linux with a user specific anaconda installation, so there might be specialties due to this.

I also do not ‘install’ wradlib but import directly from the source directory  (so no requirements checking was done on this install ever).

 

So I don’t expect anyone to go into details here, but just wanted to ask, if anybody got similar problems, or if gdal comes with proj.4 and data files bundled in other installations.

Do you have the GDAL_DATA environment variable set?

If not, where is your copy of gcs.csv?

 

Best regards

 

 

Thomas

 

--

Dr.-Ing. Thomas Pfaff

Lehrstuhl für Hydrologie und Geohydrologie

Institut für Wasser- und Umweltsystemmodellierung

Pfaffenwaldring 61

D-70569 Stuttgart

 

Tel: +49 (711) 685-69099

 

Kai Muehlbauer

unread,
Apr 1, 2014, 6:33:37 AM4/1/14
to wradli...@googlegroups.com
Hi Thomas,

here just one thing fpr the exceptions:

If you put this

gdal.UseExceptions()

below the gdal impor, then you may get the second error message from the
console also in the python stack trace.

To the error I have no further ideas. Maybe your installation is missing
some gdal stuff or just the environment variable isn't set correctly.

Cheers,
Kai


Am 01.04.2014 12:02, schrieb Thomas Pfaff:
> Hi guys,
>
>
>
> I just wanted to use wradlib.georef.reproject to do some coordinate transformations.
>
>
>
> I do
>
>
>
> scoo = wradlib.georef.reproject(my_coords, wradlib.georef.get_default_projection(), wradlib.georef.proj4_to_osr(wradlib.georef.create_projstr('dwd-radolan')))
>
>
>
> Then I get a really crazy error (I'm sparing you this one).
>
> On the notebook server console, I get the following - a bit more informative - output:
>
>
>
> ERROR 4: Unable to open EPSG support file gcs.csv.
>
> Try setting the GDAL_DATA environment variable to point to the
>
> directory containing EPSG csv files.
>
> ERROR 6: Unable to load PROJ.4 library (libproj.so), creation of
>
> OGRCoordinateTransformation failed.
>
>
>
> The setup on the machine, where I'm doing this is a 64bit Linux with a user specific anaconda installation, so there might be specialties due to this.
>
> I also do not 'install' wradlib but import directly from the source directory (so no requirements checking was done on this install ever).
>
>
>
> So I don't expect anyone to go into details here, but just wanted to ask, if anybody got similar problems, or if gdal comes with proj.4 and data files bundled in other installations.
>
> Do you have the GDAL_DATA environment variable set?
>
> If not, where is your copy of gcs.csv?
>
>
>
> Best regards
>
>
>
>
>
> Thomas
>
>
>

--
Kai Muehlbauer
Meteorological Institute University of Bonn
Auf dem Huegel 20 | +49 228 739083
D-53121 Bonn | kai.mue...@uni-bonn.de

Kai Muehlbauer

unread,
Apr 1, 2014, 6:35:51 AM4/1/14
to wradli...@googlegroups.com
Ähm,

I have found a ";" in my version of reproject:

coordinates_target = np.array(ct.TransformPoints(temp));

Do you have it also?

Kai

Thomas Pfaff

unread,
Apr 1, 2014, 8:59:46 AM4/1/14
to wradli...@googlegroups.com
I have it, too.
But since ; is the separator for statements in Python, it doesn't hurt.

Now, as for my problem.
The libproj- error could be solved by placing a symbolic link to libproj.so.0 which was present on my system (c.f. http://trac.osgeo.org/ubuntugis/ticket/2)
The error about the data I temporarily solved by downloading the current source distribution of GDAL extract it somewhere and point GDAL_DATA to the data directory (http://trac.osgeo.org/gdal/wiki/FAQInstallationAndBuilding#HowtosetGDAL_DATAvariable). Now everything works.

Maybe the GDAL build of anaconda is broken (maybe I'll file a bug report there, but I'd have to investigate further, as there are no such reports so far on the web).

Cheers


Thomas
--
You received this message because you are subscribed to the Google Groups "wradlib-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to wradlib-user...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.



Edouard Goudenhoofdt

unread,
Apr 1, 2014, 10:19:54 AM4/1/14
to wradli...@googlegroups.com
Hi Thomas,

I had some issues with installing GDAL on operational servers (Ubuntu 10.04.4 LTS and Centos 6.4).

On my laptop (fedora 19) it was OK.

Most issues were solved by using the latest packages.

On one of the server (ubuntu) I had to use this :

GDAL_DATA="/usr/local/share/gdal"
export GDAL_DATA

On the other server (Centos 6.4) I needed a proper installation of PROJ4.

Regards,

Edouard

Thomas Pfaff

unread,
Apr 1, 2014, 10:24:10 AM4/1/14
to wradli...@googlegroups.com

So we may have to add some hints on this in the setup-documentation….

Thomas Pfaff

unread,
Apr 3, 2014, 10:47:30 AM4/3/14
to wradli...@googlegroups.com

A few more notes for those who might use several python installations on one machine.

 

My current setup is roughly as follows:

Windows7x64

Python(x,y) 2.7.6.0 full install (so all modules) with python at C:\python27

Anaconda 2.7.6 x64 in a local appdata directory (so no global install)

 

When I used the Anaconda install, imported wradlib and tried to use wradlib.georef.reproject, I got errors indicating that python tried to load some DLLs from the C:\python27 directory.

The solution to this was, that there is an environment variable called GDAL_DRIVER_PATH which pointed to a directory below C:\python27\lib\site-packages. (got the hint from here http://trac.osgeo.org/gdal/ticket/5110)

Unsetting this environment variable before launching the Anaconda python interpreter solved that problem.

 

You might also have the GDAL_DATA variable pointing to the anaconda install (a folder in the osgeo package containing csv-files etc.), but it may work out, if the individual gdal versions are not that different.

 

Also, to be honest, I tried a lot of different installation procedures (conda install gdal, pip install GDAL, easy_install GDAL and finally easy_install with the binary from Christoph Gohlke’s pythonlib), because none seemed to work. It turned out that I had a bug in my call to reproject, so actually one of the earlier methods might have worked too, but so far I can say that

-          pip install won’t work at all (most probably because it does a source install and then tries to compile)

-          the Gohlke binary works (if the paths above are properly (re-)set). You can just pass it as an argument to easy_install and it will install properly.

 

Hope that may be of help to someone someday

 

Cheers

 

 

Thomas

Reply all
Reply to author
Forward
0 new messages