285 Commits

Author SHA1 Message Date
Chaitanya Kadu
552c6b6148 preserve step_count/… while joining ways (#10926)
* preserve the sum of certain tags (`step_count`, `parking:*:capacity`) during _join_ operation
* preserve total value of `parking:*:capacity` tags during _split_ operation by distributing it proportionally to the resulting ways
* the abstract osm entity now accepts a list of tags to override during the merging, but otherwise is agnostic about how tags can be merged: the concrete merging resolution might depend on the concrete action that was performed
2025-04-17 14:13:53 +02:00
Kyℓe Hensel
7beace6698 add a changeset tag if a merge conflict occurred (#9636) 2025-03-05 12:38:32 +01:00
Kyℓe Hensel
ef88e1c7ca fix destination_sign relations not updated when splitting a way (#10646) 2025-02-17 11:46:42 +01:00
Martin Raifer
9f2b00f8c4 Merge branch 'develop' into way-reverse-dont-change-red-turn-direction 2025-02-13 11:00:58 +01:00
Martin Raifer
f3a985f78b ways with more than 2000 nodes: prevent lockup and provide validator-fix (#8808)
* add validation & fix for way vertices limit imposed by OSM API (try to choose splitting locations at existing intersection vertices if possible)
* fix splitting of closed ways at two or more nodes:
  this bug resulted sometimes in one extra split point in the result, or one of the split  vertices to be left unsplit
2025-02-11 20:08:38 +01:00
Kyℓe Hensel
a2e347ac97 prevent degenerate ways caused by deleting a corner of a triangle (#10003) 2025-02-05 14:38:03 +01:00
burrscurr
841991055c don't change direction of red_turn when way is reversed
Fixes #10736
2025-02-05 12:57:00 +01:00
burrscurr
f1d67e70e0 improve test coverage for reversing of turn lane values 2025-02-05 11:07:55 +01:00
Kyℓe Hensel
5735b2509d ignore relations by default in the extract operation (#9816)
using Shift+E allows the node **and its relations** to be extracted (the old behaviour)
2025-01-30 11:25:01 +01:00
Kyle Hensel
7afecd39ec minor tweaks to make some tests pass 2024-09-03 19:23:21 +10:00
Martin Raifer
f89beef46d add a few more test cases: split carriageway route; route with alternate 2024-03-05 17:19:45 +01:00
Martin Raifer
296ce859cf allow splitting of closed roundabout for certain rel types 2024-03-05 14:23:02 +01:00
Martin Raifer
11dfbe804c fix splitting of (route) relation member ways
instead of fully re-sorting the whole relation every time a member is split, perform a local operation: This works under the assumption that the relation is already sorted properly. The new way is inserted into the relation before or after the existing member, depending on how the old/new way connect to their neighboring members.

for cases where two ways form a loop, a additional look-ahead is implemented to disambiguate the order
2024-03-04 19:02:31 +01:00
Martin Raifer
97442403cf drop validator which checks for old style multipolygons
these have long been [fixed](https://blog.jochentopf.com/2017-08-28-polygon-fixing-effort-concluded.html) in OSM

see wiki: https://wiki.openstreetmap.org/wiki/Old_style_multipolygons
2024-02-29 13:28:22 +01:00
Martin Raifer
85f4cc0316 don't reverse side tag of highway=cyclist_waiting_aid features, fixes #10128 2024-02-25 15:36:17 +01:00
Kyℓe Hensel
f7cbdfb9e5 fix incorrect earth radius constants (#9793) 2023-08-02 18:13:49 +02:00
Martin Raifer
fc75d5f2a1 fix another regression (in b72f3aa), add tests 2022-11-24 19:12:23 +01:00
Martin Raifer
21e54f956d don't preserve preset's field tags if presets are sub-presets of each other
fixes #0372
2022-11-14 18:58:37 +01:00
Thomas Petillon
3ff06f9045 Fix relation handling on way split
Depending on which way is the longest, the new way is inserted into the
relation before the existing one. This case must be explicitly handled
for the relation to remain correct.
2021-12-06 21:25:23 +01:00
Thomas Petillon
21f171863c Keep the oldest IDs alive when merging nodes into a way 2021-12-06 21:25:22 +01:00
Thomas Petillon
23b3bc27b6 Keep the oldest ID alive when merging polygons 2021-12-06 21:23:38 +01:00
Thomas Petillon
87ca2b09cc Keep the oldest interesting ID alive when merging nodes 2021-12-06 21:23:38 +01:00
Thomas Petillon
e9c7436289 Use utilOldestID() when joining ways 2021-12-06 21:23:38 +01:00
Milos Brzakovic (E-Search)
68b5445689 testing infra improvement - disable silent errors
actions/join test fixed
2021-10-21 14:44:04 +02:00
Kyle Hensel
3f12dd5107 keep the oldest Way when merging 2021-10-01 10:31:21 +13:00
John Firebaugh
1457759994 Add support for connectivity relations 2021-09-08 20:30:38 -07:00
John Firebaugh
a14cf49710 Disable merge operation when it would damage relations
The operation is disabled when attempting to join ways which don't belong to identical sets of relations. Restriction relations are excluded, because they are already handled with slightly different logic.

Fixes #8674
Fixes #8645
Fixes #3825
Fixes #1512
2021-09-04 15:42:07 -07:00
Quincy Morgan
3f9ac9105b Enable no-undef-init eslint rule 2020-10-23 11:33:47 -04:00
Quincy Morgan
4ddd4a358b Deprecate vending=parcel_mail_in;parcel_pickup -> vending=parcel_pickup;parcel_mail_in (close #7988)
Enable upgrading of entire semicolon-delimited values
2020-09-28 16:07:11 -04:00
Quincy Morgan
5ddcfb0ced Add parameter to specify which way should keep the history when splitting ways (re: #7795)
Fix code tests
2020-09-14 11:27:20 -04:00
Peter Newman
4205ca1d07 Fix the seemingly safe spellings found by codespell
Untested, only checked by inspection.

(cherry picked from commit 2c47a11008)
2020-08-10 17:32:37 +01:00
Bryan Housel
4d0ef1bafc Export only the d3 functions we use in tests
(re: #4379)

This trims a bit more off the iD bundle size
2020-02-22 15:07:09 -05:00
Bryan Housel
919687d2cf Replace legacy names still used in tests, remove the legacy exports 2020-02-21 23:12:25 -05:00
Bryan Housel
3608659d21 Restore field inheritance 2020-02-10 16:22:13 -05:00
Bryan Housel
a333a341ec Don't require areaKeys to be setup for actionSplit tests to pass 2020-02-04 15:45:11 -05:00
Bryan Housel
e19bcb77d5 Require init() call before coreContext starts doing things
(closes #7304)
2020-01-29 19:27:12 -05:00
Bryan Housel
567eeac587 Make several data external instead of bundled:
Also dist/data/* contains minified files now

These are now external and will fetch as needed:
-export { dataAddressFormats } from './address-formats.json';
-export { dataDeprecated } from './deprecated.json';
-export { dataDiscarded } from './discarded.json';
-export { dataLanguages } from './languages.json';
-export { dataPhoneFormats } from './phone-formats.json';
-export { dataShortcuts } from './shortcuts.json';
-export { dataTerritoryLanguages } from './territory-languages.json';
2020-01-28 22:21:31 -05:00
Quincy Morgan
95a14ea722 Add unit test for single-member multipolygon collapse behavior exception for conflicting tags in actionJoin (re: f7d8c51bd3) 2019-11-21 12:54:59 -05:00
Quincy Morgan
4297b0d95b Add unit test for single-member multipolygon collapse behavior in actionJoin (re: f7d8c51bd3) 2019-11-21 11:20:56 -05:00
Katarzyna Król
48ccc7900e improve checking circularity and unit tests 2019-10-29 22:51:05 +01:00
Quincy Morgan
516570739c Fix node reverse code test
Add more code tests for reversing nodes
2019-09-18 13:13:44 -04:00
Quincy Morgan
c229326aad Allow using the Reverse operation on directional nodes (close #6850) 2019-09-17 10:57:55 -04:00
Quincy Morgan
14c0809426 Fix issue where cuisine -> diet upgrades could overwrite existing values (close #6462) 2019-05-31 08:25:29 -04:00
Quincy Morgan
0dfd0612b1 For ice rinks, prefer the "sport" values "ice_hockey" and "ice_skating" instead of "hockey" and "skating" since that latter are ambiguous
Don't remove other values when upgrading a tag value within a semicolon-delimited list
2019-05-23 15:39:15 -04:00
Bryan Housel
a72865e4d8 Treat anything with a from/via/to like a restriction
(closes #6221)

Applies to actions like splitting, connecting, extracting a via node, etc
2019-04-29 21:58:10 -04:00
Bryan Housel
bd2490a965 Reverse internal left/right/forward/backward keyparts
(closes #6235)

Previously only trailing keyparts would reverse:
 `cycleway:left` ⟺  `cycleway:right`
Now it can do internal keyparts too:
 `cycleway:left:surface` ⟺  `cycleway:right:surface`
2019-04-29 21:13:18 -04:00
Bryan Housel
05949608aa Support straightening of points
(closes #6217)

- Split `actionStraighten` into `actionStraightenWay` and `actionStraightenNodes`
- Now `operationStraighten` chooses the correct action depending on selected entities
- Also move `getSmallestSurroundingRectangle` from `actionReflect` to `geo.js`
2019-04-24 01:55:43 -04:00
Quincy Morgan
e04d860f62 Convert "Detach" operation into "Extract" operation that also works on areas (close #6203) 2019-04-22 14:46:01 -07:00
J Guthrie
bd44cec2e8 Fix broken testcase! 2019-04-08 16:48:27 +01:00
J Guthrie
57a0358061 Add test cases 2019-04-08 15:19:21 +01:00