[OSM-dev] curves

bvh bvh-osm at irule.be
Fri Jan 4 13:41:23 GMT 2008


On Thu, Jan 03, 2008 at 03:16:47PM +0000, Artem Pavlenko wrote:
> What people think about explicitly supporting curves as a part of  
> geometry model? This way we can model the world better.

I would be heavily in favor of it. IMHO the simplest way to do this
is best.

What I could see working is something like this :

we define a standard interpolation method that turns a set of point into
a sucession of bezier curves. (for an example see
http://www.antigrain.com/research/bezier_interpolation/index.html)
I understand you have already implemented another on the fly
algorithm in mapnik, we could use that as well.

next there is a smooth=yes tag that would mean : apply the smoothing
on this road.

The big advantage is : no change is necessary on our data model.
Maintained tools can implement support for this on their own pace.
Old tools that don't know about smooth ways keep working. And
since we are only adding capabilities we are sure this introduces
no regressions (ie, everything that worked before keeps on working)

The only disadvantage is that over time, people working with
editors with smoothing support are going to add ways with very
little points, possibly resulting in choppy maps on renders
that don't know (yet) how to deal with the smooth tag.

> P.S. Are there some hints (tags) in OSM that can be used for to  
> smooth or not?

No, so I proposed one

http://wiki.openstreetmap.org/index.php/Proposed_features/smooth

> Also, are there are examples where it does work well and where it  
> doesn't?

I see two problematic cases with this approach : assuming you have
one flowing road that you've split up in multiple ways for
whatever reason. Now there could be a tangential discontinuity
at the junction point. I feel this is more a theoretical problem.
In practice people will probably put two
extra nodes close to the junction point to 'guide' the tangential
direction at both ends if the break is visually disturbing. 

The other case is related : assuming a flowing road with one
sharp corner. Whereas now you just lay it out as one way, you might
want to split this road to preserve the sharp corner in my proposal.

Not a big deal either : in the worst case you can still fall back
to an ordinary way and just add a bootload of points to make it
appear smooth as we do now.

cu bart




More information about the dev mailing list