Modify

Opened 12 years ago

Closed 9 years ago

Last modified 9 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 10 years ago.

Download all attachments as: .zip

Change History (19)

comment:1 in reply to:  description Changed 12 years ago by skyper

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 Changed 11 years ago by Nicolas

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

comment:3 Changed 11 years ago by malenki

Resolution: fixed
Status: newclosed

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

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

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 Changed 11 years ago by 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)

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

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 Changed 11 years ago by malenki

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 Changed 11 years ago by skyper

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 Changed 11 years ago by skyper

Type: defectenhancement

comment:10 Changed 11 years ago by skyper

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

comment:11 Changed 10 years ago by skyper

Keywords: create circle added

comment:12 Changed 10 years ago by 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 ?
  • 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.

Changed 10 years ago by Balaitous

Attachment: bug7421.patch added

comment:13 Changed 10 years ago by Don-vip

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

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

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 Changed 10 years ago by simon04

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

comment:16 Changed 10 years ago by bastiK

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

comment:17 Changed 9 years ago by Balaitous

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 Changed 9 years ago by Klumbumbus

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.

Add Comment


E-mail address and name can be saved in the Preferences.

 
Note: See TracTickets for help on using tickets.