For getting started the easiest thing to do is run the 'WSGI' standalone server.

See http://trac.mapnik.org/wiki/OgcServer#SampleConfigurations

Your script below needs to be run within Apache (can't be run standalone) and likely needs to be renamed with the file extension 'cgi' or the 'py' handler added to the Apache directive like:

AddHandler cgi-script .cgi .py

Dane


On Nov 5, 2009, at 2:15 PM, John Mitchell wrote:

Hi,

I am trying to run a wms request against a Mapnik OGC WMS Server within a Windows server:

Below is the WMS request:
----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
http://localhost/mapnik/mapnikwms.py?LAYERS=world&FORMAT=image%2Fpng&SERVICE=WMS&VERSION=1.1.1&REQUEST=GetMap&STYLES=&EXCEPTIONS=application%2Fvnd.ogc.se_inimage&SRS=EPSG%3A4326&BBOX=-180.0000000000001,-90,119.46385052802589,209.463850528026&WIDTH=256&HEIGHT=256
----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
Instead of getting a map to return I get the contents of the mapnikwms.py file within the browser which is listed below:
---------------------------------------------------------------------------------------------------------------------------------------
#!/usr/bin/env python

import sys
#sys.path.append('/Users/spring/projects/mapnik-utils/example_code/ wms/')
sys.path.append('C:/mapnik_0_6_1/example_code/wms/')

from mapnik.ogcserver.cgiserver import Handler

from jon import fcgi

class OGCServerHandler(Handler):
#configpath = '/Users/spring/projects/mapnik-utils/example_code/ wms/ogcserver.conf'
    configpath = 'C:/mapnik_0_6_1/example_code/wms/ogcserver.conf'


fcgi.Server({fcgi.FCGI_RESPONDER: OGCServerHandler}).run()

-----------------------------------------------------------------------------------------
How can I get the mapnikwms.py to execute via python instead of it being listed within the browser?


---------------------------------------------------------------------------------------------------------------------------------------------------------------------

Also I ran the mapnikwms.py script directly within python and got the following error.


------------------------------------------------------------------------------------------------------------
Traceback (most recent call last):
File "C:\Program Files (x86)\Apache Software Foundation \Apache2.2\wms\mapnikwms.py", line 14, in <module>

    fcgi.Server({fcgi.FCGI_RESPONDER: OGCServerHandler}).run()
  File "C:\Python25\Lib\site-packages\jon\fcgi.py", line 451, in run
    self._sock = socket.fromfd(sys.stdin.fileno(), socket.AF_INET,
AttributeError: 'module' object has no attribute 'fromfd'

------------------------------------------------------------------------------------------------------------

Thanks,

John

--
John J. Mitchell
_______________________________________________
Mapnik-users mailing list
[email protected]
https://lists.berlios.de/mailman/listinfo/mapnik-users

_______________________________________________
Mapnik-users mailing list
[email protected]
https://lists.berlios.de/mailman/listinfo/mapnik-users

Reply via email to