Created
March 6, 2021 00:11
-
-
Save nickpeihl/691642c237ecd9456431fb66aa6435dc to your computer and use it in GitHub Desktop.
Grok expression for OpenStreetMap OPL format
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
OSMID [n|r|w][0-9]+ | |
NODES (%{OSMID},?)+ | |
MEMBERS (%{OSMID}@(\S+)?,?)+ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
%{OSMID:osmid}%{SPACE}v%{NUMBER:version}%{SPACE}d(?<deleted>[D|V])%{SPACE}c%{INT:changeset_id}(%{SPACE}t%{TIMESTAMP_ISO8601:@timestamp})?%{SPACE}i%{USERNAME:userid}%{SPACE}u(%{USERNAME:username})?%{SPACE}T(?<tags>[\S+=\S+]+)?(%{SPACE}x%{NUMBER:longitude})?(%{SPACE}y%{NUMBER:latitude})?(%{SPACE}N%{NODES:nodes})?(%{SPACE}M%{MEMBERS:members})? |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
osmium cat -o washington-latest.opl washington-latest.osm.pbf |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment