From 613de9eb8f998e1e3b34bde05b81811c8703d1ca Mon Sep 17 00:00:00 2001 From: Macide Celik Date: Mon, 28 Oct 2019 18:52:41 +0300 Subject: [PATCH] Delete ConvertCoordinateFormat.mjs --- .../operations/ConvertCoordinateFormat.mjs | 95 ------------------- 1 file changed, 95 deletions(-) delete mode 100644 src/core/operations/ConvertCoordinateFormat.mjs diff --git a/src/core/operations/ConvertCoordinateFormat.mjs b/src/core/operations/ConvertCoordinateFormat.mjs deleted file mode 100644 index f1e1b20f..00000000 --- a/src/core/operations/ConvertCoordinateFormat.mjs +++ /dev/null @@ -1,95 +0,0 @@ -/** - * @author j433866 [j433866@gmail.com] - * @copyright Crown Copyright 2019 - * @license Apache-2.0 - */ - -import Operation from "../Operation.mjs"; -import {FORMATS, convertCoordinates} from "../lib/ConvertCoordinates.mjs"; - -/** - * Convert co-ordinate format operation - */ -class ConvertCoordinateFormat extends Operation { - - /** - * ConvertCoordinateFormat constructor - */ - constructor() { - super(); - - this.name = "Convert co-ordinate format"; - this.module = "Hashing"; - this.description = "Converts geographical coordinates between different formats.

Supported formats:
The operation can try to detect the input co-ordinate format and delimiter automatically, but this may not always work correctly."; - this.infoURL = "https://wikipedia.org/wiki/Geographic_coordinate_conversion"; - this.inputType = "string"; - this.outputType = "string"; - this.args = [ - { - "name": "Input Format", - "type": "option", - "value": ["Auto"].concat(FORMATS) - }, - { - "name": "Input Delimiter", - "type": "option", - "value": [ - "Auto", - "Direction Preceding", - "Direction Following", - "\\n", - "Comma", - "Semi-colon", - "Colon" - ] - }, - { - "name": "Output Format", - "type": "option", - "value": FORMATS - }, - { - "name": "Output Delimiter", - "type": "option", - "value": [ - "Space", - "\\n", - "Comma", - "Semi-colon", - "Colon" - ] - }, - { - "name": "Include Compass Directions", - "type": "option", - "value": [ - "None", - "Before", - "After" - ] - }, - { - "name": "Precision", - "type": "number", - "value": 3 - } - ]; - } - - /** - * @param {string} input - * @param {Object[]} args - * @returns {string} - */ - run(input, args) { - if (input.replace(/[\s+]/g, "") !== "") { - const [inFormat, inDelim, outFormat, outDelim, incDirection, precision] = args; - const result = convertCoordinates(input, inFormat, inDelim, outFormat, outDelim, incDirection, precision); - return result; - } else { - return input; - } - } -} - -export default ConvertCoordinateFormat;