From 3ed46aa4c547fd3acb401268c32836e5d9075796 Mon Sep 17 00:00:00 2001 From: Lauren Budorick Date: Mon, 28 Mar 2016 11:15:13 -0700 Subject: [PATCH] ensure all nodes are written as decimals --- features/support/build_osm.js | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/features/support/build_osm.js b/features/support/build_osm.js index 7b203d308..bac21d189 100644 --- a/features/support/build_osm.js +++ b/features/support/build_osm.js @@ -2,6 +2,11 @@ var builder = require('xmlbuilder'); +var ensureDecimal = (i) => { + if (parseInt(i) === i) return i.toFixed(1); + else return i; +}; + class DB { constructor () { this.nodes = new Array(); @@ -104,8 +109,8 @@ class Node { this.OSM_USER = OSM_USER; this.OSM_TIMESTAMP = OSM_TIMESTAMP; this.OSM_UID = OSM_UID; - this.lon = lon; - this.lat = lat; + this.lon = ensureDecimal(lon); + this.lat = ensureDecimal(lat); this.tags = tags; }