On Nov 5, 2009, at 5:33 PM, John Mitchell wrote:
To run the WSGI as a standalone Mapnik OGC Server:
I run the below line from the command prompt:
C:\Python25\python.exe "C:\Documents and Settings\jmitchell\Desktop
\wmsWSGI.py"
I get the following error:
--------------------------------------------------------------------------------
Traceback (most recent call last):
File "C:\Documents and Settings\jmitchell\Desktop\wmsWSGI.py",
line 7, in <mod
ule>
application = WSGIApp('C:/mapnik_0_6_1/example_code/wms/
ogcserver.conf')
File "c:\mapnik_0_6_1\site-packages\mapnik\ogcserver\wsgi.py",
line 42, in __i
nit__
raise ServerConfigurationError('The factory module could not be
loaded.')
mapnik.ogcserver.exceptions.ServerConfigurationError: The factory
module could n
ot be loaded.
--------------------------------------------------------------------------------
How can I fix the error "The factory module could not be loaded."
Oh, on windows... Well, normally on *nix systems you would change into
the directory of the script and do:
$ python wmsWSGI.py
and then if the map_factory.py file were in the same directory it
would automatically be found, since the current working directory is
automatically in sys.path.
Alternatively you can put the directories on your path where
'map_factory.py' is, by putting this in the top of your 'wmsWSGI.py'
script:
import sys
WORKING_DIR = os.path.dirname(os.path.abspath(__file__))
# add to sys.path the folder that contains map_factory.py (and
ogcserver.conf)
sys.path.append(WORKING_DIR)
Also make sure in 'ogcserver.conf' you have:
module=map_factory # without the .py
Dane
_______________________________________________
Mapnik-users mailing list
[email protected]
https://lists.berlios.de/mailman/listinfo/mapnik-users