Commit Graph

103 Commits

Author SHA1 Message Date
John Firebaugh
441be74539 Simplify 2013-02-02 21:28:56 -05:00
John Firebaugh
0b3e0fb3db Use iD.actions.DeleteNode when removing nodes
They need to be removed from any parent relations.
Also, make sure to uniq child nodes, otherwise the
start/end node over-contributes to the centroid
calculation.

This action needs tests.
2013-02-02 21:17:10 -05:00
John Firebaugh
b08722fd3f Pass just the projection to Circularize 2013-02-02 19:59:05 -05:00
John Firebaugh
a8410be6eb iD.actions.Join 2013-02-01 17:31:32 -05:00
John Firebaugh
9120f33aa7 ReverseWay -> Reverse 2013-02-01 17:31:32 -05:00
John Firebaugh
c86792a77b SplitWay -> Split 2013-02-01 17:31:32 -05:00
John Firebaugh
e1d5a0cb03 Unjoin -> Disconnect 2013-02-01 17:31:32 -05:00
John Firebaugh
58fcf746a2 Delete multiple 2013-02-01 15:08:41 -05:00
John Firebaugh
7ba31f05d2 Support deleting relations 2013-02-01 14:48:11 -05:00
John Firebaugh
df72ef254f ChangeEntityTags -> ChangeTags 2013-01-31 12:07:54 -05:00
John Firebaugh
6f7079d11c AddWay/AddNode -> AddEntity 2013-01-31 12:06:21 -05:00
John Firebaugh
1bfe1359ec AddWayNode -> AddVertex 2013-01-31 12:06:21 -05:00
John Firebaugh
e381b6ab26 Extract AddMidpoint action 2013-01-30 15:47:33 -05:00
John Firebaugh
6576ec6501 Operation sprites 2013-01-30 11:56:49 -05:00
John Firebaugh
69d95a6082 Refactor operations
They're something distinct from actions. Actions are independent
of UI, operations are actions + UI (title, keybinding, modality,
etc.)
2013-01-29 12:05:52 -05:00
John Firebaugh
c981fe5d80 Revert "Wrap all actions in Graph#update"
This reverts commit 3105923371.

See #508.
2013-01-25 16:17:26 -05:00
John Firebaugh
5ea855e18d Replace Graph#fetch with Graph#childNodes
Having two kinds of Ways (fetched and non-fetched)
introduced some accidental complexity. This brings things
more in line with how parentWays/parentRelations work.

Fixes #73.
2013-01-25 15:10:44 -05:00
John Firebaugh
3105923371 Wrap all actions in Graph#update 2013-01-25 13:43:35 -05:00
John Firebaugh
61a1f35a70 Use Graph#update in MoveWay 2013-01-25 13:27:33 -05:00
Tom MacWright
1f3319f7b0 Add circularize action. Fixes #491 2013-01-24 22:52:19 -05:00
John Firebaugh
b6d8ddc2f8 Remove unused branch and obsolete test 2013-01-24 11:21:12 -05:00
Tom MacWright
32ea30c3fb Use isPoi for determining whether points are pois or not 2013-01-23 19:14:54 -05:00
John Firebaugh
3138ba2805 Handle incomplete relations in SplitWay (fixes #466) 2013-01-23 15:52:35 -05:00
John Firebaugh
72618574f3 Rename permitted -> enabled and add to more actions 2013-01-23 15:33:30 -05:00
John Firebaugh
278bb4a51c Fix some cases where a degenerate way was created 2013-01-23 12:40:27 -05:00
John Firebaugh
292c916cb1 Converting some actions to entity methods
The guidelines here are:

Entity methods:
  return a modified entity
  don't necessarily maintain whole-graph consistency

Actions:
  return a modified graph
  always maintain whole-graph consistency
  call entity methods liberally
  generally don't call other actions
2013-01-23 12:40:27 -05:00
John Firebaugh
29d608970b UnjoinNode action (fixes #442) 2013-01-23 10:07:10 -05:00
John Firebaugh
c8bee263e9 Split ways at T junctions (fixes #453) 2013-01-21 20:32:17 -05:00
John Firebaugh
e19f86a285 Add newly split way to member relations 2013-01-18 14:44:29 -08:00
John Firebaugh
f16c54e12f Match argument order with AddRelationMember 2013-01-18 14:44:29 -08:00
John Firebaugh
2ee07a3b74 Add iD.actions.AddRelationMember 2013-01-18 14:44:29 -08:00
John Firebaugh
2a0ef21548 Fix restriction handling 2013-01-18 14:44:29 -08:00
John Firebaugh
fe8239b81e Rewrite tests 2013-01-18 14:44:28 -08:00
John Firebaugh
ce6e11a8a0 Test copying tags to the split way 2013-01-18 14:44:28 -08:00
John Firebaugh
4c6757714c parentWays/Relations now take an entity 2013-01-11 17:26:25 -08:00
Tom MacWright
eedc0fce9d Fast parent calculation. 2013-01-09 14:52:39 -05:00
Tom MacWright
b1c1844941 jshint touchups 2013-01-08 12:21:53 -05:00
John Firebaugh
bcb4de4305 Reverse directional tags and roles when reversing a way
Reverse known direction dependent tags other than `oneway`.
We assume that correcting a backwards oneway is the primary
reason for reversing a way.

The following transforms are performed:

Keys:
      *:right=* ⟺ *:left=*
    *:forward=* ⟺ *:backward=*
   direction=up ⟺ direction=down
     incline=up ⟺ incline=down
        *=right ⟺ *=left

Relation members:
   role=forward ⟺ role=backward

In addition, numeric-valued `incline` tags are negated.

The JOSM implementation was used as a guide, but transformations that 
were of unclear benefit or adjusted tags that don't seem to be used
in practice were omitted.

References:
   http://wiki.openstreetmap.org/wiki/Forward_%26_backward,_left_%26_right
   http://wiki.openstreetmap.org/wiki/Key:direction#Steps
   http://wiki.openstreetmap.org/wiki/Key:incline
   http://wiki.openstreetmap.org/wiki/Route#Members
   http://josm.openstreetmap.de/browser/josm/trunk/src/org/openstreetmap/josm/corrector/ReverseWayTagCorrector.java

Fixes #299.
2013-01-07 16:26:56 -08:00
John Firebaugh
f0acbc2653 loc -> point, dxdy -> delta 2012-12-21 12:10:44 -08:00
John Firebaugh
209b87f7e8 Extract MoveWay action 2012-12-13 17:39:07 -08:00
John Firebaugh
ee3f5cc768 Move -> MoveNode, in preparation for MoveWay 2012-12-13 17:39:07 -08:00
Tom MacWright
adb8ab53ce Update relation tests 2012-12-07 16:01:14 -05:00
Tom MacWright
5371d42cdf Continue with splitWay 2012-12-07 14:33:16 -05:00
Tom MacWright
6d7b135b22 Push more on split_way 2012-12-07 14:03:03 -05:00
Tom MacWright
bb6c0489a0 Fix adding to ways in the reverse direction 2012-12-07 12:01:48 -05:00
Tom MacWright
f74b29d93a Rudientary splitting of ways 2012-12-07 11:03:15 -05:00
Tom MacWright
618f5cc486 Merge branch 'master' of github.com:systemed/iD 2012-12-07 10:42:24 -05:00
Tom MacWright
f49728872e Fix way finishing, start on split way 2012-12-07 10:42:16 -05:00
John Firebaugh
3e45afbc5e Move history annotation to History#perform/replace
Actions are too low-level for annotations.
2012-12-07 10:35:39 -05:00
Tom MacWright
23856cc1c5 Reclose ways if you delete the repeated node. Fixes #221 2012-12-07 10:25:09 -05:00