Skip to content

Commit

Permalink
fix workers to compile
Browse files Browse the repository at this point in the history
  • Loading branch information
derGraph committed Dec 23, 2024
1 parent 6bee522 commit 5c75969
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 6 deletions.
2 changes: 1 addition & 1 deletion workers/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
"workers": "file:"
},
"devDependencies": {
"@prisma/client": "^5.19.1",
"@prisma/client": "^6.1.0",
"@types/shapefile": "^0.6.4",
"tsc-alias": "^1.8.10",
"typescript": "^5.5.4"
Expand Down
10 changes: 5 additions & 5 deletions workers/simplifyGps.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,9 @@ import { getDistance, getDistanceFromLine } from 'geolib';
import shapefile from "shapefile";
import * as turf from '@turf/turf';

console.log("BEFORE READ")
/*console.log("BEFORE READ")
const reader = await shapefile.open("../store/World_Seas_IHO_v3.shp");
console.log("after read")
console.log("after read")*/

export async function simplifyGps(trip: string, amount: number) {
let totalAmount = 0;
Expand Down Expand Up @@ -35,7 +35,7 @@ export async function simplifyGps(trip: string, amount: number) {


for (let i = 1; i < inputData.length - 1; i++) {
await getRegion(inputData[i]);
//await getRegion(inputData[i]);
let crosstrackError = getDistanceFromLine(
{ lat: Number(inputData[i].lat), lng: Number(inputData[i].long) },
{ lat: Number(lastPoint.lat), lng: Number(lastPoint.long) },
Expand Down Expand Up @@ -195,7 +195,7 @@ export async function simplify(){
}

export async function getRegion(datapoint:Datapoint) {
try {
/*try {
// Step 2: Create a point using the GPS coordinates
const point = turf.point([Number(datapoint.lat), Number(datapoint.long)]);
Expand Down Expand Up @@ -223,7 +223,7 @@ export async function getRegion(datapoint:Datapoint) {
} catch (error) {
console.error("Error processing shapefile or point:", error);
return null;
}
}*/
}

interface Datapoint {
Expand Down

0 comments on commit 5c75969

Please sign in to comment.