Hi Andreas,

The WMS server does not have formal support for loading map styles via  
XML. Your attempt to get it working looks remarkably close, but in  
general I would guess you running up against the limited ability to  
work with symbols using the mapnik python bindings.

As an issue itself, you could file a ticket on trac.mapnik.org on what  
needs to be added to the boost::python bindings.

As far as the general issue of how to use the load_map() function with  
the WMS server, take a look at: http://trac.mapnik.org/ticket/129

Perhaps you can contribute to testing and refining this approach of  
building the load_map() function into the OGCServer code itself?

Cheers,

Dane



On Oct 14, 2008, at 10:51 PM, Andreas Theofilu wrote:

> Hi list,
>
> I've managed to setup a WMS server based on Mapnik. I'm able to read  
> in the
> XML-Script for OSM data and I get a nice map out (code is at
> http://www.theossoft.net/mapnik/worldMapFactory.html). The
> linked code get it's raw data from a postGis database, where I've  
> stored
> Europe. (for the complete XML file look at
> http://www.theossoft.net/mapnik/osm.xml) This works, but there is a  
> layer
> called "minor-roads" I'm not able to read in completely correct. The  
> roads
> are too fat and this makes the map look ugly (look at
> http://www.theossoft.net/mapnik/map.png).
>
> I assume, It's not possible to copy the symbols correct by doing:
>
>   for sym in r.symbols:
>      rule.symbols.append(sym)
>
> The above code is mostly correct, but maybe not for the following  
> part of the
> XML file:
>
>  <Layer name="minor-roads" status="on" srs="+proj=merc +datum=WGS84   
> +k=1.0
> +units=m +over +no_defs">
>    <StyleName>minor-roads-casing</StyleName>
>    <StyleName>minor-roads-fill</StyleName>
>    <StyleName>aerialways</StyleName>
>    <Datasource>
>      <Parameter name="type">postgis</Parameter>
>      <Parameter name="host">localhost</Parameter>
>      <Parameter name="user">username</Parameter>
>      <Parameter name="dbname">gis</Parameter>
>      <Parameter name="table">
>      (select * from planet_osm_line order by z_order) as roads
>      </Parameter>
>      <Parameter name="estimate_extent">false</Parameter>
>      <Parameter
> name="extent">-20037508,-19929239,20037508,19929239</Parameter>
>    </Datasource>
>  </Layer>
>
> The rules for the styles "minor-roads-casing", "minor-roads-fill"
> and "aerialways" are defined prior.
>
> I've read a lot about Mapnik and looked at the source and the  
> available
> examples. But I was not able to figure out, how I can copy the symbols
> correctly. I'm even not able to find out, what type of symbolizer  
> I'm copying
> (line symbolizer, polygon symbolizer, ...). Is there an example  
> somewhere or
> can anybody explain, how to do that?
>
>
> Beside this I found out, that I have to define every style name as
> a "wmsextrastyle" to be able to make the WMS server draw one layer  
> over the
> other. Without this, I can only request one single layer. If I try  
> to request
> more than one layer, and give no style names, I get the error:
>
>   <ServiceExceptionReport version="1.3.0"
>      xsi:schemaLocation="http://www.opengis.net/ogc
>      http://schemas.opengis.net/wms/1.3.0/exceptions_1_3_0.xsd";>
>      <ServiceException>
>         OGCException: STYLES length does not match LAYERS length.
>      </ServiceException>
>   </ServiceExceptionReport>
>
> But simply registering the layers, allthough every style has a  
> propper name,
> is not enough. I've to register the style names of the layer as  
> extra styles
> to make the WMS server recognize them. To get more than one layer,  
> the styles
> parameter on request must contain exactly one style name (if there  
> are more
> than one, it doesn't matter which) for every layer I want:
>
>   http://localhost/cgi-bin/wms?VERSION=1.3.0&REQUEST=GetMap&\
>   LAYERS=water_areas,bridges&STYLES=water_areas,bridges&\
>   FORMAT=image/png&SRS=EPSG:3395&CRS=EPSG:4326&\
>   BBOX=16.254412,48.170568,16.375430,48.199311&width=800&height=600
>
> Is this a bug? If not, it differs from other WMS servers, where I  
> can leave
> the styles parameter blank.
> -- 
> Andreas Theofilu
> http://www.TheosSoft.net/
>
>                     --==| Enjoy the science of Linux! |==--
> _______________________________________________
> 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