Code Monkey home page Code Monkey logo

Comments (2)

msbarry avatar msbarry commented on May 18, 2024

I did some prototyping here, the rough approach was:

  • create a local sqlite DB with nodes, ways, relations tables and schema: id integer primary key, version integer, data blob where data is a binary encoding of the element info, metadata, and tags
  • find all OSM replication diffs required to bring a planet file up to date, and download/parse them in parallel, inserting into the appropriate table using version column to decide whether a diff should replace what's there or not (so we don't need to process change files in order)
  • then when iterating through the osm.pbf file, also iterate through the entries in the the each diff table (both ordered by ID) and apply any diff that exists for an element. When you reach the end of the osm.pbf entries, iterate through the remaining ones from the diff file since they are all new.

The sqlite db takes 1 minute to build and 1.5GB of storage per week of diffs (~2x the size of the compressed change files). It adds 1-2 minutes to each pass through the osm.pbf file - but incurs no memory overhead since it's just cursoring-through the sqlite result set while applying diffs.

It got a bit messy though since multiple threads read through the diffs without communicating so would be a good chunk of work to rewrite - I think the priority is pretty low given there's an existing workaround.

from planetiler.

msbarry avatar msbarry commented on May 18, 2024

Another use-case here would be applying daylight map distribution sidecars: https://daylightmap.org/

from planetiler.

Related Issues (20)

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.