diff --git a/schema.js b/schema.js index fe09750e..af173f25 100644 --- a/schema.js +++ b/schema.js @@ -18,6 +18,7 @@ module.exports = Joi.object().keys({ filename: Joi.string(), importVenues: Joi.boolean().default(true).truthy('yes').falsy('no').insensitive(true) }).requiredKeys('filename').unknown(true)), + tags: Joi.array().items(Joi.string()), download: Joi.array().items(Joi.object().keys({ sourceURL: Joi.string() }).requiredKeys('sourceURL').unknown(true)), diff --git a/stream/pbf.js b/stream/pbf.js index f5ec2a87..da4e4170 100644 --- a/stream/pbf.js +++ b/stream/pbf.js @@ -46,10 +46,16 @@ function config(opts){ if(!opts.tags){ // check if we import venues opts.importVenues = settings.imports.openstreetmap.import[0].importVenues; - if(opts.importVenues){ - opts.tags = features.tags.concat(features.venue_tags); + + // check if there is user's tags + if(settings.imports.openstreetmap.tags) { + opts.tags = settings.imports.openstreetmap.tags; } else { - opts.tags = features.tags; + if(opts.importVenues){ + opts.tags = features.tags.concat(features.venue_tags); + } else { + opts.tags = features.tags; + } } } return opts;