81 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
9d16588f19 move deprecatedTags logic out of osmEntity and into a helper function (#10842) 2025-03-07 18:29:25 +01:00
Kyℓe Hensel
38d2ccd866 isHighwayIntersection only applies to nodes, so remove from osmEntity (#10831) 2025-03-04 11:29:29 +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
Kyℓe Hensel
4747ae253c refactor isOneWay to properly support bidirectional ways (#10730) 2025-02-12 14:22:09 +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
Kyle Hensel
7afecd39ec minor tweaks to make some tests pass 2024-09-03 19:23:21 +10: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
Kyℓe Hensel
43b4b4f02b render right-sided arrows for features with lifecycle prefixes (#9493) 2023-03-03 18:53:10 +01:00
Martin Raifer
097c6bd774 skip unsupported/invalid restrictions instead of fallback to "no_*"
closes #9337 (at least kind of… for a proper solution see #6460)
2022-10-27 18:36:05 +02:00
Kyℓe Hensel
724462ec47 consider lifecycle prefixes in osmTagSuggestingArea (#8881) 2022-06-06 15:56:31 +02:00
Thomas Petillon
7a1d08f80e Return the empty string when calling toOSM() on entities with test IDs 2021-12-06 21:25:22 +01:00
Bryan Housel
3665f80d46 Also include operator:wikidata as a wikidata tag
osmEntity#hasWikipedia was only used by the suspicious_name validator
2021-01-29 11:11:59 -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
Peter Newman
2c47a11008 Fix the seemingly safe spellings found by codespell
Untested, only checked by inspection.
2020-06-28 23:06:44 +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
0fe766d9a4 WIP on external presets
- preset data is no longer bundled into iD.js
- some code pathways commented out re: external presets
- many changes so that tests can run without presets at start, or async
- still need to make sure fallbacks are always there (point, line, area, etc)
2020-02-05 09:38:26 -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
5011039087 Clarify some variable names in osmEntity.deprecatedTags and add more code tests 2020-01-09 09:49:31 -05:00
Quincy Morgan
81b561fffc Don't close unclosed multipolygon parts with fewer than three nodes when generating geojson
Update multipolygon geojson code tests
2019-11-22 17:01:51 -05:00
Bryan Housel
344aec206c Support special styling for wikidata-tagged features 2019-05-18 23:57:23 -04:00
Bryan Housel
2b46440429 Add Relation#hasFromViaTo method and tests 2019-04-29 21:39:40 -04:00
Bryan Housel
167824a530 Make sure all nodes have an actual loc property
- This is to make difference comparisons easier
- The only nodes that didn't have a `loc` were fake nodes we made for testing
- So this commit also fixes the `osmIntersection` code and tests.
2019-04-03 16:20:45 -04:00
Bryan Housel
c7e375cbd7 Preserve directionality of sided way when joining to non-sided ways
(closes #6033)
2019-03-21 22:19:05 -04:00
Quincy Morgan
17087f42c8 Adding mechanism for specifying an upgrade path for deprecated presets (close #6045) 2019-03-13 17:51:12 -04:00
Quincy Morgan
bfb5285dc9 Fix tests and lint warnings 2019-02-04 13:34:27 -05:00
Quincy Morgan
9785021f44 Rename simpleMultipolygon functions to oldMultipolygon
Return old_multipolygon validation issues for the relations as well as the outer ways
Remove console logging
Don't run missing_tag validation for relations with old_multipolygon issues
2019-02-01 15:19:28 -05:00
Bryan Housel
71b2d2c6b7 Upgrade legacy symbols in tests
- iD.Context -> iD.coreContext
- iD.Graph -> iD.coreGraph
- iD.Node -> iD.osmNode
- iD.Way -> iD.osmWay
- iD.Relation -> iD.osmRelation
2019-01-30 15:43:02 -05:00
Quincy Morgan
cfbb86f88c Change the initial view of the sidebar on selection 2018-12-19 17:44:41 -05:00
Huon Wilson
dd0be84da4 Add one-sided triangular markers to ways with sides (e.g. natural=cliff).
This generalizes the oneway arrow logic for adding SVG markers along a
line. Using that functionality, certain tags get arrows on their
right-hand side, indicating which side is "inside", e.g. the
right-side of a cliff is the lower side.

The list of tags considered to be sided (unless there's a
two_sided=yes tag) is:

- natural=cliff
- natural=coastline
- barrier=retaining_wall
- barrier=kerb
- barrier=guard_rail
- barrier=city_wall
- man_made=embankment

The triangles attempt to be reminiscent of the triangles used for
rendering cliffs on OSM (and elsewhere). The different tags get
different renderings (e.g. colors that match the main way, and
different spacings). In addition, natural=coastline is special-cased
to have blue markers (despite having a green way), to emphasise that
the "inside" of a coastline is the water.

Fixes https://github.com/openstreetmap/iD/issues/1475.
2018-11-28 01:45:50 +11:00
Thomas Hervey
26f045b16c added/updated service/osm, osm/note, mode/add_note tests 2018-07-23 16:17:48 -04:00
Thomas Hervey
baad5f0cc5 added tests for osm/note 2018-07-21 21:44:07 -04:00
Thomas Hervey
bd1586500e added tests for notes service 2018-07-13 15:01:43 -04:00
Bryan Housel
00e5e8efa0 Avoid reversing osmWays in order to "prefer a forward path"
(closes #4872, related #4859)
2018-04-18 23:43:19 -04:00
Bryan Housel
d20c537e46 Don't match a simple from-via-to restriction by taking a longer path 2018-04-11 22:54:49 -04:00
Bryan Housel
540f0f11dd Add failing test for alternate path matching a restrictionID 2018-04-11 00:24:20 -04:00
Bryan Housel
56dba67b42 Add via 2 way tests 2018-04-10 22:11:06 -04:00
Bryan Housel
63b73c59b4 Add tests for complex intersections, no/only restrictions, via node/way
(tests cover #4951, #4928, #4849)
2018-03-29 23:13:22 -04:00
Bryan Housel
241159b547 Cleanup docs and tests for actionRestrictTurn / actionUnrestrictTurn
- actionRestrictTurn will no longer "infer" the turn type
- restrictionType *must* be passed in - this is ok because the only code
  we use this action (restrictions.js) already has inferred the type
- this simplifies what the action actually does
- moved the tests from restrict_turn.js that were really just testing
  the restriction type inferrence over to intersection.js
  (and added a few more tests for iD.osmInferRestriction)
2018-02-28 23:55:59 -05:00
Bryan Housel
e1cf49eaff Remove the "excludes coincident highways" check
These should not be a thing, and if they are, I'm ok with them
being treated as 2 separate ways.  We can add code back in later
if it turns out to be a widespread issue in OSM.
2018-02-28 13:42:26 -05:00
Bryan Housel
7fa27217b6 Return an indirect u-turn restriction for an only restriction 2018-02-23 11:59:44 -05:00
Bryan Housel
46cc6cc262 Update tests to use '_' id separators instead of ','
(using ',' with css selectors was problematic)
2018-02-23 11:30:54 -05:00
Bryan Housel
0cbff57dc9 Cycle through only_ turn restriction states
(re: #2622)
2018-02-07 19:04:28 -05:00
Bryan Housel
c1378a141f Add support for complex intersection and via way restrictions 2018-02-02 19:58:09 -05:00
Bryan Housel
80a998e9c5 Support multiple semicolon delimited direction values
(closes #4755)
2018-01-29 17:49:08 -05:00
Bryan Housel
b35f6f3f15 highway=motorway_link no longer implies oneway=yes
(closes #4727)

iD still explicitly set the tag, and default it to `oneway=yes`
2018-01-22 21:45:14 -05:00
Bryan Housel
de488e252f Draw covered/underground lines beneath areas
(closes #4718)
2018-01-22 15:06:58 -05:00
Bryan Housel
7c918ba161 Allow Relation.replaceMember to optionally preserve duplicates
(closes #4696)
2018-01-18 16:52:23 -05:00
Bryan Housel
075b85c81d Apply reversal actions in actionJoin
(closes #4688)
2018-01-14 14:49:57 -05:00