Z26305

{
    "Z1K1": "Z2",
    "Z2K1": {
        "Z1K1": "Z6",
        "Z6K1": "Z26305"
    },
    "Z2K2": {
        "Z1K1": "Z14",
        "Z14K1": "Z25930",
        "Z14K3": {
            "Z1K1": "Z16",
            "Z16K1": "Z600",
            "Z16K2": "function Z25930( Z25930K1, Z25930K2 ) {\n\n\tvar latitudeK1 = 0n;\n\tvar latitudeK2 = 1n;\n\tvar longitudeK1 = 0n;\n\tvar longitudeK2 = 1n;\n\tvar precisionK1 = 1n;\n\tvar precisionK2 = 1n;\n\tvar QID = \"Q2\";\n\n\tvar l;\n\tvar dp1 = 0;\n\tvar dp2 = 0;\n\n\tif (l=Z25930K1.match(/^(.*[^\\s])\\s*\\((Q\\d*)\\)$/)) {\n\t\tZ25930K1=l[1];\n\t\tQID = l[2];\n\t}\n\tif (l=Z25930K1.match(/^(.*[^\\s])\\s*\\((.*)\\)$/)) {\n\t\t//any non-QID parentheses are chopped off, lookup names separately\n\t\tZ25930K1=l[1];\n\t}\n\tZ25930K1 = Z25930K1.replaceAll(\"−\", \"-\");\n\n\t//(?:geo:)?latitude_dec,longitude_dec without globe\n\tif (l=Z25930K1.match(/^(?:geo:)?([+-−]?\\d*[\\.\\,]?\\d*)°?,[^-−+\\d]*([+-−]?\\d*[\\.\\,]?\\d*)°?$/)) {\n\t\tl[1] = l[1].replaceAll(\",\", \".\");\n\t\tl[2] = l[2].replaceAll(\",\", \".\");\n\t\tif (l[1].includes(\".\")) {\n\t\t\tdp1 = l[1].split(\".\")[1].length;\n\t\t}\n\t\tif (l[2].includes(\".\")) {\n\t\t\tdp2 = l[2].split(\".\")[1].length;\n\t\t}\n\n\t\tlatitudeK1 = BigInt(l[1].replace(\".\",\"\"));\n\t\tlatitudeK2 = 10n**BigInt(dp1);\n\t\tlongitudeK1 = BigInt(l[2].replace(\".\",\"\"));\n\t\tlongitudeK2 = 10n**BigInt(dp2);\n\t\tprecisionK1 = 1n;\n\t\tprecisionK2 = latitudeK2 \u003C longitudeK2 ? latitudeK2 : longitudeK2;\n\t}\n\t\n\t//latitude_dec,longitude_dec with [NS] [EOW] without globe\n\tif (l=Z25930K1.match(/^[NS]?\\s*([+-−]?\\d*[\\.\\,]?\\d*)°?\\s*[NS]?\\,?\\.*[EOW]?[^-−+\\d]*([+-−]?\\d*[\\.\\,]?\\d*)°?[EOW]?$/)) {\n\t\tl[1] = l[1].replaceAll(\",\", \".\");\n\t\tl[2] = l[2].replaceAll(\",\", \".\");\n\t\tif (l[1].includes(\".\")) {\n\t\t\tdp1 = l[1].split(\".\")[1].length;\n\t\t}\n\t\tif (l[2].includes(\".\")) {\n\t\t\tdp2 = l[2].split(\".\")[1].length;\n\t\t}\n\n\t\tlatitudeK1 = BigInt(l[1].replace(\".\",\"\"));\n\t\tlatitudeK2 = 10n**BigInt(dp1);\n\t\tlongitudeK1 = BigInt(l[2].replace(\".\",\"\"));\n\t\tlongitudeK2 = 10n**BigInt(dp2);\n\t\tprecisionK1 = 1n;\n\t\tprecisionK2 = latitudeK2 \u003C longitudeK2 ? latitudeK2 : longitudeK2;\n\t\t\n\t\tif (Z25930K1.includes(\"S\")) {\n\t\t\tlatitudeK1 = latitudeK1 * -1n;\n\t\t}\n\t\tif (Z25930K1.includes(\"W\")||Z25930K1.includes(\"O\")) {\n\t\t\tlongitudeK1 = longitudeK1 * -1n;\n\t\t}\n\t}\n\n\t//THE FOLLOWING CASES DO NOT NEED SPACES TO INDICATE GAPS, SO REMOVE ALL SPACES\n\tZ25930K1 = Z25930K1.replace(/ /g, *);;\n\t//THE FOLLOWING CASES DO NOT NEED COMMAS TO INDICATE GAPS, SO SWAP ALL COMMAS TO FULL STOPS IN CASE THEY ARE RADIX CHARACTERS\n\tZ25930K1 = Z25930K1.replace(/,/g, '.');;\n\tWikifunctions.Debug(Z25930K1);\n\t\n\t// nDD°MM'SS.sss\"n wDDD°MM'SS.sssw\"\n\tif (l=Z25930K1.match(/^(?:[NS+-])?(\\d{1,2})°(\\d{1,2})[\\'′](\\d{1,2}(?:\\.\\d*)?)(?:*|[\\\"″])?(?:[+\\-NS])?\\.?(?:[+\\-EOW])?(\\d{1,3})°(\\d{1,2})[\\'′](\\d{1,2}(?:\\.\\d*)?)(?:''|[\\\"″])?(?:[+\\-EOW])?/)) {\n\t\tif (l[3].includes(\".\")) {\n\t\t\tdp1 = l[3].split(\".\")[1].length;\n\t\t}\n\t\tif (l[6].includes(\".\")) {\n\t\t\tdp2 = l[6].split(\".\")[1].length;\n\t\t}\n\t\tlatitudeK1 = BigInt(l[3].replace(\".\",\"\"))+(BigInt(l[2])*60n+BigInt(l[1])*3600n)*10n**BigInt(dp1);\n\t\tlatitudeK2 = 3600n*10n**BigInt(dp1);\n\t\tlongitudeK1 = BigInt(l[6].replace(\".\",\"\"))+(BigInt(l[5])*60n+BigInt(l[4])*3600n)*10n**BigInt(dp2);\n\t\tlongitudeK2 = 3600n*10n**BigInt(dp2);\n\t\tprecisionK1 = 1n;\n\t\tprecisionK2 = latitudeK2 \u003C longitudeK2 ? latitudeK2 : longitudeK2;\n\t\t\n\t\tif (Z25930K1.includes(\"S\")) {\n\t\t\tlatitudeK1 = latitudeK1 * -1n;\n\t\t}\n\t\tif (Z25930K1.includes(\"W\")||Z25930K1.includes(\"O\")) {\n\t\t\tlongitudeK1 = longitudeK1 * -1n;\n\t\t}\n\t}\n\n\t// nDD°MM.mmm'n wDDD°MM.mmm'w\"\n\tif (l=Z25930K1.match(/^(?:[NS+-])?(\\d{1,2})°(\\d{1,2}(?:\\.\\d*)?)[\\'′](?:[+\\-NS])?\\.?(?:[+\\-EOW])?(\\d{1,3})°(\\d{1,2}(?:\\.\\d*)?)[\\'′](?:[+\\-EOW])?/)) {\n\t\tWikifunctions.Debug(\"nDD°MMSS.sssn wDDD°MMSS.sssw\");\n\t\tif (l[2].includes(\".\")) {\n\t\t\tdp1 = l[2].split(\".\")[1].length;\n\t\t}\n\t\tif (l[4].includes(\".\")) {\n\t\t\tdp2 = l[4].split(\".\")[1].length;\n\t\t}\n\t\tlatitudeK1 = BigInt(l[2].replace(\".\",\"\"))+BigInt(l[1])*60n*10n**BigInt(dp1);\n\t\tlatitudeK2 = 60n*10n**BigInt(dp1);\n\t\tlongitudeK1 = BigInt(l[4].replace(\".\",\"\"))+BigInt(l[3])*60n*10n**BigInt(dp2);\n\t\tlongitudeK2 = 60n*10n**BigInt(dp2);\n\t\tprecisionK1 = 1n;\n\t\tprecisionK2 = latitudeK2 \u003C longitudeK2 ? latitudeK2 : longitudeK2;\n\t\t\n\t\tif (Z25930K1.includes(\"S\")) {\n\t\t\tlatitudeK1 = latitudeK1 * -1n;\n\t\t}\n\t\tif (Z25930K1.includes(\"W\")||Z25930K1.includes(\"O\")) {\n\t\t\tlongitudeK1 = longitudeK1 * -1n;\n\t\t}\n\t}\n\n\n\t\n\t// +DDMMSS.sss-DDDMMSS.sss/\n\tif (l=Z25930K1.match(/^([+-NS])(\\d{2})(\\d{2})(\\d{2}(?:\\.\\d*)?)([+-EW])(\\d{3})(\\d{2})(\\d{2}(?:\\.\\d*)?)(?:[+-]\\d*CRS.*)?\\/$/)) {\n\t\tif (l[4].includes(\".\")) {\n\t\t\tdp1 = l[4].split(\".\")[1].length;\n\t\t}\n\t\tif (l[8].includes(\".\")) {\n\t\t\tdp2 = l[8].split(\".\")[1].length;\n\t\t}\n\n\t\tlatitudeK1 = BigInt(l[4].replace(\".\",\"\"))+(BigInt(l[3])*60n+BigInt(l[2])*3600n)*10n**BigInt(dp1);\n\t\tlatitudeK2 = 3600n*10n**BigInt(dp1);\n\t\tlongitudeK1 = BigInt(l[8].replace(\".\",\"\"))+(BigInt(l[7])*60n+BigInt(l[6])*3600n)*10n**BigInt(dp2);\n\t\tlongitudeK2 = 3600n*10n**BigInt(dp2);\n\t\tprecisionK1 = 1n;\n\t\tprecisionK2 = latitudeK2 \u003C longitudeK2 ? latitudeK2 : longitudeK2;\n\t\t\n\t\tif (l[1].includes(\"-\")||l[1].includes(\"S\")) {\n\t\t\tlatitudeK1 = latitudeK1 * -1n;\n\t\t}\n\t\tif (l[5].includes(\"-\")||l[5].includes(\"W\")||l[5].includes(\"O\")) {\n\t\t\tlongitudeK1 = longitudeK1 * -1n;\n\t\t}\n\t}\n\n\t// +DDMM.mmm-DDDMM.mmm/\n\tif (l=Z25930K1.match(/^([+-NS])(\\d{2})(\\d{2}(?:\\.\\d*)?)([+-EW])(\\d{3})(\\d{2}(?:\\.\\d*)?)(?:[+-]\\d*CRS.*)?\\/$/)) {\n\t\tif (l[3].includes(\".\")) {\n\t\t\tdp1 = l[3].split(\".\")[1].length;\n\t\t}\n\t\tif (l[6].includes(\".\")) {\n\t\t\tdp2 = l[6].split(\".\")[1].length;\n\t\t}\n\n\t\tlatitudeK1 = BigInt(l[3].replace(\".\",\"\"))+BigInt(l[2])*60n*10n**BigInt(dp1);\n\t\tlatitudeK2 = 60n*10n**BigInt(dp1);\n\t\tlongitudeK1 = BigInt(l[6].replace(\".\",\"\"))+BigInt(l[5])*60n*10n**BigInt(dp2);\n\t\tlongitudeK2 = 60n*10n**BigInt(dp2);\n\t\tprecisionK1 = 1n;\n\t\tprecisionK2 = latitudeK2 \u003C longitudeK2 ? latitudeK2 : longitudeK2;\n\t\t\n\t\tif (l[1].includes(\"-\")||l[1].includes(\"S\")) {\n\t\t\tlatitudeK1 = latitudeK1 * -1n;\n\t\t}\n\t\tif (l[4].includes(\"-\")||l[4].includes(\"W\")||l[4].includes(\"O\")) {\n\t\t\tlongitudeK1 = longitudeK1 * -1n;\n\t\t}\n\t}\n\n\n\t// +DD.ddd-DDD.ddd/\n\tif (l=Z25930K1.match(/^([+-NS])(\\d{2}(?:\\.\\d*)?)([+-EW])(\\d{3}(?:\\.\\d*)?)(?:[+-]\\d*CRS.*)?\\/$/)) {\n\t\tif (l[2].includes(\".\")) {\n\t\t\tdp1 = l[2].split(\".\")[1].length;\n\t\t}\n\t\tif (l[4].includes(\".\")) {\n\t\t\tdp2 = l[4].split(\".\")[1].length;\n\t\t}\n\n\t\tlatitudeK1 = BigInt(l[2].replace(\".\",\"\"));\n\t\tlatitudeK2 = 10n**BigInt(dp1);\n\t\tlongitudeK1 = BigInt(l[4].replace(\".\",\"\"));\n\t\tlongitudeK2 = 10n**BigInt(dp2);\n\t\tprecisionK1 = 1n;\n\t\tprecisionK2 = latitudeK2 \u003C longitudeK2 ? latitudeK2 : longitudeK2;\n\t\t\n\t\tif (l[1].includes(\"-\")||l[1].includes(\"S\")) {\n\t\t\tlatitudeK1 = latitudeK1 * -1n;\n\t\t}\n\t\tif (l[3].includes(\"-\")||l[3].includes(\"W\")||l[3].includes(\"O\")) {\n\t\t\tlongitudeK1 = longitudeK1 * -1n;\n\t\t}\n\t}\n\n\t\n\tconst latitude = {\n\t\tK1: latitudeK1,\n\t\tK2: latitudeK2\n\t};\n\tconst longitude = {\n\t\tK1: longitudeK1,\n\t\tK2: longitudeK2\n\t};\n\tconst precision = {\n\t\tK1: precisionK1,\n\t\tK2: precisionK2\n\t};\n\t\n\treturn {K1: latitude,\n\t\t\tK2: longitude,\n\t\t\tK3: precision,\n\t\t\tK4: QID};\n}"
        }
    },
    "Z2K3": {
        "Z1K1": "Z12",
        "Z12K1": [
            "Z11",
            {
                "Z1K1": "Z11",
                "Z11K1": "Z1002",
                "Z11K2": "return geo-coord, javascript"
            }
        ]
    },
    "Z2K4": {
        "Z1K1": "Z32",
        "Z32K1": [
            "Z31"
        ]
    },
    "Z2K5": {
        "Z1K1": "Z12",
        "Z12K1": [
            "Z11",
            {
                "Z1K1": "Z11",
                "Z11K1": "Z1002",
                "Z11K2": "currently just testing the return format"
            }
        ]
    }
}