Modify

Opened 13 years ago

Closed 10 years ago

Last modified 10 years ago

#7421 closed enhancement (fixed)

[patch] circle created from way heads always clockwise

Reported by: malenki Owned by: team
Priority: minor Milestone: 15.05
Component: Core Version:
Keywords: create circle Cc:

Description

If one creates a circle from a way with two nodes or a way forming a triangle the created circle always goes counter-clockwise.
Since this tool is often used to created roundabouts (speaking for me :) ) and there is mostly right hand traffic in the world imo it would be the better choice to have the created circle go clockwise.

Attachments (1)

bug7421.patch (1.3 KB ) - added by Balaitous 11 years ago.

Download all attachments as: .zip

Change History (19)

in reply to:  description comment:1 by skyper, 13 years ago

Replying to malenki:

If one creates a circle from a way with two nodes or a way forming a triangle the created circle always goes counter-clockwise.
Since this tool is often used to created roundabouts (speaking for me :) ) and there is mostly right hand traffic in the world imo it would be the better choice to have the created circle go clockwise.

No, first of all it should keep the direction (triangle), then (at least for highways) it probably should check the coordinates to determine the driving direction to use it as direction.

comment:2 by Nicolas, 12 years ago

If you create a triangle with an anti-clockwise, then the circle generated is clockwise.

comment:3 by malenki, 11 years ago

Resolution: fixed
Status: newclosed

Now circles are always created clockwise. For me this issue is resolved.

in reply to:  3 comment:4 by skyper, 11 years ago

Resolution: fixed
Status: closedreopened

Replying to malenki:

Now circles are always created clockwise. For me this issue is resolved.

No, just use a way from south to north.

I do not like the change of direction when using a triangle but I can live with it.

comment:5 by malenki, 11 years ago

As I said:

Now circles are always created clockwise. For me this issue is resolved.

No matter from which place to where the way goes, also from south to north.
using r5977 (yesterdays latest)

in reply to:  5 comment:6 by skyper, 11 years ago

Replying to malenki:

As I said:

Now circles are always created clockwise. For me this issue is resolved.

No matter from which place to where the way goes, also from south to north.
using r5977 (yesterdays latest)

I totally misread your argument. Your are right that it now creates all circles clockwise but talking about right hand traffic the roundabout is a one way anti-clockwise circle.

The only other use with explicit direction I can think of would be water. Think it was dropped from natural=water but islands and coastline might still need one.

comment:7 by malenki, 11 years ago

Darn. Must have been a moron who opened this bug. -.- *cough*

Coastline still needs an explicit direction, water and islands don't (afaik) though JOSM validator still reports when land is on the wrong side.

comment:8 by skyper, 11 years ago

Well I still think:

  1. check the driving direction (default right -> counter clockwise)
  2. create natural=coastline always counter-clockwise
  3. create highway=* depending on 1.
  4. create a circle keeping the direction (3 nodes)
  5. create a counter-clockwise circle (2 nodes)

In any way it would make much sense to change the behaviour from clockwise to counter-clockwise.

comment:9 by skyper, 11 years ago

Type: defectenhancement

comment:10 by skyper, 11 years ago

Summary: circle created from way heads always counter-clockwisecircle created from way heads always clockwise

comment:11 by skyper, 11 years ago

Keywords: create circle added

comment:12 by Balaitous, 11 years ago

When I have changed CreateCircleAction for #5922, I didn't pay attention to circle direction.
But :

  • I think checking driving direction is too complex. It need a driving direction database, does JOSM have one ?
  • natural=coastline: Does circle are really necessary to draw coastline ?

The easiest way can be more useful.

  • 2 nodes -> always anticlockwise. (We have to make a choice, anticlockwise is a good one)
  • 3 nodes -> same direction as the selected node. (What is more intuitive for the user)

See attach patch.

by Balaitous, 11 years ago

Attachment: bug7421.patch added

comment:13 by Don-vip, 11 years ago

Summary: circle created from way heads always clockwise[patch] circle created from way heads always clockwise

in reply to:  12 comment:14 by skyper, 10 years ago

Replying to Balaitous:

When I have changed CreateCircleAction for #5922, I didn't pay attention to circle direction.
But :

  • I think checking driving direction is too complex. It need a driving direction database, does JOSM have one ?

You are right. Maybe an option to change the default directions is nice for left-side driving regions but I am not sure if it is needed.

  • natural=coastline: Does circle are really necessary to draw coastline ?

It is a nice starting object for small roundish isles. I did start to use "improve way accuracy" more than drawing mode.

The easiest way can be more useful.

  • 2 nodes -> always anticlockwise. (We have to make a choice, anticlockwise is a good one)
  • 3 nodes -> same direction as the selected node. (What is more intuitive for the user)

+1

comment:15 by simon04, 10 years ago

Concerning attachment:bug7421.patch, the existing function org.openstreetmap.josm.tools.Geometry#angleIsClockwise(Node, Node, Node) should be used.

comment:16 by bastiK, 10 years ago

There is now a left- and right-hand traffic database, which could be used (see [7193]).

comment:17 by Balaitous, 10 years ago

Resolution: fixed
Status: reopenedclosed

In 8303/josm:

fix #7421 - Circle created from way heads always clockwise

  • If 3 nodes closed way is selected, keep way direction when creating circle;
  • Otherwise use left- and right-hand traffic database (r7193) to determine way direction;
  • Add a Geometry.isClockwise(List<Node>) method;
  • Fix some sonar issue
  • Add test case

comment:18 by Klumbumbus, 10 years ago

Milestone: 15.05

Modify Ticket

Change Properties
Set your email in Preferences
Action
as closed The owner will remain team.
as The resolution will be set.
The resolution will be deleted. Next status will be 'reopened'.

Add Comment


E-mail address and name can be saved in the Preferences .
 
Note: See TracTickets for help on using tickets.