mirror of
https://github.com/mauriceboe/TREK.git
synced 2026-10-18 21:16:47 +00:00
feat(tours): the contracts and the pure core of the paddle obstacle checklist
PAD-06 and PAD-09 in shared. A paddle tour's checklist lists the obstacles of the OpenStreetMap data along its route, each bound to a basis: the route near the obstacle as samples around every passage, and the material data of the obstacle as a hash and its position. A decision keeps that basis, so it reads as one to check again once the route or the data changed there, and a portage decision holds while the paddler's own portage carries round every passage. The check bench sums the list up for the tours list and the day plan. Nothing in it is a safety or legal clearance. The route relation learns the passages of a route by an object and the distance of a point to a route. The client takes the obstacle key from shared instead of its own copy.
This commit is contained in:
@@ -12,7 +12,6 @@ import {
|
||||
isBlockingKind,
|
||||
metresOf,
|
||||
OBSTACLE_FACT_KEYS,
|
||||
obstacleKeyOf,
|
||||
osmUrlOf,
|
||||
paddleObstacleDetail,
|
||||
routeStripObstacles,
|
||||
@@ -55,16 +54,11 @@ function detailOf(
|
||||
});
|
||||
}
|
||||
|
||||
describe('osmUrlOf and obstacleKeyOf', () => {
|
||||
describe('osmUrlOf', () => {
|
||||
it('FE-PADDLE-OBSMODEL-001: links the object in OpenStreetMap by its own reference', () => {
|
||||
expect(osmUrlOf('way/29256405')).toBe('https://www.openstreetmap.org/way/29256405');
|
||||
expect(osmUrlOf('node/17')).toBe('https://www.openstreetmap.org/node/17');
|
||||
});
|
||||
|
||||
it('FE-PADDLE-OBSMODEL-002: decides about the parts of a lock together and about everything else on its own', () => {
|
||||
expect(obstacleKeyOf({ ref: 'way/2', group_key: 'lock:way/1' })).toBe('lock:way/1');
|
||||
expect(obstacleKeyOf({ ref: 'node/3', group_key: null })).toBe('node/3');
|
||||
});
|
||||
});
|
||||
|
||||
describe('isBlockingKind', () => {
|
||||
|
||||
@@ -53,11 +53,6 @@ export function osmUrlOf(ref: string): string {
|
||||
return `https://www.openstreetmap.org/${ref}`;
|
||||
}
|
||||
|
||||
/** The one an obstacle checklist decides about: a lock's parts together, everything else on its own. */
|
||||
export function obstacleKeyOf(feature: Pick<PaddleFeature, 'ref' | 'group_key'>): string {
|
||||
return feature.group_key ?? feature.ref;
|
||||
}
|
||||
|
||||
export function isBlockingKind(kind: PaddleObstacleKind): boolean {
|
||||
return PADDLE_BLOCKING_KINDS.includes(kind);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user