[OSM-talk] tagging and rendering highways in the USA and elsewhere

Jon Burgess jburgess777 at googlemail.com
Fri Apr 18 19:42:43 BST 2008


On Fri, 2008-04-18 at 19:14 +0100, Tom Hughes wrote:
> In message <8298be230804181044u1e83ea15vb879cee623f02a6a at mail.gmail.com>
>           "Adam Schreiber" <sadam at clemson.edu> wrote:
> 
> > On Fri, Apr 18, 2008 at 12:33 PM, Tom Hughes <tom at compton.nu> wrote:
> > >  The problem is that we do not have the technology to render different
> > >  countries in different ways. I don't believe we even know of an efficient
> > >  way to do it, so we don't even know what the technology would look like
> > >  should somebody want to write it.
> > 
> > Shouldn't this be as easy as adding a tag indicating country and
> > altering the stylesheet to say highway=motorway country=us =>
> > color=yellow, highway=motorway country=uk => color=blue?
> 
> Yes, obviously we could make everybody go round and tag the umpty
> million objects in the database with a country code. That is a pretty
> daft solution though when it should be possible to automate it.
> 
> Of course as soon as we'd done that people would start asking for
> the shield shapes to change by state so we'd have to go round and
> add state tags and so on...
> 
> Tom

Provided we have the polygons describing the boundaries of countries,
states etc then we could tag the data during the osm2pgsql processing.
Alternatively it might be possible for Mapnik to query them at run time
(with the right join to a table containing boundary polygons in the data
source SELECT line it might even be possible today).

Generating the appropriate polygons from OSM data would be another
challenge for the reader. Using an external tool like the one used for
coastline shapefile generator is probably the answer.

My main concern would be the maintainability of the osm.xml style file.
It is already nearing 200kB and adding country (or state) specific
rendering would make it even more complex.

	Jon







More information about the talk mailing list