Hello Dane, thanks a lot.
I tried a Filter with POP2005 because it was given as an example. I learned quite some things about Shapefiles since then, what i was really searching for was a way to filter for the federal states of Germany, I got a Shaapefile that contains the 16 federal states, i can filter for them and display them in different colors. A drawback that i found out is that there is much more detail in the data in PostGIS (planet.osm), some borders seem to be "cut" in that Shapefile. So now i look for a way to get the borders of federal states of Germany in more detail. My first try for this was to add a PostGIS layer in QGIS and extract the borders somehow. This brought up some issues with QGIS (adding a PostGIS layer does not seem to work). Another idea would be to extract the borders of Germany and its federal states from PostGIS directly per SQL or so. Is there a way for this? Or is there a better way to get these data? Best regards, Torsten. Am Freitag, 1. Mai 2009 17:38:21 schrieb Dane Springmeyer: > Torsten, > > On Apr 28, 2009, at 9:14 PM, Torsten Mohr wrote: > > Hello, > > > > i tried to display a country in a different color based on the > > example at: > > > > http://trac.mapnik.org/wiki/XMLGettingStarted > > > > I tried applying a different color for some countries: > > > > <Filter>[POP2005] > 60000</Filter> > > <PolygonSymbolizer> > > <CssParameter name="fill">#ffcfc9</CssParameter> > > </PolygonSymbolizer> > > Yes, this filter will work as long as the countries are not > __already__ filtered by a previous rule. > > > This should match for nearly every country, but the color shown is > > not what > > i expect. > > > > I'm not sure what's wrong, if POP2005 is contained in the this source: > > <Parameter name = > > "file">/usr/share/mapnik/world_boundaries/shoreline_300</Parameter> > > Whats wrong is that you need to use a Shapefile with the population > attribute (specifically a field/column named POP2005) which is found > in the sample data linked to in the tutorial but NOT in the > 'shorefline_300' shapefile. > > It is this shapefile that has that attribute: > > http://thematicmapping.org/downloads/TM_WORLD_BORDERS-0.3.zip > > > Also, a filter like [name]='Germany' would be great, but i'm not > > sure how > > to formulate it (use 'name'? Or 'country'? Or something different? > > Match it to 'Germany'? Or 'Deutschland'?) > > It depends on your data. The above shapefile does have a NAME field > and lists it as 'Germany' > > I checked that on a GeoDjango Demo site that displays the attributes > of this same shapefile: > > http://geoadmin.dbsgeo.com/databrowse/world/worldborders/objects/72/ > > But the easiest thing is to just download the shapefile and open in > Quantum GIS. > > > Can anybody give me a hint on how to proceed best or how to > > formulate the filters / rules? > > You can also use Mapnik to introspect the shapefile, but the interface > in Python is a bit hidden. I've just been working on this in trunk, > however, so if you build Mapnik trunk you can do something like the > example here: > > (which loops through various countries and applies a highlighted style) > > http://mapnik-utils.googlecode.com/svn/example_code/map_sequences/run.py > > Cheers, > > Dane _______________________________________________ Mapnik-users mailing list [email protected] https://lists.berlios.de/mailman/listinfo/mapnik-users

