I had the same problem and changed to epsg:4326.
but try this:
1.
python
from mapnik2 import Projection
Projection('init+=epsg=900913')
--here you see if there is any problem in your epsg file
2.
and i would change the map source of your test.xml:
Map srs= +proj=merc +a=6378137 +b=6378137 +lat_ts=0.0 +lon_0=0.0
+x_0=0.0 +y_0=0.0 +k=1.0 +units=m +nadgrids=@null +wktext +no_defs +over
3. and maybe try another datasource - my wms doesnt show the shapefiles too.
i hope i can help,
bernd
Am 16.11.2011 22:13, schrieb Espen Isaksen:
Hi!
I have been struggling with this for a long time now so I just have to
ask for help on the list.
I have set up ogcserver to read a Mapnik XML file(generated by
Tilemill), but I cannot get it to show me the correct output. All I
get now is a blank image.
The logs do not give an error:
localhost - - [16/Nov/2011 21:03:22] "GET
///?SERVICE=WMS&VERSION=1.3.0&REQUEST=GetMap&BBOX=219492.741938,6633651.694955,221702.329041,6635588.780398&CRS=EPSG:900913&WIDTH=1045&HEIGHT=917&LAYERS=__all__&STYLES=&FORMAT=image/png&DPI=72&TRANSPARENT=TRUE
HTTP/1.1" 200 3795
I don't think there is anything wrong with the projection as this file
works in Tilemill. I have tried both putting the EPSG code and the
full description in the top of the Mapnik XML file.
Can anybody give me some advice?
This is what I have:
wms_wsgi.py
#######################
#!/usr/bin/env python
import sys
from mapnik2.ogcserver.wsgi import WSGIApp
sys.path.append('/usr/lib/fcgi-bin/mapfactory.py')
application = WSGIApp('/usr/lib/fcgi-bin/ogcserver.conf')
# add these line to the bottom of your wsgi-based 'wms.py'
if __name__ == '__main__':
from wsgiref.simple_server import make_server
httpd = make_server('localhost', 8080, application)
print "Listening on port 8080...."
httpd.serve_forever()
mapfactory.py
#######################
import os
from ogcserver.WMS import BaseWMSFactory
from mapnik2 import Style, Layer, Map, load_map
class WMSFactory(BaseWMSFactory):
def __init__(self):
BaseWMSFactory.__init__(self)
base_path, tail = os.path.split(__file__)
file_path = os.path.join(base_path, '/home/espen/test.xml')
self.loadXML(file_path)
self.finalize()
ogcserver.conf
########################
# server: This section contains software related configuration parameters.
[server]
# module: The module containing the MapFactory class. See the readme for
# details.
# This would be the name of the map_factory file (without extension .py)
module=mapfactory
# service: This section contains service level metadata.
[service]
# title: The title of the server.
title=Mapnik OGC Server
# abstract: An abstract describing the server.
abstract=This abstract describes the server and its contents.
# maxwidth, maxheight: The maximum size that a map will be supplied at.
# Exceeding it will raise an error in the client.
maxheight=5024
maxwidth=5024
# allowedepsgcodes: The comma seperated list of epsg codes we want the server
# to support and advertise as supported in GetCapabilities.
allowedepsgcodes=4326,900913
# onlineresource: A service level URL most likely pointing to the web site
# supporting the service for example. This is NOT the online
# resource pointing to the CGI.
onlineresource=http://www.turkompisen.no/wms8080
baseurl=http://www.turkompisen.no/wms8080
# fees: An explanation of the fee structure for the usage of your service,
# if any. Use the reserved keyword "none" if not applicable.
fees=
# keywords: A comma seperated list of key words.
keywordlist=
# accessconstraints: Plain language description of any constraints that might
# apply to the usage of your service, such as hours of
# operation.
accessconstraints=
# maxage: The content of the HTTP Cache-Control header -
# the maximum age of the content in a cache, measured
# in seconds. One week is 604800 seconds, the default is
# 1 day.
maxage=86400
test.xml
######################
<?xml version="1.0" encoding="utf-8"?>
<!DOCTYPE Map[]>
<Map srs="+init=epsg:900913" background-color="#b8dee6">
<FontSet name="fontset-0">
<Font face-name="Ubuntu Regular"/>
<Font face-name="Arial Regular"/>
<Font face-name="DejaVu Sans Book"/>
</FontSet>
<Style name="shoreline_300" filter-mode="first">
<Rule>
<MinScaleDenominator>400000</MinScaleDenominator>
<PolygonSymbolizer fill="#ffffff" />
</Rule>
</Style>
<Layer name="shoreline_300"
srs="+proj=merc +a=6378137 +b=6378137 +lat_ts=0.0 +lon_0=0.0
+x_0=0.0 +y_0=0.0 +k=1.0 +units=m +nadgrids=@null +wktext +no_defs
+over">
<StyleName>shoreline_300</StyleName>
<Datasource>
<Parameter
name="file"><![CDATA[/home/espen/turkompisen/data/shoreline/shoreline_300.shp]]></Parameter>
<Parameter name="type"><![CDATA[shape]]></Parameter>
</Datasource>
</Layer>
.......
_______________________________________________
Mapnik-users mailing list
Mapnik-users@lists.berlios.de
https://lists.berlios.de/mailman/listinfo/mapnik-users
_______________________________________________
Mapnik-users mailing list
Mapnik-users@lists.berlios.de
https://lists.berlios.de/mailman/listinfo/mapnik-users