Commit Graph

275 Commits

Author SHA1 Message Date
Martin Raifer
aa96a67c65 use lodash-es everywhere, replace custom clamp methods with lodash 2025-04-21 14:43:35 +02:00
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
Martin Raifer
f4230785e1 fix squaring operation on vertices, closes #10401
* only calculate `motion` for the selected vertex
* don't treat vertex as "closed way" when checking disabled/enabled state of operation
2025-03-18 12:00:35 +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
918522442b minor refactoring / renaming 2025-02-13 10:55:31 +01:00
Kyℓe Hensel
bd85d31b73 fix relation membership list using a non-deterministic order (#10648) 2025-02-12 15:16:54 +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
burrscurr
55f5a96a42 handle key values that should not be reversed together 2025-02-05 12:57:29 +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
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
Martin Raifer
20f53e5748 document algorithm inline, handle "junction=circular" like roundabouts 2024-03-06 13:46:22 +01:00
Martin Raifer
d7aca27f41 minor code readibility refactoring 2024-03-05 17:20:04 +01:00
Martin Raifer
296ce859cf allow splitting of closed roundabout for certain rel types 2024-03-05 14:23:02 +01:00
Martin Raifer
13d46b0578 typo 2024-03-04 23:37:29 +01:00
Martin Raifer
82af60115d disalow splitting of closed roundabouts when they are part of a route
these cases are not covered by the splitting algorithm at the moment:
* typicall, only a part of the roundabout should be part of the resulting route
* when multiple routes meet at a roundabout coming from different angles, the roundabout must be split at any of those entry/exit point simutaneously, such that all routes remain correct

as a workaround, a mapper can remove the route relation(s) from the roundabout, split it accordingly and then re-add the respective parts to the relation(s) again.
2024-03-04 19:02:33 +01:00
Martin Raifer
7268a8538c handle closed roundabout ways like a single junction "point" 2024-03-04 19:02:32 +01:00
Martin Raifer
088db7ccc1 simplify boolean conditions 2024-03-04 19:02:32 +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
mxxcon
87819ed53f Adds nycdoitt:bin tag to list of tags to keep on building
When extracting a POI from a building or downgrading a building, this update keeps nycdoitt:bin= tag with the building, not extracts it to the node or deletes it.

resolves #8539
2023-11-14 09:42:32 +01:00
Martin Raifer
fa35f0e78d fix arguments of unsetTag call, fixes #9707 2023-07-07 18:39:44 +02:00
Martin Raifer
43784e2eff take entity loc into account when resolving fields via parent preset, fixes #9524
this necessary when a regional preset (e.g. from NSI) is supposed to inherit fields from a parent preset, but the direct parent does NOT apply at the location of the entity to be added/edited. In that case we need to search for a potential regional variant of the parent preset.
2023-05-25 19:19:09 +02:00
Martin Raifer
41aa127d23 reduce use of parseFloat
as it silently strips non-numeric suffixes (e.g. a value of "123 foo" is transformed into a numeric value of 123 by `parseFloat`, which is typically not what we desire)
2022-11-24 19:39:15 +01:00
Martin Raifer
fc75d5f2a1 fix another regression (in b72f3aa), add tests 2022-11-24 19:12:23 +01:00
Martin Raifer
b72f3aae19 fixes a regression in f573c37 2022-11-24 18:40:11 +01:00
Martin Raifer
f573c374c2 number field: improve +/- buttons
* Clamp degree values in `direction` fields between 0 and 359 degrees, fixes #9386
* Only match cardinal values to numbers in `direction` fields
* Disable increment/decrement buttons on number fields if the input value is not numeric or when there is a multi-selection with conflicting values
* Fix/implement reverse operation for semicolon delimited `direction` values
2022-11-24 15:16:49 +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
Martin Raifer
96bac0650b on preset change: don't drop tags if ∃ a matching field in the new preset
closes #9341
closes #9104
2022-10-27 13:06:00 +02:00
Martin Raifer
46a386cae7 add #8839 to changelog, minor cleanup of unused imports 2021-12-07 11:57:38 +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
Martin Raifer
040257fd44 replace unnecessary setting of raw "html" with "text" 2021-11-18 18:53:33 +01:00
Martin Raifer
8892b437a1 escape and format conflict details as localized html strings
these are in html because they contain links to osm user profiles
2021-11-18 13:09:57 +01:00
Martin Raifer
c854564389 introduce allowlist for disconnectable relation types 2021-11-16 18:03:51 +01:00
John Firebaugh
3e082bb20e Fix typos 2021-10-24 11:01:44 -07: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
af4acaec79 Don't clear power output tag when changing between power presets (close #8159) 2020-12-21 13:17:18 -05:00
Quincy Morgan
0a0e2dcf75 Fix issue where extracting points could results in off placements (close #8246) 2020-12-11 12:50:32 -05:00
Quincy Morgan
ba48a861bc Enable curly and block-spacing eslint rules 2020-11-10 14:19:11 -05:00
Quincy Morgan
ba4c1ef014 Account for instances where d3.geoCentroid returns incorrect results 2020-10-29 14:28:21 -04:00
Quincy Morgan
4059ee5118 Enable block-scoped-var eslint rule 2020-10-23 13:38:36 -04:00
Quincy Morgan
04b3a788f9 Add lint:fix script
Enable no-trailing-space eslint rule
2020-10-23 13:24:44 -04:00
Quincy Morgan
1a6e1b97cb Merge pull request #8083 from teymour-aldridge/develop
Tidy some things up.
2020-10-21 09:43:46 -04:00