[OSM-dev] osm pre-processing API. Was: Re: Intelligent fitting street names in OSMarender

80n 80n80n at gmail.com
Sun Mar 11 09:03:51 GMT 2007

On 3/10/07, Frederik Ramm <frederik at remote.org> wrote:
> Hi,
> > Anyway, the advantage of having this as a preprocessing step as has
> > been pointed out by Frederick, Jochen is that it removes any
> > dependancy on the format of the osmarender svg. As a pre-process
> > step, it also removes the dependancy of osmarender as a renderer as
> > well, so other renderers might make use of it.
> Yay ,-)
> The text fitting stuff could also be elegantly solved in pre-
> processing. As far as I understand, Osmarender cannot reasonably
> compute the length of a way; it can say "put this text on that way"
> but it can never know whether the text will fit.

The length of a way *is* computable (using xsl).  It's the length of
the text that is more difficult to compute in a generalised manner.
You need to make assumptions about the font and its size to get an
accurate length measurement.

I think you have this problem anyway with a pre-processor as you have
no idea what font or size will be used by whatever it is that does the
rendering.  However, if you make some intelligent assumptions and add
the result to the .osm file as a hint then the renderers will probably
be able to make good use of them.


> If it knew the
> length of the way it could at least drop the text from ways that are
> much too short, or maybe even apply heuristics to select a shortened
> version of the name.
> So if the pre-processor would add some kind of length attribute to
> the way, that would perhaps enable Osmarender to make a good decision.
> As pointed out some time ago, the map projection could also be fully
> moved out of Osmarender into a preprocessing step, making projection
> more flexible and exact. This, however, would be something that makes
> the preprocessing step mandatory instead of optional... maybe
> Osmarender can be tweaked to "use supplied northing/easting values of
> nodes if present, otherwise apply own projection".
> Bye
> Frederik
> --
> Frederik Ramm  ##  eMail frederik at remote.org  ##  N49°00.09' E008°23.33'
> _______________________________________________
> dev mailing list
> dev at openstreetmap.org
> http://lists.openstreetmap.org/cgi-bin/mailman/listinfo/dev

More information about the dev mailing list