Hello,

In tracebacks, the most helpful information is often at the end. Here,  
it says: 'Layer "world" not defined.' which is pretty clear (that's  
not always the case). I think your XML configuration file does not  
have any layer name "world" whereas your request shows LAYERS=world  
amond other parameters.

If you need to test your WMS connection, I recommand you use a WMS  
client. There are several OpenSource options: QGIS or uDig would fit.  
Such software will handle all the necessary parameters.

Once your WMS server is OK, you can build an OpenLayers application  
which also acts as a WMS client but requires a little more  
configuration. Please refer to the OpenLayers website and mailing  
lists for information on how to do this.

Regards
Gilles

Ozodbek Ulmasov <[email protected]> a écrit :

> I've corrected population.xml file.
>
> After launching wms.py, I got the message " listening on port 8000... "
>
> After opening this link in browser i got the followings:
>
> ---
> Welcome to the Mapnik OGCServer.
>
> Ready to accept map requests...
>
> For more info see: trac.mapnik.org
> ---
>
> How I can open the map in my browser with openlayers?
>
> To test the WMS I tried to open the following link
>
> http://localhost:8000/wms/wms.py?LAYERS=world&FORMAT=image/png&SERVICE=WMS&VERSION=1.1.1&REQUEST=GetMap&STYLES=&EXCEPTIONS=application/vnd.ogc.se_inimage&SRS=EPSG:4326&BBOX=-180.0000000000001,-90,119.46385052802589,209.463850528026&WIDTH=256&HEIGHT=256
>
> but the following error occurs:
> ----
> OGCServer Error:
>
> Traceback (most recent call last):
>   File "c:\mapnik_0_7_0\python\2.5\site-packages\mapnik\ogcserver\wsgi.py",
> line 89, in __call__
>     response = requesthandler(ogcparams)
>   File
> "c:\mapnik_0_7_0\python\2.5\site-packages\mapnik\ogcserver\wms111.py", line
> 212, in GetMap
>     return WMSBaseServiceHandler.GetMap(self, params)
>   File
> "c:\mapnik_0_7_0\python\2.5\site-packages\mapnik\ogcserver\common.py", line
> 315, in GetMap
>     m = self._buildMap(params)
>   File
> "c:\mapnik_0_7_0\python\2.5\site-packages\mapnik\ogcserver\common.py", line
> 392, in _buildMap
>     raise OGCException('Layer "%s" not defined.' % layername,
> 'LayerNotDefined')
> OGCException: ('Layer "world" not defined.', 'LayerNotDefined')
> Traceback:
>
> LayerNotDefined
> ----
>
>
>
> On Mon, Jan 25, 2010 at 7:31 PM, <[email protected]> wrote:
>
>> Hello,
>>
>> The traceback seems to point an error in your XML configuration file. It
>> says it is not able to find the datasource of the "countries" layer.
>> Have you double-checked that pathes are all correct? Have you tried with
>> and without filename extension?
>> In order to make sure your XML file is correct, you can test it using
>> nik2img or the Mapnik Python bindings.
>>
>> Regards
>> Gilles
>>
>> Ozodbek Ulmasov <[email protected]> a écrit :
>>
>>
>>  On launching wms.py the following error appears:
>>>
>>> Traceback (most recent call last):
>>>  File "c:\ms4w\Apache\htdocs\wms\wms.py", line 21, in <module>
>>>    application = WSGIApp('C:/ms4w/Apache/htdocs/wms/ogcserver.conf')
>>>  File "C:\mapnik_0_7_0\python\2.5\site-packages\mapnik\ogcserver\wsgi.py",
>>> line
>>>  44, in __init__
>>>    self.mapfactory = getattr(mapfactorymodule, 'WMSFactory')()
>>>  File "C:\ms4w\Apache\htdocs\wms\xml_factory.py", line 7, in __init__
>>>    self.loadXML('C:/ms4w/Apache/htdocs/wms/population.xml')
>>>  File "C:\mapnik_0_7_0\python\2.5\site-packages\mapnik\ogcserver\WMS.py",
>>> line
>>> 52, in loadXML
>>>    load_map (tmp_map, xmlfile, strict)
>>> RuntimeError: C:/ms4w/Apache/htdocs/mapnik/wms/data/thematic_mapping_world
>>> does
>>> not exist (encountered during parsing of layer 'countries')
>>>
>>> I have installed OGC Server as written in the following documentation:
>>> http://trac.mapnik.org/wiki/OgcServer
>>>
>>> The following files were configured:
>>>
>>> ######### wms.py ############
>>> import sys
>>> from mapnik.ogcserver.wsgi import WSGIApp
>>> sys.path.append('c:/ms4w/Apache/htdocs/wms/')
>>>
>>> application = WSGIApp('c:/ms4w/Apache/htdocs/wms/ogcserver.conf')
>>>
>>>
>>> if __name__ == '__main__':
>>>    from wsgiref.simple_server import make_server
>>>    httpd = make_server('localhost', 8000, application)
>>>    print "Listening on port 8000...."
>>>    httpd.serve_forever()
>>>
>>> ####### ogcserver.conf #########
>>> [server]
>>> module= xml_factory
>>> debug=1
>>>
>>> [service]
>>> title=MapnikOGC
>>> abstract=The Mapnik OGC Server Sample Configuration
>>> maxheight=2048
>>> maxwidth=2048
>>> # 3031 is an antarctica polar projection
>>> allowedepsgcodes=3031,4326,3395,900913
>>>
>>> #onlineresource=http://localhost:8888/
>>> fees=
>>> keywordlist=mapnik
>>> accessconstraints=
>>>
>>> [contact]
>>> contactperson=
>>> contactorganization=
>>> contactposition=
>>> addresstype=
>>> address=
>>> city=
>>> stateorprovince=
>>> postcode=
>>> country=
>>> contactvoicetelephone=
>>> contactelectronicmailaddress=
>>>
>>> ######### xml_factory.py ########
>>> from mapnik.ogcserver.WMS import BaseWMSFactory
>>> from mapnik import *
>>>
>>> class WMSFactory(BaseWMSFactory):
>>>  def __init__(self):
>>>    BaseWMSFactory.__init__(self)
>>>    self.loadXML('c:/ms4w/Apache/htdocs/wms/population.xml')
>>>    self.finalize()
>>>
>>> ##### apache httpd.conf ####
>>>
>>> <Directory "/ms4w/Apache/htdocs/wms/">
>>>  PythonPath "['c:\ms4w\Apache\htdocs\wms\'] + sys.path"
>>>  AddHandler mod_python .py
>>>  PythonHandler wms
>>> </Directory>
>>>
>>>
>>>
>>
>>
>>
>



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

Reply via email to