import { Coordinates } from '../../domain/entities/coordinates'; import { IEncodeDirection } from '../../domain/interfaces/direction-encoder.interface'; export class PostgresDirectionEncoder implements IEncodeDirection { encode = (coordinates: Coordinates[]): string => [ "'LINESTRING(", coordinates.map((point) => [point.lon, point.lat].join(' ')).join(), ")'", ].join(''); }