Hi, I currently try to support shape files in my application. To make it for the user as easy as possible, I want to create a default map file, containing all information's to render a beautiful map. Because my application is a KDE program, I want to use the internal paths KDE uses. Therefore I don't use the function "load_map()" to read the map file, but wrote my own parser to read the map files. this allows me, to set the path of a polygon pattern symbolizer, for example, to the place where the picture is really saved.
The parser works now and I can use the shape files. I've played around with various rules in the map file and found out, that every rule containing a "Filter"- condition, doesn't work. So I wrote a small program to just test this, and it works. So there seems no problem with Mapnik itself. I used the function "save_map()" to see what my applications sets. If I compare the result of "save_map()" with the map file, I can't see any difference. The filter conditions are there as expected. Now I don't understand, why rules with filter conditions in my application are ignored by Mapnik, while they are not in my test application. I use Mapnik 0.6 on a 64 bit Debian testing. Mapnik was installed from the Debian packages. The source of my small test program together with a picture of it's result and a small map file I used for tests, is available under: http://www.theosys.at/maptest/ I use the shape files from http://download.geofabrik.de/osm/europe. The following link points to the source of my self written interpreter: http://www.theosys.at/websvn/filedetails.php?repname=repos+1&path=%2Fsportwatcher%2Ftrunk%2Fsrc%2Frender.cpp The function "startDocument()" at line 196 is called before the parser starts and initializes everything. The function "startElement()" at line 318 is called every time the parser finds an open element in the XML file. It sets some flags and writes the contents of the attributes, if there are some, into some structures. The function "endElement()" at line 866 is called every time the parser finds a close element in the XML file. It calls most of the Mapnik functions and is controlled with the flags set in the previous function. The function "characters()" at line 1148 is called every time the parser finds some text between some elements (<Filter> filter condition </Filter>). The filter conditions of the rules are set there (line 1163). The function "getMap()" at line 1352 is called to start the parser. Here the XML parser is initialized and started if needed. To download the whole application type: svn co svn://www.theosys.at/sportwatcher/trunk sportwatcher I know this question sounds like: "Would you please find the error for me". But after several days of debugging I'm at a point where I can't find any explanation for the behavior of my code. -- Andreas Theofilu http://www.TheosSoft.net/ --==| Enjoy the science of Linux! |==-- _______________________________________________ Mapnik-devel mailing list [email protected] https://lists.berlios.de/mailman/listinfo/mapnik-devel
