Re: [OSM-dev] looking for some spline code to adapt
sent from a phone > On 2. Jul 2017, at 15:15, Christoph Hormannwrote: > > 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. at least we don't do it on a bigger scale, there are very few examples where someone has done it: https://taginfo.openstreetmap.org/keys/bezier or has proposed to do it: https://wiki.openstreetmap.org/wiki/Relations/Proposed/Curvature Maybe we should push for a common solution to add this kind of information? Cheers, Martin ___ dev mailing list dev@openstreetmap.org https://lists.openstreetmap.org/listinfo/dev
Re: [OSM-dev] looking for some spline code to adapt
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/ ___ dev mailing list dev@openstreetmap.org https://lists.openstreetmap.org/listinfo/dev
[OSM-dev] looking for some spline code to adapt
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). -- http://www.tailrecursive.org/postscript/operators.html I'm not sure what the best starting point would be for this. I found this Perl code, but it seems a bit dated: http://wiki.openstreetmap.org/wiki/Osmarender/BezierCurves Clues, comments, and suggestions? -r -- http://www.cfcl.com/rdm Rich Morin r...@cfcl.com http://www.cfcl.com/rdm/resumeSan Bruno, CA, USA +1 650-873-7841 Software system design, development, and documentation ___ dev mailing list dev@openstreetmap.org https://lists.openstreetmap.org/listinfo/dev