TileCache and Mapnik - it doesn't work

classic Classic list List threaded Threaded
6 messages Options
Reply | Threaded
Open this post in threaded view
|

TileCache and Mapnik - it doesn't work

Steve L.
Hello,

I have set up Mapnik and TileCache on my Windows XP System and got through both Tutorials and each ist working fine.
But if I try to use my own data I got only pink tiles in my browser and an error:

An error occurred: No module named mapnik
  File "C:\tilecache-2.10\TileCache\Service.py", line 323, in cgiHandler
    format, image = service.dispatchRequest( params, path_info, req_method, host )
  File "C:\tilecache-2.10\TileCache\Service.py", line 208, in dispatchRequest
    return self.renderTile(tile, params.has_key('FORCE'))
  File "C:\tilecache-2.10\TileCache\Service.py", line 138, in renderTile
    data = layer.render(tile, force=force)
  File "C:\tilecache-2.10\TileCache\Layer.py", line 443, in render
    return self.renderTile(tile)
  File "C:\ms4w\Apache\cgi-bin\tilecache-2.10\TileCache\Layers\Mapnik.py", line 27, in renderTile
    import mapnik

I think it might just be a directory problem but I'm not quite sure.
I also think I set up Mapnik and TileCache correctly because both programs work.

I'm hoping that someone might be able to help.

kind regards
Steve

Reply | Threaded
Open this post in threaded view
|

Re: TileCache and Mapnik - it doesn't work

christopher.schmidt

On Sep 2, 2010, at 6:34 AM, ext Steve L. wrote:

>
> Hello,
>
> I have set up Mapnik and TileCache on my Windows XP System and got through
> both Tutorials and each ist working fine.
> But if I try to use my own data I got only pink tiles in my browser and an
> error:
>
> An error occurred: No module named mapnik
>  File "C:\tilecache-2.10\TileCache\Service.py", line 323, in cgiHandler
>    format, image = service.dispatchRequest( params, path_info, req_method,
> host )
>  File "C:\tilecache-2.10\TileCache\Service.py", line 208, in
> dispatchRequest
>    return self.renderTile(tile, params.has_key('FORCE'))
>  File "C:\tilecache-2.10\TileCache\Service.py", line 138, in renderTile
>    data = layer.render(tile, force=force)
>  File "C:\tilecache-2.10\TileCache\Layer.py", line 443, in render
>    return self.renderTile(tile)
>  File "C:\ms4w\Apache\cgi-bin\tilecache-2.10\TileCache\Layers\Mapnik.py",
> line 27, in renderTile
>    import mapnik
>
> I think it might just be a directory problem but I'm not quite sure.
> I also think I set up Mapnik and TileCache correctly because both programs
> work.

>From where TileCache is running (presumably within Apache), it does not have
access to the mapnik Python libraries.

I would recommend first:

 1. creating a simple cgi script, which says something like:

#!/usr/bin/python
import mapnik

print "Content-Type:text/html"
print ""
print "Win!"

 2. Determining whether it works (I expect it won't)
 3. Working with the mapnik mailing list to figure out how to make it work.
    (Though I expect you'll get limited help, as this is sort of an installation
    issue, on what looks like a platform most mapnik devs don't use much.)

Best of luck.

-- Chris

> I'm hoping that someone might be able to help.
>
> kind regards
> Steve
>
>
> --
> View this message in context: http://osgeo-org.1803224.n2.nabble.com/TileCache-and-Mapnik-it-doesn-t-work-tp5490598p5490598.html
> Sent from the TileCache mailing list archive at Nabble.com.
> _______________________________________________
> Tilecache mailing list
> [hidden email]
> http://lists.osgeo.org/mailman/listinfo/tilecache

_______________________________________________
Tilecache mailing list
[hidden email]
http://lists.osgeo.org/mailman/listinfo/tilecache
Reply | Threaded
Open this post in threaded view
|

Re: TileCache and Mapnik - it doesn't work

Steve L.
Hello Chris,

thanks for your answer, but it didn't quite help me with my problem.
You wrote that there might be something in the Apache config, which isn't correct. I think there are some people, who got it to work on an Windows machine, maybe they can help me?
How do I point to the Mapnik library? I searched the mailing-list but did not find a problem similar to mine.

Maybe it is just a Path Problem, but I think I got the Paths correct:
My entry for Mapnik ist: Path C:\mapnik-0.7.1\lib and
the Pythonpath: C:\mapnik-0.7.1\python\2.5\site-packages

Maybe there has to be an entry for tilecache too? I'm not sure.

In my opinion that should do it for tilecache and Mapnik to work together.
If someone knows how do get it work, that would be great.
I have been looking and trying out for days now.

Thanks
Steve
Reply | Threaded
Open this post in threaded view
|

Re: TileCache and Mapnik - it doesn't work

Dane Springmeyer-4
Steve,

It sounds like a PYTHONPATH problem whereby the apache user does not have access to the same environment settings as your normal user. Maybe you can try setting the PYTHONPATH to the mapnik site-packages directory as a "system" setting rather than "user"? Also, confirm that you are running the same python version for TileCache and Mapnik's python bindings.

Dane


On Sep 6, 2010, at 4:24 PM, Steve L. wrote:

>
> Hello Chris,
>
> thanks for your answer, but it didn't quite help me with my problem.
> You wrote that there might be something in the Apache config, which isn't
> correct. I think there are some people, who got it to work on an Windows
> machine, maybe they can help me?
> How do I point to the Mapnik library? I searched the mailing-list but did
> not find a problem similar to mine.
>
> Maybe it is just a Path Problem, but I think I got the Paths correct:
> My entry for Mapnik ist: Path C:\mapnik-0.7.1\lib and
> the Pythonpath: C:\mapnik-0.7.1\python\2.5\site-packages
>
> Maybe there has to be an entry for tilecache too? I'm not sure.
>
> In my opinion that should do it for tilecache and Mapnik to work together.
> If someone knows how do get it work, that would be great.
> I have been looking and trying out for days now.
>
> Thanks
> Steve
> --
> View this message in context: http://osgeo-org.1803224.n2.nabble.com/TileCache-and-Mapnik-it-doesn-t-work-tp5490598p5503274.html
> Sent from the TileCache mailing list archive at Nabble.com.
> _______________________________________________
> Tilecache mailing list
> [hidden email]
> http://lists.osgeo.org/mailman/listinfo/tilecache

_______________________________________________
Tilecache mailing list
[hidden email]
http://lists.osgeo.org/mailman/listinfo/tilecache
Reply | Threaded
Open this post in threaded view
|

Re: TileCache and Mapnik - it doesn't work

Steve L.
Thanks Dane,

I tried different settings but none of them would work.
Both variables are set as "system" and mapnik and tilecache are running under Python 2.6.
I tried both 2.5 and 2.6 but always get the same error message:

An error occurred: No module named mapnik
  File "C:\ms4w\Apache\cgi-bin\tilecache-2.10\TileCache\Service.py", line 323, in cgiHandler
    format, image = service.dispatchRequest( params, path_info, req_method, host )
  File "C:\ms4w\Apache\cgi-bin\tilecache-2.10\TileCache\Service.py", line 208, in dispatchRequest
    return self.renderTile(tile, params.has_key('FORCE'))
  File "C:\ms4w\Apache\cgi-bin\tilecache-2.10\TileCache\Service.py", line 138, in renderTile
    data = layer.render(tile, force=force)
  File "C:\ms4w\Apache\cgi-bin\tilecache-2.10\TileCache\Layer.py", line 443, in render
    return self.renderTile(tile)
  File "C:\ms4w\Apache\cgi-bin\tilecache-2.10\TileCache\Layers\Mapnik.py", line 27, in renderTile
    import mapnik

I just don't know what to do to get it work.

Steve
Reply | Threaded
Open this post in threaded view
|

Re: TileCache and Mapnik - it doesn't work

Dane Springmeyer-4
Steve,

I'd recommend you move this to the mapnik list.

Please reply there with answers to the following questions:

1) how did you install mapnik (basically what path did you follow on http://trac.mapnik.org/wiki/WindowsInstallation)?

2) what is returned if you open a command prompt and type:

$ python
>>> import sys
>>> print sys.path

(what I want to see is whether C:\mapnik-0.7.1\python\2.5\site-packages shows up in your PYTHONPATH)

3) confirm with me that you *can* do (which I understood you could from your first email):

>>> import mapnik

from a normal python interpreter (outside of apache process)


Dane

On Sep 9, 2010, at 9:19 AM, Steve L. wrote:

>
> Thanks Dane,
>
> I tried different settings but none of them would work.
> Both variables are set as "system" and mapnik and tilecache are running
> under Python 2.6.
> I tried both 2.5 and 2.6 but always get the same error message:
>
> An error occurred: No module named mapnik
>  File "C:\ms4w\Apache\cgi-bin\tilecache-2.10\TileCache\Service.py", line
> 323, in cgiHandler
>    format, image = service.dispatchRequest( params, path_info, req_method,
> host )
>  File "C:\ms4w\Apache\cgi-bin\tilecache-2.10\TileCache\Service.py", line
> 208, in dispatchRequest
>    return self.renderTile(tile, params.has_key('FORCE'))
>  File "C:\ms4w\Apache\cgi-bin\tilecache-2.10\TileCache\Service.py", line
> 138, in renderTile
>    data = layer.render(tile, force=force)
>  File "C:\ms4w\Apache\cgi-bin\tilecache-2.10\TileCache\Layer.py", line 443,
> in render
>    return self.renderTile(tile)
>  File "C:\ms4w\Apache\cgi-bin\tilecache-2.10\TileCache\Layers\Mapnik.py",
> line 27, in renderTile
>    import mapnik
>
> I just don't know what to do to get it work.
>
> Steve
> --
> View this message in context: http://osgeo-org.1803224.n2.nabble.com/TileCache-and-Mapnik-it-doesn-t-work-tp5490598p5513451.html
> Sent from the TileCache mailing list archive at Nabble.com.
> _______________________________________________
> Tilecache mailing list
> [hidden email]
> http://lists.osgeo.org/mailman/listinfo/tilecache

_______________________________________________
Tilecache mailing list
[hidden email]
http://lists.osgeo.org/mailman/listinfo/tilecache