https://github.com/osmcode/osmium-filter
Fast filter for OSM data
https://github.com/osmcode/osmium-filter
openstreetmap
Last synced: 18 days ago
JSON representation
Fast filter for OSM data
- Host: GitHub
- URL: https://github.com/osmcode/osmium-filter
- Owner: osmcode
- Created: 2016-09-22T09:26:18.000Z (over 8 years ago)
- Default Branch: master
- Last Pushed: 2021-11-22T11:05:29.000Z (over 3 years ago)
- Last Synced: 2025-04-17T14:39:13.750Z (23 days ago)
- Topics: openstreetmap
- Language: C++
- Size: 311 KB
- Stars: 11
- Watchers: 6
- Forks: 3
- Open Issues: 1
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# Osmium Filter
Work-in-progress experimental fast and flexible filter for OSM data.
Do not use this for production work. The expression language (see below) will change!
## Dependencies
* [libosmium](https://github.com/osmcode/libosmium)
## Building
Then in the osmium-filter directory:
mkdir build
cd build
cmake ..
makeThe `osmium-filter` binary is created in the `src` directory.
## Run
Usage:
osmium-filter INPUT-FILE -o OUTPUT-FILE -e FILTER-EXPRESSION
or
osmium-filter INPUT-FILE -o OUTPUT-FILE -E FILTER-EXPRESSION-FILE
Will filter out only the OSM objects matching the expressions. Call with `-w`
to add all nodes referenced by any matching ways. (This will read the input
twice.)Call with `--help` to get usage info.
## Expression Language
No real documentation yet, but this will give you some ideas:
A or B
A and B
not Ahighway Tag key exists
"highway" Tag key exists
highway = residential
@id= Compare object ID
@id!=
@id<
@id>
@id<=
@id>=@version Same for version
...@uid User ID
@changeset Changeset ID
@nodes Number of nodes
@members Number of members
@tags Number of tags
123 ID (same as @id=)
@type=node
node@type=way
way@type=relation
relation