Giter Site home page Giter Site logo

osmbpfextract's Introduction

osmbpfextract

osmbpfextract is a program to filter OpenStreetMap PBF format data files. The filter performs six passes on the input PBF filter, and then writes a new output PBF file. The six passes are:

  1. Find the OSMHeaders data block and ensure that we support reading this file.
  2. Find ways that match a given tag criteria (eg. leisure=golf_course), and extract their node references.
  3. Calculate bounding boxes for each way given the bounding boxes found in (2).
  4. Find all the nodes within the bounding boxes from (3).
  5. Find all the ways that reference nodes found in (4).
  6. Find all the nodes that are referenced by the ways found in (5).

The nodes and ways collected in passes (3), (4) and (5) are then output into a new PBF format data file.

osmbpfextract is written in _Go. It is highly concurrent, so you can expect it to use up all your CPU power. osmbpfextract can filter out 1MB of golf course areas from a 1GB PBF file in about 9 minutes, using 789% of a Core i7 processor.

Building

Building osmbpfextract is easy:

go install ./...

Examples

This app has been rebuilt from the original to just filter highways and output the result to nodes and ways files.

osmbpfextract -i alberta.osm.pbf

Command-Line Options

-i Input file
-o Output file
-t Filter tag key
-v Filter tag value
--high-memory Cache every decompressed block in memory. This can cause a 25% performance improvement in filtering, but is only recommended for small files. For a ~100MB PBF file, this will increase memory usage by about 100MB; for a 1GB PBF file, memory usage will jump to 8GB or more.

This code is a fork of https://github.com/mfenniak/go-osmpbf-filter with significant reworking.

osmbpfextract's People

Contributors

ewalk153 avatar tsandras avatar

Stargazers

 avatar

Watchers

 avatar  avatar

Forkers

h4ck3rm1k3

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.