Skip to content

Commit

Permalink
Small translation fixes (#4454)
Browse files Browse the repository at this point in the history
* Fix for badly formed "other_tags" tag

refs: #4430

* Schema fix

refs: #4430

* Updated copyright header

refs: #4430
  • Loading branch information
mattjdnv authored Jan 15, 2021
1 parent 2c07b2e commit 0ec04c1
Show file tree
Hide file tree
Showing 10 changed files with 28 additions and 7 deletions.
1 change: 1 addition & 0 deletions conf/schema/military.json
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,7 @@
"description": "FCODE: SU001 - An installation designed for military use. For example, used to perform military operations, initiate forward movements, and/or furnish supplies. Often protected by fortifications or natural advantages.",
"isA": "military",
"name": "military=installation",
"geometries": ["node", "area"],
"objectType": "tag",
"similarTo": {
"name": "landuse=installation",
Expand Down
Binary file modified conf/translations/TDSv70_Features.csv.gz
100755 → 100644
Binary file not shown.
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@
* This will properly maintain the copyright information. DigitalGlobe
* copyrights will be updated automatically.
*
* @copyright Copyright (C) 2015, 2016, 2017, 2018, 2019, 2020 DigitalGlobe (http://www.digitalglobe.com/)
* @copyright Copyright (C) 2015, 2016, 2017, 2018, 2019, 2020, 2021 DigitalGlobe (http://www.digitalglobe.com/)
*/

// Python redefines these two macros from /usr/include/features.h
Expand Down
20 changes: 20 additions & 0 deletions translations/dnc_core.js
Original file line number Diff line number Diff line change
Expand Up @@ -706,6 +706,26 @@ dnc = {
if (tags['error:circular']) delete tags['error:circular'];
if (tags['hoot:status']) delete tags['hoot:status'];

// If we use ogr2osm, the GDAL driver jams any tag it doesn't know about into an "other_tags" tag.
// We need to unpack this before we can do anything.
// Adding this because we might not be reading from OSM
if (tags.other_tags)
{
var tList = tags.other_tags.toString().replace(/\\/g,'').replace(/\"/g,'"').split('","');

delete tags.other_tags;

for (var val in tList)
{
vList = tList[val].split('"=>"');

tags[vList[0].replace('"','')] = vList[1].replace('"','');

// Debug
// print('val: ' + tList[val] + ' vList[0] = ' + vList[0] + ' vList[1] = ' + vList[1]);
}
}

// Initial cleanup
for (var i in tags)
{
Expand Down
2 changes: 1 addition & 1 deletion translations/ggdm30.js
Original file line number Diff line number Diff line change
Expand Up @@ -1142,7 +1142,7 @@ ggdm30 = {
// Adding this because we might not be reading from OSM
if (tags.other_tags)
{
var tList = tags.other_tags.split('","');
var tList = tags.other_tags.toString().replace(/\\/g,'').replace(/\"/g,'"').split('","');

delete tags.other_tags;

Expand Down
2 changes: 1 addition & 1 deletion translations/mgcp.js
Original file line number Diff line number Diff line change
Expand Up @@ -976,7 +976,7 @@ mgcp = {
// Adding this because we might not be reading from OSM
if (tags.other_tags)
{
var tList = tags.other_tags.split('","');
var tList = tags.other_tags.toString().replace(/\\/g,'').replace(/\"/g,'"').split('","');

delete tags.other_tags;

Expand Down
2 changes: 1 addition & 1 deletion translations/tds40.js
Original file line number Diff line number Diff line change
Expand Up @@ -1218,7 +1218,7 @@ tds40 = {
// Adding this because we might not be reading from OSM
if (tags.other_tags)
{
var tList = tags.other_tags.split('","');
var tList = tags.other_tags.toString().replace(/\\/g,'').replace(/\"/g,'"').split('","');

delete tags.other_tags;

Expand Down
2 changes: 1 addition & 1 deletion translations/tds61.js
Original file line number Diff line number Diff line change
Expand Up @@ -1211,7 +1211,7 @@ tds61 = {
// Adding this because we might not be reading from OSM
if (tags.other_tags)
{
var tList = tags.other_tags.split('","');
var tList = tags.other_tags.toString().replace(/\\/g,'').replace(/\"/g,'"').split('","');

delete tags.other_tags;

Expand Down
2 changes: 1 addition & 1 deletion translations/tds70.js
Original file line number Diff line number Diff line change
Expand Up @@ -1153,7 +1153,7 @@ tds70 = {
// Adding this because we might not be reading from OSM
if (tags.other_tags)
{
var tList = tags.other_tags.split('","');
var tList = tags.other_tags.toString().replace(/\\/g,'').replace(/\"/g,'"').split('","');

delete tags.other_tags;

Expand Down
2 changes: 1 addition & 1 deletion translations/translate.js
Original file line number Diff line number Diff line change
Expand Up @@ -1499,7 +1499,7 @@ translate = {
// We need to unpack this before we can do anything.
if (attrs.other_tags)
{
var tList = attrs.other_tags.split('","');
var tList = tags.other_tags.toString().replace(/\\/g,'').replace(/\"/g,'"').split('","');

delete attrs.other_tags;

Expand Down

0 comments on commit 0ec04c1

Please sign in to comment.