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