[Tilecache] GDAL + FWtools + tilecache_seed
Jacolin Yves
yjacolin at free.fr
Mon Oct 6 06:04:10 EDT 2008
Le Monday 06 October 2008 11:50:43 LionelB, vous avez écrit :
> Well, finaly, I tried other things and I obtained a more comprehensive
> error message :
>
> No module named osgeo.gdal
>
> What I understand is the module can't be found. So It's an installation
> problem.
> I followed instructions given for the installation process and I have
> installe gdal-python on my debian etch.
> Any idea ?
>
> Lionel
>
> 2008/10/3 lionel b <lionel.bargeot at gmail.com>
>
> > Hi,
> >
> > I would like to use GDAL direct raster source reading possibility.
> > I use a debian etch and I need to use FWTools library (ECW support).
> > I've downloaded tilecache2.04 and untar in cgi-bin directory.
> >
> > I've configured my tilecache.cfg like this :
> >
> > [test02]
> > type=GDAL
> > file=/var/ortho2/tilecache/01.vrt
> > bbox=780000,2070000,900000,2175000
> >
> > where 01.vrt is a gdal virtual dataset and I tested it whith gdalinfo
> > (FWTools)
> >
> > # python ./tilecache_seed.py http://localhost/cgi-bin/tilecache.cgi
> > test02 1 3
> > Traceback (most recent call last):
> > File "./tilecache_seed.py", line 9, in ?
> > TileCache.Client.main()
> > File "/usr/lib/cgi-bin/tilecache/TileCache/Client.py", line 104, in main
> > layer = svc.layers[sys.argv[2]]
> > KeyError: 'test02'
> >
> > I tried to force using python in FWTools both in tilecahe_seed and
> > tilecache.cgi (I edited the first line of the file to point to the
> > FWTools python file).
> >
> > I've got the same error message. Have i missed something ?
> > Thanks
> >
> > Lionel
Lionel,
How have you installed the application ?
osgeo.gdal is the new way to import gdal python, I don't know if TC try to
import gdal using the old way.
see http://pypi.python.org/pypi/GDAL/ USAGE section:
********* quote begin *******
Imports
There are five major modules that are included with the GDAL Python bindings.:
>>> from osgeo import gdal
>>> from osgeo import ogr
>>> from osgeo import osr
>>> from osgeo import gdal_array
>>> from osgeo import gdalconst
Additionally, there are five compatibility modules that are included but
provide notices to state that they are deprecated and will be going away. If
you are using GDAL 1.5 bindings, you should update your imports to utilize
the usage above, but the following will work until at least GDAL 2.0.
>>> import gdal
>>> import ogr
>>> import osr
>>> import gdalnumeric
>>> import gdalconst
If you have previous code that imported the global module and still need to
support the old import, a simple try...except import can silence the
deprecation warning and keep things named essentially the same as before:
>>> try:
... from osgeo import gdal
... except ImportError:
... import gdal
********* end of quote *******
regards,
Y.
--
Yves Jacolin
---
http://softlibre.gloobe.org
More information about the Tilecache
mailing list