Changed distance ending distance to be larger due to gps inconsistencies

main
Fan-Wu Yang 7 years ago
parent d7f2051512
commit fe892f7d20

@ -48,7 +48,7 @@ module.exports = {
let lastPoint = points[points.length - 1];
let distance = mathFunc.gpsToMeters(firstPoint.lat, firstPoint.lng, lastPoint.lat, lastPoint.lng);
console.log(distance);
if (distance < 10) {
if (distance < 20) {
if (lastPoint.lat != firstPoint.lat && lastPoint.lng != firstPoint.lng) {
// points.pop();
points.push({lat: firstPoint.lat, lng: lastPoint.lng});

@ -25,7 +25,8 @@ module.exports = {
return polygons
},
submitFinalCollation(res, gameID, userID, points, area, mergedPolygonIDs) {
query = util.format("CALL insertPolygon(\"%s\", \"%s\", %d)", gameID, userID, area);
let query = util.format("CALL insertPolygon(\"%s\", \"%s\", %d)", gameID, userID, area);
console.log(query);
db.get().query(query, function(err, rows) {
if (err) {
console.log(err);
@ -85,6 +86,7 @@ module.exports = {
let polygonResult = [];
let polygonsMerged = [];
polygons.map((polygon) => {
console.log(polygon);
if (polygon[0].lat != polygon[polygon.length - 1].lat &&
polygon[0].lng != polygon[polygon.length - 1].lng) {
polygon.push({lat: polygon[0].lat, lng: polygon[0].lng})

Loading…
Cancel
Save