[OSM-talk] buildings

Jon Burgess jburgess777 at googlemail.com
Wed Jul 25 19:50:54 BST 2007


On Wed, 2007-07-25 at 12:08 +0100, Andy Allan wrote:
> On 7/25/07, Cameron Patrick <cameron at patrick.wattle.id.au> wrote:
> > Dave Stubbs wrote:
> >
> > > > Nah, that should be easy to fix by editing the Mapnik XML.  It's not
> > > > that scary, honest!
> > >
> > > Hey! Who was scared?! :-)
> >
> > Hehe. I was when I first started poking it :-)
> >
> > > It may not be scary, but it is completely undocumented. Unless there
> > > is some hidden documentation somewhere.
> >
> > That's true, as far as I can tell.
> >
> > > So how would you fix the XML? Botch the SQL, or is there some weird
> > > and wonderful symbolizer incantation?
> >
> > The railway field is already being put into the database and pulled out
> > again by mapnik.  It should be a matter of adding a symbolizer
> > incantation - I'd probably copy/paste/adapt from the one for school and
> > change the colouring.  (These are in the <Style name="leisure"> block
> > for no good reason that I can see!)
> >
> > Cameron (Disclaimer: I only started fiddling with Mapnik last night so I
> > may be leading you up the garden path here!)
> 
> In that case, you should be aware that not all the things in
> planet.osm make it into the postgis database. Dave had to change stuff
> to get osm2pgsql to put ncn_ref info in the db for my cycle map to
> work, for instance - and it may be the same case with other stuff like
> this.

As you've probably already seen the OSM data is split into 3 basic types
(points, lines, polygons) in different SQL tables by osm2pgsql and then
the osm.xml contains SQL select statements which operate on each type
and has instructions on how to render each thing.

Doing some manipulation of the data during import by osm2pgsql is
already done for several things. Perhaps I need to generalize this data
manipulation into an abstract filter layer.

To give you a concrete example, when osm2pgsql encounters an area with
"amenity=parking" it adds a node with amenity=parking to the SQL it
generates (located at the approximate centre of the area).

When Mapnik then processes the SQL it renders:
* polygons with amenity=parking as a yellow filled polygon.
* points with amenity=parking with the blue P symbol.

It sounds like we need to add some similar logic to recognise
building=station areas and insert appropriate nodes to cause a station
symbol to appear.

	Jon






More information about the talk mailing list