Skip to content

tags-filter not working as expected when using asterisk #289

@JitGub

Description

@JitGub

osmium --version
osmium version 1.16.0
libosmium version 2.20.0
Supported PBF compression types: none zlib lz4

Ubuntu 24.04.2 LTS

tags-filter not working as expected when using asterisk

When using asterisk (“*”) the result is not always as expected.

A) When there is an asterisk in front of the search string, I only expect to find strings that end with the search string.
Does not work as expected.

B) When there is an asterisk behind the search string, I only expect to find strings that start with the search string.
Works as expected.

C) When there is an asterisk both in front and behind the search text, I only expect to find strings that contains the search string.
Works as expected.

Is this a bug or a missing feature?

Examples:

A1) Works as expected. Finds nothing.
osmium tags-filter dummy.osm --output-format=osm /name=*w --verbose &> A1.log

A2) Does not work as expected. Finds too many. Expected instead only string that end with y.
osmium tags-filter dummy.osm --output-format=osm /name=*y --verbose &> A2.log

A3) Does not work as expected. Finds too many. Expected instead only string that end with y2.
osmium tags-filter dummy.osm --output-format=osm /name=*y2 --verbose &> A3.log

A4) Works as expected. Only finds one.
osmium tags-filter dummy.osm --output-format=osm /name=*y3 --verbose &> A4.log

A5) Does not work as expected. Finds too many.
osmium tags-filter dummy.osm --output-format=osm /name=*u --verbose &> A5.log

B1) Works as expected. Finds nothing.
osmium tags-filter dummy.osm --output-format=osm /name=w* --verbose &> B1.log

B2) Works as expected. Finds strings that start with d.
osmium tags-filter dummy.osm --output-format=osm /name=d* --verbose &> B2.log

B3) Works as expected. Finds strings that start with 4.
osmium tags-filter dummy.osm --output-format=osm /name=4* --verbose &> B3.log

B4) Works as expected. Finds nothing.
osmium tags-filter dummy.osm --output-format=osm /name=u* --verbose &> B4.log

C1) Works as expected. Finds nothing.
osmium tags-filter dummy.osm --output-format=osm /name=w --verbose &> C1.log

C2) Works as expected. Find strings that contains u.
osmium tags-filter dummy.osm --output-format=osm /name=u --verbose &> C2.log

dummy.osm contains:
<?xml version='1.0' encoding='UTF-8'?> <osm version='0.6' generator='JOSM'> <node id='-25409' action='modify' visible='true' lat='55.73489716906' lon='9.13294583425'> <tag k='name' v='dummy' /> </node> <node id='-25410' action='modify' visible='true' lat='55.73474162384' lon='9.13318455085'> <tag k='name' v='dummy,dummy2' /> </node> <node id='-25411' action='modify' visible='true' lat='55.73483430867' lon='9.13305446472'> <tag k='name' v='dummy,dummy2,dummy3' /> </node> <node id='-25412' action='modify' visible='true' lat='55.73479372363' lon='9.13312956624'> <tag k='name' v='4dy' /> </node> </osm>

dummy.pdf

A1.log
A2.log
A3.log
A4.log
A5.log
B1.log
B2.log
B3.log
B4.log
C1.log
C2.log

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions