> I guess I do not get any data from the pgsql query I posted in the  
> last email - see the console output below when generating my xml  
> file with nik2img.py.
> It shows first the console output of a working layer/query and  
> secondly a more complex query (the queries are shown below) - it  
> looks like mapnik cannot find an alias... but why? The same query  
> works for Mapserver. Is Mapnik not able to read such complex queries  
> like this? Because other simple queries from the same tables work -  
> like this one:
>
> (select the_geom from gd_line_004) as staat01
>
> but this one isn't working (but it does with Mapserver):
>
> (select the_geom from (select  
> gd_point_005_label 
> .the_geom 
> ,gd_point_005_label.id,gd_point_005_label.oid,td_dim_geom.name from  
> gd_point_005_label,td_dim_geom where gd_point_005_label.id =  
> td_dim_geom.id) as foo USING SRID=31297) as anno
>
> I hope someone can help me because I really  tried all to get it  
> running but it seems hopeless to me.
>
> Thanks,
>
> Martin
>
> -----------------------------------------------------------------------
> End of console output when executing nik2img -m mymap.xml -o  
> image.png statement in console:
>

Try with nik2img.py -v # for more verbose output from nik2img (all you  
are seeing here is the C++ debug output from mapnik)

> SELECT AsBinary("the_geom") AS geom from (select the_geom from  
> gd_line_007_3) as fluss01 WHERE "the_geom" &&  
> SetSRID('BOX3D(384619.116883103 467965.222077892,505102.701298797  
> 534231.193506524)'::box3d,31297)
> ENCODING = UTF8
> return 0x815de80
> end layer processing
> start layer processing : anno
> datasource = 0x815f690
> borrow 0x815de80
> SELECT AsBinary("") AS geom from (select  
> the_geom 
> ,gd_point_005_label.id,gd_point_005_label.oid,td_dim_geom.name from  
> gd_point_005_label,td_dim_geom where gd_point_005_label.id =  
> td_dim_geom.id) as foo WHERE "" && SetSRID('BOX3D(384619.116883103  
> 467965.222077892,505102.701298797 534231.193506524)'::box3d, 
> 1600415532)

This looks suspicious. How did you end up with an SRID of  
'1600415532'? Any idea?

>
> ENCODING = UTF8
> return 0x815de80
> end layer processing
> end map processing
> 0.35 s
>
> sh: gthumb: command not found

Also, try updating to nik2img svn version and this gthumb error will  
go away.

>
> close connection 0x8162958
> destroyed singleton
> destroyed singleton
> destroyed singleton
> destroyed singleton
>
> ---------------------------------------------------------------------------
>
> Thanks for the answer Dane. I'm using exactly the same source as the  
> tutorial population.xml file (XMLGettingStarted) has. When I execute  
> the python file world_population.py (also on the tutorial website -- 
> > see link in the frist message). I get the same map as the tutorial  
> shows. But if I use this Openlayers code below or any other  
> hardcoded WMS request in the browser, I just get a blank image or  
> rather nothing. If I remove all filter entities (as well as the  
> <elsefilter/> entity !) my map is drawn via WMS or rather Openlayers  
> but it's only darkred because the last polygon filler has defined  
> color darkred and I have a lot of country names shown on the map.  
> Also I should tell you that I'm using the "xml_factory.py" (see code  
> below too) to load the XML files. Here's the complete openlayers  
> html file (the first layer variable is commented out and is the the  
> example I've created):
>
> Openlayers html file
> --------------------------------------------------------------
> <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" 
> "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd 
> ">
> <html xmlns="http://www.w3.org/1999/xhtml"; xml:lang="en" lang="en">
> <head>
>  <title>Mapnik WMS Test</title>
>  <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
>  <style type="text/css">
>    html, body { height: 100%; }
>    body {margin: 0px;}
>    #map {
>      width: 100%;
>      height: 100%;
>    }
>
>   </style>
>    <script src="lib/OpenLayers.js"></script>
>    <script type="text/javascript">
>        var map;
>        function init(){
>
>
>        var map_options = { numZoomLevels: 27, maxResolution:  
> 1.6,projection: "EPSG:4326"};
>
>            map = new OpenLayers.Map('map');
>            //var mapnik = new 
> OpenLayers.Layer.WMS("mapnik","http://localhost/cgi-bin/mapserv?map=/srv/www/cgi-bin/data/oerok_agg2.map
>  
> ",{layers: ['land_grenzen01','layer_mapany_080305_3ba6226287c1622',  
> 'bezirk_grenzen_01', 'land_grenzen01','staat01','fluss01',  
> 'stadt01'],'format':'image/png'},{isBaseLayer:true, reroject: true});
>
> var wms = new OpenLayers.Layer.WMS("Mapnik 
> WMS","http://localhost/cgi-bin/mapnikwms.py? 
> ", {layers:'countries', format:'image/png'} );
>
>            map.addLayers([wms]);
>            map.zoomToMaxExtent();
>        }
>    </script>
>  </head>
>  <body onload="init()">
>      <h2 style="position:absolute; z-index:10000; left:  
> 100px;">Mapnik WMS Test</h2>
>    <div id="map">
>    </div>
>  </body>
> </html>
>
> ---------------------------------------------
> xml factory python class:
>
>
> from mapnik.ogcserver.WMS import BaseWMSFactory
>
> # note, this class for loading an xml map requires patch from 
> http://trac.mapnik.org/ticket/129
>
> class WMSFactory(BaseWMSFactory):
>  def __init__(self):
>    BaseWMSFactory.__init__(self)
>
>    self.loadXML('population.xml')
>    self.finalize()
> ----------------------------------------------
>
> Concerning my second example where I get the data from a pgsql/ 
> postgis database: Yes the "value" variable is defined in the  
> datasource table pgsql query in the layer entity (see the "as value"  
> string at the end of the query code snippet).
>
> select the_geom from (select gd_poly_003.the_geom,gd_poly_003.id as
> id, td_dim_geom.name as name,
> gd_poly_003 
>  .oid 
>  ,sum(cal_layer_0_katz5d5495cc2ba6236d214fe0d5e8ad354f.value::float/  
> cal_layer_1_katzb201d59b428fc2b1bff23d3679a2e982.value::float) as
> value ...
>
>
> Thanks for any help ;)!
>
> Martin
>
>
> -------- Original-Nachricht --------
>> Datum: Mon, 23 Mar 2009 11:11:26 -0700
>> Von: Dane Springmeyer <[email protected]>
>> An: "tschobber tschöbbi" <[email protected]>
>> Betreff: Re: [Mapnik-users] XML filters + WMS is not working?
>
>> Martin,
>>
>> Keep in mind that the name of the field you filter on is case
>> sensitive. So for shapefiles it is usually ALLCAPS and for postgres
>> fields all undercase. http://trac.mapnik.org/ticket/119
>>
>> Also, it is very difficult to know how to help because you have not
>> provided your WMS query string, nor a public url to view your map,  
>> nor
>> a sense of what you have changed in the 'population.xml' such that it
>> now does not work.
>>
>> Is [value] the actual name of your field or a placeholder for  
>> something?
>>
>> Also, you should try using an ELSEFILTER - that will catch all data
>> records that are not correctly filtered and hint at your error.
>>
>> Dane
>>
>>
>> On Mar 23, 2009, at 2:53 AM, tschobber tschöbbi wrote:
>>
>>> Hi user list ;),
>>>
>>> I have the following problem: I want to retrieve data from a postgis
>>> database and then I want to make a WMS request with a xml file but
>>> the filters are just ignored or something like that. I've already
>>> tried the example population.xml
>> (http://trac.mapnik.org/wiki/XMLGettingStarted
>>> ) but this one isn't working too --> the map just stays blank. If I
>>> remove the filters in population.xml the map is generated but not
>>> correctly.
>>>
>>> My second problem is if I try to generate the map alternatively with
>>> "nik2img.py" the filters arent working for my example but for the
>>> population.xml example they are working. Why? I use the same pgsql
>>> queries as the equivalent Mapserver example (this one is working)
>>> and the name of my filter variable ([value]) should be correct too
>>> (see pgsql query snippet below):
>>>
>>>
>>> query:
>>>
>>> select the_geom from (select gd_poly_003.the_geom,gd_poly_003.id as
>>> id, td_dim_geom.name as name,
>>> gd_poly_003
>>> .oid
>>> ,sum(cal_layer_0_katz5d5495cc2ba6236d214fe0d5e8ad354f.value::float/
>>> cal_layer_1_katzb201d59b428fc2b1bff23d3679a2e982.value::float) as
>>> [b]value[/b] ...
>>>
>>> And here's an example how all my filters are declared ( the values
>>> range from 0 to infinity):
>>>
>>> <Rule>
>>> <Filter>[value] &gt; 500 and [value] &lt; 1000</Filter>
>>>     <PolygonSymbolizer>
>>>            <CssParameter name="fill">#ef6548</CssParameter>
>>>     </PolygonSymbolizer>
>>> </Rule>
>>>
>>> And this shows how the above code snippet is implemented in
>>> Mapserver map file:
>>>
>>> CLASS
>>>     NAME "> 500 - 1.000"
>>>     EXPRESSION ([value] >= 500 and [value] < 1000)
>>>     METADATA
>>>     END
>>>     STYLE
>>>       ANGLE 360
>>>       COLOR 239 101 72
>>>       SYMBOL 0
>>>     END
>>>     TEMPLATE "xxx"
>>>   END
>>>
>>> Hope you could help me.
>>>
>>> Thanks + best regards,
>>>
>>> Martin
>>>
>>>
>>> -- 
>>> Aufgepasst: Sind Ihre Daten beim Online-Banking auch optimal
>>> geschützt?
>>> Jetzt absichern: https://homebanking.gmx.net/[email protected]
>>> _______________________________________________
>>> Mapnik-users mailing list
>>> [email protected]
>>> https://lists.berlios.de/mailman/listinfo/mapnik-users
>
> -- 
> Aufgepasst: Sind Ihre Daten beim Online-Banking auch optimal  
> geschützt?
> Jetzt absichern: https://homebanking.gmx.net/[email protected]
>
> -- 
> Neu: GMX FreeDSL Komplettanschluss mit DSL 6.000 Flatrate +  
> Telefonanschluss für nur 17,95 Euro/mtl.!* 
> http://dsl.gmx.de/?ac=OM.AD.PD003K11308T4569a

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

Reply via email to