[OSM-dev] looking for some spline code to adapt
Christoph Hormann
osm at imagico.de
Sun Jul 2 13:15:59 UTC 2017
On Sunday 02 July 2017, Rich Morin wrote:
> I'm generating sets of tactile maps for a blind friend, as follows:
>
> OSM export files -(Ruby)-> PostScript -(lpr)-> swell paper
>
> I'm using straight lines for the roads, using the PostScript moveto
> and lineto operators. However, I'd like to use the curveto operator:
>
> x1 y1 x2 y2 x3 y3 curveto -
>
> This operator draws a curve from the current point to the point
> (x3, y3) using points (x1, y1) and (x2, y2) as control points. The
> curve is a Bézier cubic curve. In such a curve, the tangent of the
> curve at the current point will be a line segment running from the
> current point to (x1, y1) and the tangent at (x3, y3) is the line
> running from (x3, y3) to (x2, y2).
>
> [...]
You can certainly do so but you need to expect that your results are
largely wrong.
The problem is that in OSM we do not record any supplemental information
on ways regarding if the corners at the nodes are actual corners or if
they are just approximations for a smooth form of some sort - what you
would usually do with a kind of tension parameter. Neither can you
rely on the fact that when two roads connect this is not a smooth
transit. It is not even defined if when a way approximates a smooth
form the nodes of the way are supposed to be on the curve or if they
should be placed so the average distance of the way to the curve is
minimized.
--
Christoph Hormann
http://www.imagico.de/
More information about the dev
mailing list