From d0ef168a4ddcd9204fc542f1db50dab71b4502ff Mon Sep 17 00:00:00 2001 From: adedolapoadegboye Date: Thu, 1 Aug 2024 04:12:06 -0600 Subject: [PATCH] export data completed --- public/Examples/example-3D.csv | 200 +++++++++--------- public/Examples/example-3D.xlsx | Bin 9651 -> 9684 bytes .../Components/Visualizers/DataExports.jsx | 44 +++- src/Dev/Functions/ExportToExcel.jsx | 52 ----- 4 files changed, 138 insertions(+), 158 deletions(-) delete mode 100644 src/Dev/Functions/ExportToExcel.jsx diff --git a/public/Examples/example-3D.csv b/public/Examples/example-3D.csv index 7ec9acd..8ef48bc 100644 --- a/public/Examples/example-3D.csv +++ b/public/Examples/example-3D.csv @@ -1,101 +1,101 @@ Latitude,Longitude,Altitude -21.1803138,-114.1320062,1050 -21.1803246,-114.1320920,1050 -21.1803997,-114.1321993,1050 -21.1805069,-114.1321564,1050 -21.1801821,-114.1320062,1050 -21.1803246,-114.1319847,1050 -21.1803138,-114.1320276,1050 -21.1803782,-114.1320705,1050 -21.1807108,-114.1320705,1050 -21.1801636,-114.1321349,1050 -21.1804426,-114.1319847,1050 -21.1803460,-114.1320491,1050 -21.1803997,-114.1319203,1050 -21.1803889,-114.1320062,1050 -21.1803460,-114.1320062,1050 -21.1802924,-114.1319418,1050 -21.1804748,-114.1321993,1050 -21.1801529,-114.1320276,1050 -21.1802709,-114.1321778,1050 -21.1803246,-114.1320491,1050 -21.1803782,-114.1320062,1050 -21.1802602,-114.1320920,1050 -21.1803031,-114.1320276,1050 -21.1802280,-114.1320491,1050 -21.1802816,-114.1320062,1050 -21.1802924,-114.1319633,1050 -21.1803782,-114.1320920,1050 -21.1803567,-114.1321349,1050 -21.1805606,-114.1320062,1050 -21.1803567,-114.1321564,1050 -21.1804426,-114.1320920,1050 -21.1801314,-114.1320705,1050 -21.1802495,-114.1320062,1050 -21.1804104,-114.1320705,1050 -21.1803675,-114.1320705,1050 -21.1802280,-114.1320491,1050 -21.1803138,-114.1320062,1050 -21.1802280,-114.1321993,1050 -21.1804211,-114.1321778,1050 -21.1803675,-114.1322422,1050 -21.1801422,-114.1321564,1050 -21.1803138,-114.1323280,1050 -21.1801744,-114.1325212,1050 -21.1803246,-114.1321564,1050 -21.1804104,-114.1320062,1050 -21.1802816,-114.1319847,1050 -21.1803782,-114.1320276,1050 -21.1802816,-114.1320705,1050 -21.1802924,-114.1319203,1050 -21.1802280,-114.1320062,1050 -21.1803460,-114.1320491,1050 -21.1802495,-114.1320491,1050 -21.1803138,-114.1320920,1050 -21.1803997,-114.1320705,1050 -21.1804318,-114.1321564,1050 -21.1803889,-114.1320705,1050 -21.1804533,-114.1321135,1050 -21.1801958,-114.1320062,1050 -21.1802924,-114.1321778,1050 -21.1803567,-114.1321135,1050 -21.1803246,-114.1320062,1050 -21.1802602,-114.1320491,1050 -21.1803460,-114.1320062,1050 -21.1803889,-114.1320491,1050 -21.1802924,-114.1320705,1050 -21.1803460,-114.1320062,1050 -21.1802387,-114.1320491,1050 -21.1803675,-114.1320276,1050 -21.1802387,-114.1320705,1050 -21.1803675,-114.1320276,1050 -21.1803782,-114.1320062,1050 -21.1803031,-114.1320062,1050 -21.1803675,-114.1320491,1050 -21.1802495,-114.1320062,1050 -21.1802924,-114.1319203,1050 -21.1803138,-114.1319847,1050 -21.1803138,-114.1320705,1050 -21.1802177,-114.1313839,1050 -21.1803246,-114.1320062,1050 -21.1802065,-114.1320705,1050 -21.1803246,-114.1320276,1050 -21.1803031,-114.1321135,1050 -21.1803567,-114.1320491,1050 -21.1802924,-114.1320062,1050 -21.1803353,-114.1319847,1050 -21.1803460,-114.1320491,1050 -21.1805284,-114.1321564,1050 -21.1804104,-114.1320920,1050 -21.1803997,-114.1321349,1050 -21.1800671,-114.1319633,1050 -21.1801744,-114.1319847,1050 -21.1803246,-114.1320276,1050 -21.1802065,-114.1320705,1050 -21.1802924,-114.1321135,1050 -21.1802602,-114.1319418,1050 -21.1801207,-114.1319418,1050 -21.1802495,-114.1319418,1050 -21.1801314,-114.1320491,1050 -21.1802924,-114.1320491,1050 -21.1802924,-114.1320276,1050 \ No newline at end of file +51.1803138,-114.1320062,1050 +51.1803246,-114.1320920,1050 +51.1803997,-114.1351993,1050 +51.1805069,-114.1351564,1050 +51.1801851,-114.1320062,1050 +51.1803246,-114.1319847,1050 +51.1803138,-114.1320276,1050 +51.1803782,-114.1320705,1050 +51.1807108,-114.1320705,1050 +51.1801636,-114.1351349,1050 +51.1804426,-114.1319847,1050 +51.1803460,-114.1320491,1050 +51.1803997,-114.1319203,1050 +51.1803889,-114.1320062,1050 +51.1803460,-114.1320062,1050 +51.1802924,-114.1319418,1050 +51.1804748,-114.1351993,1050 +51.1801529,-114.1320276,1050 +51.1802709,-114.1351778,1050 +51.1803246,-114.1320491,1050 +51.1803782,-114.1320062,1050 +51.1802602,-114.1320920,1050 +51.1803031,-114.1320276,1050 +51.1802280,-114.1320491,1050 +51.1802816,-114.1320062,1050 +51.1802924,-114.1319633,1050 +51.1803782,-114.1320920,1050 +51.1803567,-114.1351349,1050 +51.1805606,-114.1320062,1050 +51.1803567,-114.1351564,1050 +51.1804426,-114.1320920,1050 +51.1801314,-114.1320705,1050 +51.1802495,-114.1320062,1050 +51.1804104,-114.1320705,1050 +51.1803675,-114.1320705,1050 +51.1802280,-114.1320491,1050 +51.1803138,-114.1320062,1050 +51.1802280,-114.1351993,1050 +51.1804511,-114.1351778,1050 +51.1803675,-114.1322422,1050 +51.1801422,-114.1351564,1050 +51.1803138,-114.1323280,1050 +51.1801744,-114.1325512,1050 +51.1803246,-114.1351564,1050 +51.1804104,-114.1320062,1050 +51.1802816,-114.1319847,1050 +51.1803782,-114.1320276,1050 +51.1802816,-114.1320705,1050 +51.1802924,-114.1319203,1050 +51.1802280,-114.1320062,1050 +51.1803460,-114.1320491,1050 +51.1802495,-114.1320491,1050 +51.1803138,-114.1320920,1050 +51.1803997,-114.1320705,1050 +51.1804318,-114.1351564,1050 +51.1803889,-114.1320705,1050 +51.1804533,-114.1351135,1050 +51.1801958,-114.1320062,1050 +51.1802924,-114.1351778,1050 +51.1803567,-114.1351135,1050 +51.1803246,-114.1320062,1050 +51.1802602,-114.1320491,1050 +51.1803460,-114.1320062,1050 +51.1803889,-114.1320491,1050 +51.1802924,-114.1320705,1050 +51.1803460,-114.1320062,1050 +51.1802387,-114.1320491,1050 +51.1803675,-114.1320276,1050 +51.1802387,-114.1320705,1050 +51.1803675,-114.1320276,1050 +51.1803782,-114.1320062,1050 +51.1803031,-114.1320062,1050 +51.1803675,-114.1320491,1050 +51.1802495,-114.1320062,1050 +51.1802924,-114.1319203,1050 +51.1803138,-114.1319847,1050 +51.1803138,-114.1320705,1050 +51.1805177,-114.1313839,1050 +51.1803246,-114.1320062,1050 +51.1802065,-114.1320705,1050 +51.1803246,-114.1320276,1050 +51.1803031,-114.1351135,1050 +51.1803567,-114.1320491,1050 +51.1802924,-114.1320062,1050 +51.1803353,-114.1319847,1050 +51.1803460,-114.1320491,1050 +51.1805284,-114.1351564,1050 +51.1804104,-114.1320920,1050 +51.1803997,-114.1351349,1050 +51.1800671,-114.1319633,1050 +51.1801744,-114.1319847,1050 +51.1803246,-114.1320276,1050 +51.1802065,-114.1320705,1050 +51.1802924,-114.1351135,1050 +51.1802602,-114.1319418,1050 +51.1801207,-114.1319418,1050 +51.1802495,-114.1319418,1050 +51.1801314,-114.1320491,1050 +51.1802924,-114.1320491,1050 +51.1802924,-114.1320276,1050 \ No newline at end of file diff --git a/public/Examples/example-3D.xlsx b/public/Examples/example-3D.xlsx index 48b2597c0bdc8862983eae27afb756906a528dc7..288f9f692cfdfa1ad58ee86d52c32ef7dab614ee 100644 GIT binary patch delta 3128 zcmYLL2{;q{AD_F1ml#b^jyam#3R`Z=+*u|<um zjZDO1$r=9h{{PSa{XNg`d4AvD_4z)Z@9})B6(bFa>;S+f7XTmt001Hb zR3d_~{_a6R{>qUz1B&fjY^GE}F)!;6+_rVK|GIfq8fAC21U*^e#}{c5ID1|+E%)`X@>~PVlTWqO7?p!Y@q#jy>bblP=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Q{l#BwPKR$+ { altPlotData, } = props; - const exportToExcel = () => { + const exportToExcelAndKml = () => { // Data for the second sheet const fileData = file.data.map((item, index) => { const dataEntry = { @@ -77,7 +77,7 @@ const DataExports = (props) => { // Create the second sheet and append it to the workbook const ws2 = XLSX.utils.json_to_sheet(fileData); - XLSX.utils.book_append_sheet(workbook, ws2, "File Data"); + XLSX.utils.book_append_sheet(workbook, ws2, "Data"); // Write the workbook to a binary string const excelBuffer = XLSX.write(workbook, { @@ -86,7 +86,9 @@ const DataExports = (props) => { }); // Create a Blob object from the binary string - const blob = new Blob([excelBuffer], { type: "application/octet-stream" }); + const excelBlob = new Blob([excelBuffer], { + type: "application/octet-stream", + }); // Generate a timestamp for the filename const timestamp = new Date() @@ -94,15 +96,45 @@ const DataExports = (props) => { .replace(/[-:T.]/g, "") .slice(0, 14); - // Trigger the file download - saveAs(blob, `data_results_${timestamp}.xlsx`); + // Trigger the file download for the Excel file + saveAs(excelBlob, `data_results_${timestamp}.xlsx`); + + // Generate KML content + const kmlContent = ` + + + Position Fixes + Position Fixes from GNSS Data + ${fileData + .map( + (item, index) => ` + + Fix ${index} + + ${item.Longitude},${item.Latitude},${ + item.Altitude ? item.Altitude : 0 + } + + ` + ) + .join("")} + + `; + + // Create a Blob object for the KML file + const kmlBlob = new Blob([kmlContent], { + type: "application/vnd.google-earth.kml+xml", + }); + + // Trigger the file download for the KML file + saveAs(kmlBlob, `data_results_${timestamp}.kml`); }; return (
diff --git a/src/Dev/Functions/ExportToExcel.jsx b/src/Dev/Functions/ExportToExcel.jsx deleted file mode 100644 index 1ff57b4..0000000 --- a/src/Dev/Functions/ExportToExcel.jsx +++ /dev/null @@ -1,52 +0,0 @@ -// Function to export data to Excel -import * as XLSX from "xlsx"; -import { saveAs } from "file-saver"; -const exportToExcel = (data) => { - // const formatValue = (value) => - // value !== undefined ? `${value} m` : value; - - // const data = [ - // ["Statistics", "Value"], - // ["Number of fixes", distances.length], - // ["Max Fix Error", formatValue(Math.max(...distances))], - // ["Min Fix Error", formatValue(Math.min(...distances))], - // [ - // "Average Fix Error", - // formatValue( - // ( - // distances.reduce((acc, val) => acc + val, 0) / distances.length - // ).toFixed(2) - // ), - // ], - // ["CEP 50%", formatValue(cep50)], - // ["CEP 90%", formatValue(cep90)], - // ["CEP 98%", formatValue(cep98)], - // ["Mean CEP 50%", formatValue(meanCep50)], - // ["Mean CEP 90%", formatValue(meanCep90)], - // ["Mean CEP 98%", formatValue(meanCep98)], - // ...(markers[0] && markers[0].alt > 1 - // ? [ - // ["SEP 50%", formatValue(sep50)], - // ["SEP 90%", formatValue(sep90)], - // ["SEP 98%", formatValue(sep98)], - // ["Mean SEP 50%", formatValue(meanSep50)], - // ["Mean SEP 90%", formatValue(meanSep90)], - // ["Mean SEP 98%", formatValue(meanSep98)], - // ] - // : []), - // ]; - - const worksheet = XLSX.utils.aoa_to_sheet(data); - const workbook = XLSX.utils.book_new(); - XLSX.utils.book_append_sheet(workbook, worksheet, "Data Stats"); - - const excelBuffer = XLSX.write(workbook, { - bookType: "xlsx", - type: "array", - }); - - const blob = new Blob([excelBuffer], { type: "application/octet-stream" }); - saveAs(blob, "data_stats.xlsx"); -}; - -export default exportToExcel;