JOSM/Plugins/Spline-drawing-tool

From OpenStreetMap Wiki
< JOSM‎ | Plugins
Jump to: navigation, search

Why using the Spline drawing tool plugin?

Spline.png

This plugin adds a tool to edit ways manually from sources like satellite image, but improved to place nodes computed from splines, in order to give more accurate and more realistic curves.

Mathematical bases

Bézier 2 big.gif

That tool is based on Bézier curves. A Bézier curve is defined by a set of control points P0 through Pn, where n is called its order (n = 1 for linear, 2 for quadratic, etc.). The first and last control points are always the end points of the curve; however, the intermediate control points (if any) generally do not lie on the curve.

In that tool is used quadratic Bézier curves. A quadratic Bézier curve is the path traced by the function B(t), given points P0, P1, and P2.

2d5e5d58562d8ec2c35f16df98d2b974.png

To draw a line using this equation, one can divide the curve into smaller segments, calculate the end points of each segment using the Bézier cubic equation and draw the line for the segment. For instance, one can draw a line between the points defined by t = 0 and t = 0.01, then t = 0.01 and t = 0.02, and so on.


Availability

The plugin should be available in your JOSM Plugins preference window under "Spline drawing tool" or you can download it from [1].

Usage

  1. Select manual tool. Im1.png
  2. Next step is to call Bézier curve algorithm when in the way is added more then two nodes, until that, is active the User Interface that draw the curve.
    Im2.png
  3. When add the third node(helping node "P1 from equation") will result an curve way.
    Im3.png
    ]


Other example

Im4.png

See also

JOSM/Plugins/Splinex another JOSM plugin for drawing splines

Feedback and suggestions

For news ideas please provided them in this section

  • Please change cursor when spline-mode is activated. - wambacher -
  • I think it would be good to let edit the line before saving it as dots (if it's possible after saving it would be great too, but it can be harder). - kocio