Changed distance ending distance to be larger due to gps inconsistencies
This commit is contained in:
+1
-1
@@ -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})
|
||||
|
||||
Reference in New Issue
Block a user