Skip to content

v0.2.54..v0.2.55 changeset geonames_core.js

Garret Voltz edited this page Aug 14, 2020 · 1 revision
diff --git a/translations/geonames_core.js b/translations/geonames_core.js
index 7925852..46904a5 100644
--- a/translations/geonames_core.js
+++ b/translations/geonames_core.js
@@ -36,69 +36,69 @@
 
 geonames = {
 
-    // Process the Alt Names
-    // In the spec, these are "varchar(8000)". We are just passing them through but we could
-    // split them if needed.
-    processAltName : function (nameIn)
+  // Process the Alt Names
+  // In the spec, these are "varchar(8000)". We are just passing them through but we could
+  // split them if needed.
+  processAltName : function (nameIn)
+  {
+    var nameOut = '';
+
+    if (nameIn !== '')
     {
-        var nameOut = '';
+      nameOut = nameIn.split(',').join(';');
+    }
 
-        if (nameIn !== '')
-        {
-            nameOut = nameIn.split(',').join(';');
-        }
+    return nameOut;
+  },
 
-        return nameOut;
-    },
 
+  // toOsm - Translate Attrs to Tags
+  // This is the main routine to convert TO OSM
+  toOsm : function(attrs, layerName, geometryType)
+  {
+    tags = {};  // The final output Tag list
 
-    // toOsm - Translate Attrs to Tags
-    // This is the main routine to convert TO OSM
-    toOsm : function(attrs, layerName, geometryType)
-    {
-        tags = {};  // The final output Tag list
-
-        if (config.getOgrDebugDumptags() == 'true') for (var i in attrs) print('In Attrs:' + i + ': :' + attrs[i] + ':');
+    if (config.getOgrDebugDumptags() == 'true') for (var i in attrs) print('In Attrs:' + i + ': :' + attrs[i] + ':');
 
-        // Names
-        tags.name = attrs.name;
-        if (attrs.alternatenames) tags.alt_name = geonames.processAltName(attrs.alternatenames);
+    // Names
+    tags.name = attrs.name;
+    if (attrs.alternatenames) tags.alt_name = geonames.processAltName(attrs.alternatenames);
 
-        // Populations
-        // var pop = Number(attrs.population);
-        // if (pop > 0) tags.population = pop;
-        if (Number(attrs.population) > 0) tags.population = attrs.population;
+    // Populations
+    // var pop = Number(attrs.population);
+    // if (pop > 0) tags.population = pop;
+    if (Number(attrs.population) > 0) tags.population = attrs.population;
 
-        // Elevations
-        if (attrs.elevation && attrs.elevation !== '-9999')
-        {
-            tags.ele = attrs.elevation;
-        }
-        else if (attrs.dem && attrs.dem !== '-9999')
-        {
-            tags.ele = attrs.dem;
-        }
+    // Elevations
+    if (attrs.elevation && attrs.elevation !== '-9999')
+    {
+      tags.ele = attrs.elevation;
+    }
+    else if (attrs.dem && attrs.dem !== '-9999')
+    {
+      tags.ele = attrs.dem;
+    }
 
-        // Where are we?
-        if (attrs.country_code) tags['is_in:country_code'] = attrs.country_code;
+    // Where are we?
+    if (attrs.country_code) tags['is_in:country_code'] = attrs.country_code;
 
-        // Feature Code
-        if (geonames.rules.one2one[attrs.feature_code])
-        {
-            for (i in geonames.rules.one2one[attrs.feature_code]) tags[i] = geonames.rules.one2one[attrs.feature_code][i];
+    // Feature Code
+    if (geonames.rules.one2one[attrs.feature_code])
+    {
+      for (i in geonames.rules.one2one[attrs.feature_code]) tags[i] = geonames.rules.one2one[attrs.feature_code][i];
 
-            // If it's just a POI, add "poi=yes"
-            if (tags['poi:type']) tags.poi = 'yes';
-        }
+      // If it's just a POI, add "poi=yes"
+      if (tags['poi:type']) tags.poi = 'yes';
+    }
 
-        // Metadata
-        tags.source = 'geonames';
-        // tags.uuid = attrs.geonameid;
-        tags.uuid = "GeoNames.org:" + attrs['geonameid'];
+    // Metadata
+    tags.source = 'geonames';
+    // tags.uuid = attrs.geonameid;
+    tags.uuid = 'GeoNames.org:' + attrs['geonameid'];
 
-        if (config.getOgrDebugDumptags() == 'true') for (var i in tags) print('Out Tags: ' + i + ': :' + tags[i] + ':');
+    if (config.getOgrDebugDumptags() == 'true') for (var i in tags) print('Out Tags: ' + i + ': :' + tags[i] + ':');
 
-        return tags;
-    }, // End of toOsm
+    return tags;
+  }, // End of toOsm
 
-} // End of geonames
+}; // End of geonames
Clone this wiki locally