[OSM-dev] Drawing ways with bezier curves rather than line segments

Barry Crabtree barry.crabtree at gmail.com
Wed Jan 24 22:53:59 GMT 2007

> > I've been experimenting with using bezier curves to connect the
> > segments in a way rather than using straight line segments as it is
> > done at the moment. There is a before and after image at
> > http://wiki.openstreetmap.org/index.php/User:Dotbaz - this was
> > somewhere (Kobenhavn) I caught as it was going past my tiles at home so
> > hopefully someone has recently edited this area and might know it!
> the 2nd picture (with the railway station Wankdorf) is Berne,
> Switzerland and i have to say it's impressive! at first i thought
> rounding everything would be wrong since all geo-tools work with
> straight lines (at least without the projection) but having seen it, i
> have to say it's much nicer to present (not to work with, but for
> rendering/presentation) and it doesn't over-compensate as i thought it
> would

It did the first time I ran it :-) - made for a very wavey map before I made
sure it didn't make sharp angles curvy!

- it'd be nice to see it on a very long segment which has hard,
> short turns on both ends. somewhat like a race-track but more straight
> in the middle.
> ________
> (________)

It should deal with that fine - if the bends are sharp it doesn't try to
over-curve them.

> > Basically it post-processes the svg output from osmarender and
> > replaces all the ways with bezier curves connecting the segments
> > rather than straight line segments.
> is the additional load on calc./rendering the curves heavy?

The calculations are not too bad a little bit of vector maths to work out
each control point per segment. & I think rendering the curves is pretty
much optimised with vector drawing tools.

> > I'd appreciate any feedback, and if anyone wants me to do a particular
> > area, just mail me the svg & I'll reply with a 'smoothed' version!
> how about a fully rendered planet.osm ;)
> Dream on :-)
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.openstreetmap.org/pipermail/dev/attachments/20070124/81f83f3e/attachment.html>

More information about the dev mailing list