Hello! I want to filter some administrative boundaries out. It works fine when city/village name consist of one word. But if there is a whitespace in the name it goes like this:

$ ./osmfilter -v --keep='name="Новые Ляды"' perm.osm
osmfilter Parameter: --keep=name="Новые Ляды"
osmfilter: Filter: keep nodes:
osmfilter: Filter:     "name" = ""Новые"
osmfilter: Filter:     "Ляды"" = "(anything)"
osmfilter: Filter: keep ways:
osmfilter: Filter:     "name" = ""Новые"
osmfilter: Filter:     "Ляды"" = "(anything)"
osmfilter: Filter: keep relations:
osmfilter: Filter:     "name" = ""Новые"
osmfilter: Filter:     "Ляды"" = "(anything)"
osmfilter Parameter: perm.osm
Interrelational hierarchy 1: 0 dependencies.
osmfilter: Relation hierarchies: 0 of maximal 12.
osmfilter: Number of bytes read: 56401798
(3 lines of OSM XML)
osmfilter: Last processed: relation 3496144

It fails to filter tag values with whitespaces. So the question is — is it a feature, a bug or there is a way to insert whitespace in query?

asked 13 Feb '14, 07:07

alsv's gravatar image

alsv
31113
accept rate: 0%


I've Read The F-ing Source and found an answer:

The space should be escaped with backslash!

$ ./osmfilter -v --keep="name=Новые\ Ляды or place_name=Новые\ Ляды" perm.osm 
osmfilter Parameter: --keep=name=Новые\ Ляды or place_name=Новые\ Ляды
osmfilter: Filter: keep nodes:
osmfilter: Filter:     "name" = "Новые Ляды"
osmfilter: Filter:   OR
osmfilter: Filter:     "place_name" = "Новые Ляды"
osmfilter: Filter: keep ways:
osmfilter: Filter:     "name" = "Новые Ляды"
osmfilter: Filter:   OR
osmfilter: Filter:     "place_name" = "Новые Ляды"
osmfilter: Filter: keep relations:
osmfilter: Filter:     "name" = "Новые Ляды"
osmfilter: Filter:   OR
osmfilter: Filter:     "place_name" = "Новые Ляды"
osmfilter Parameter: perm.osm
permanent link

answered 18 Feb '14, 06:28

alsv's gravatar image

alsv
31113
accept rate: 0%

Your answer
toggle preview

Follow this question

By Email:

Once you sign in you will be able to subscribe for any updates here

By RSS:

Answers

Answers and Comments

Markdown Basics

  • *italic* or _italic_
  • **bold** or __bold__
  • link:[text](http://url.com/ "title")
  • image?![alt text](/path/img.jpg "title")
  • numbered list: 1. Foo 2. Bar
  • to add a line break simply add two spaces to where you would like the new line to be.
  • basic HTML tags are also supported

Question tags:

×147
×42

question asked: 13 Feb '14, 07:07

question was seen: 2,446 times

last updated: 26 Feb '14, 23:15

powered by OSQA