Showing posts with label tilecache. Show all posts
Showing posts with label tilecache. Show all posts

Thursday, August 31, 2017

TileCache : Cannot Identify Image File

On a newly set up CentOS box, and newly installed TileCache, i got this:

Last lines says:
File "/usr/lib64/python2.7/site-packages/PIL/Image.py", line 2030, in open
    raise IOError("cannot identify image file")

I tried replacing PIL with Pillow but still got an error. I had successful installations on other CentOS boxes before, so PIL should work. After removing Pillow, I reinstalled PIL... then, that's it! It worked! Must have had an issue when I installed PIL the first time.

Solution:

        Reinstall PIL:
               install pip
                        # sudo yum install python-pip

               uninstall PIL
                        # sudo pip uninstall PIL

               reinstall PIL Imaging
                        # cd Imaging-1.1.6
                        # sudo python setup.py install

Thursday, January 24, 2013

tilecache: internal server error caused by wrong libgpng version

tilecache gets:

An error occurred: HTTP Error 500: Internal Server Error

mapserver gets:

Internal Server Error

apache error logs says:

[Tue Nov 06 16:18:33.751389 2012] [cgi:error] [pid 10394] [client 192.168.1.145:53345] AH01215: libpng warning: Application was compiled with png.h from libpng-1.5.12
[Tue Nov 06 16:18:33.751490 2012] [cgi:error] [pid 10394] [client 192.168.1.145:53345] AH01215: libpng warning: Application  is  running with png.c from libpng-1.2.46
[Tue Nov 06 16:18:33.751533 2012] [cgi:error] [pid 10394] [client 192.168.1.145:53345] AH01215: gd-png:  fatal libpng error: Incompatible libpng version in application and library
[Tue Nov 06 16:18:33.754515 2012] [cgi:error] [pid 10394] [client 192.168.1.145:53345] End of script output before headers: mapserv

reinstall mapserver with libpng-1.2

tilecache: x value too far from tile corner

experienced PINK TILES PROBLEMS with v2.11

"An error occurred: Current x value 121.008911 is too far from tile corner x 121.003418"

DOWNGRADING TO v2.10 works! :D

tilecache: python-setuptools not found

if you get 'python-setuptools not found' error when you run ez_setup.py try installing it python-setuptools first.

i used yum on CentOS to install mine.

# yum install python-setuptools

Tuesday, November 06, 2012

tilecache: metatile - no module named image

if you get "No module named Image..."

you need the python imaging library

wget http://effbot.org/downloads/Imaging-1.1.6.tar.gz
python setup.py install

now gets "cannot read interlaced PNG files"

add this in your map file:
OUTPUTFORMAT
      NAME "png"
      MIMETYPE "image/png"
      DRIVER "GD/PNG"
      EXTENSION "png"
      TRANSPARENT FALSE
      FORMATOPTION "INTERLACE=OFF"
END


my tilecache.cfg contains this:
[base]
type=WMS
url=http://x.x.x.x/cgi-bin/mapserv?map=/../my.map
metaTile=true
metaSize=1,1
extent_type=loose
extension=png

Friday, July 20, 2012

tilecache: no module named image

got

An error occurred: No module named Image
  File "/usr/local/apache2/htdocs/tilecache/TileCache/Service.py", line 323, in cgiHandler
    format, image = service.dispatchRequest( params, path_info, req_method, host )
  File "/usr/local/apache2/htdocs/tilecache/TileCache/Service.py", line 208, in dispatchRequest
    return self.renderTile(tile, params.has_key('FORCE'))
  File "/usr/local/apache2/htdocs/tilecache/TileCache/Service.py", line 138, in renderTile
    data = layer.render(tile, force=force)
  File "/usr/local/apache2/htdocs/tilecache/TileCache/Layer.py", line 435, in render
    image = self.renderMetaTile(metatile, tile)
  File "/usr/local/apache2/htdocs/tilecache/TileCache/Layer.py", line 393, in renderMetaTile
    import StringIO, Image

?

try removing metaTile from your tilecache.cfg

Thursday, July 28, 2011

apache - mod python - tilecache: installation on minimal centos 4.6

my apache - mod_python - tilecache installation notes on minimal centos 4.6 (final)

1. from base system installation, install the ff:
glibc-kernel-headers
glibc-headers
glibc-devel
cpp
gcc

2. install apache
# ./configure -prefix=/usr/local/apache2 -enable-so -enable-rewrite -with-mpm=prefork
# make
# make install

3. install mod_python
http://www.apache.org/dist/httpd/modpython/mod_python-3.3.1.tgz
# ./configure --with-appxs=/usr/local/apache2/bin/apxs
(if you get an error: apxs not found or not executable, locate your apxs)

# make
make failed: [mod_python.so] Error 1

* install python from source to include libraries
download http://www.python.org/ftp/python/2.5.1/Python-2.5.1.tgz
# ./configure
# make
# make install

...continue mod_python installation
# ./configure --with-appxs=/usr/local/apache2/bin/apxs
# make
# make install

4. configure apache
# vi /etc/apache2/apache2.conf
add:
LoadModule python_module /usr/lib/apache2/modules/mod_python.so

5. test python
# vi /usr/local/apache2/conf/httpd.conf
add:
<Directory /usr/local/apache2/htdocs/pytest/>
 AddHandler mod_python .py
 PythonHandler test
 PythonDebug On
</Directory>

# test.py

from mod_python import apache

def handler(req):
          req.log_error('handler')
          req.content_type = 'text/plain'
          req.send_http_header()
          req.write('mptest.py\n')
          return apache.OK

6. install tilecache
download http://www.tilecache.org/tilecache-2.01.tar.gz
extract into your web directory
# python ez_setup.py
# python tilecache_install_config.py

7. configure apache for tilecache
# vi /usr/local/apache2/conf/httpd.conf
add:
AddHandler python-program .py
PythonHandler TileCache.Service
PythonOption TileCacheConfig /path/to/tilecache.cfg

<Directory /usr/local/apache2/htdocs/tilecache/>
    AddHandler python-program .py
    PythonHandler TileCache.Service
    PythonOption TileCacheConfig /usr/local/apache2/htdocs/tilecache/tilecache.cfg
</Directory>

<Location /mpinfo>
      SetHandler mod_python
      PythonHandler mod_python.testhandler
</Location>

8. test by browsing:
http://x.x.x.x/tilecache/tilecache.cgi?LAYERS=basic&SERVICE=WMS%20&VERSION=1.1.1&REQUEST=GetMap&SRS=EPSG:4326&BBOX=-180,-90,0,90%20&WIDTH=256&HEIGHT=256

tada!

SSH : No matching host key type found. Their offer: ssh-rsa,ssh-dss

Got this while connecting to my mikrotik router via ssh   Unable to negotiate with <ip address> port <ssh port>: no matching hos...