Skip to content

Commit

Permalink
tweaked simplification
Browse files Browse the repository at this point in the history
  • Loading branch information
derGraph committed Sep 1, 2024
1 parent 74e60fd commit a7c8fe1
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 1 deletion.
2 changes: 1 addition & 1 deletion src/lib/server/simplifyGps.ts
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ export async function simplifyGps(trip: string, amount: number){



if(crosstrackError < 10 && Math.abs(turnRate) < 40){
if(crosstrackError < 10 && Math.abs(turnRate) < 30){
// Delete Datapoint
await prisma.datapoint.update({
where: {id: inputData[i].id},
Expand Down
1 change: 1 addition & 0 deletions src/routes/api/Datapoints/+server.ts
Original file line number Diff line number Diff line change
Expand Up @@ -366,6 +366,7 @@ export async function GET(event) {
datapoints.forEach((datapoint) => {
responseData[datapoint.id] = { ...datapoint, id: undefined };
});
simplifyGps(requestedTrip, 500);
return new Response(JSON.stringify(responseData));
} catch (error_message) {
if (error_message instanceof Error) {
Expand Down

0 comments on commit a7c8fe1

Please sign in to comment.