GTNewHorizons / GTNH-Web-Map

A 1.7.10 Dynmap fork with improved support for modded blocks and machines
Apache License 2.0
21 stars 1 forks source link

Feature: Time-lapse support #11

Open dvdmandt opened 4 months ago

dvdmandt commented 4 months ago

It would be interesting to be able to support history of a particular map/view, at least with timed "snapshots". This would probably be fairly easy to implement for SQL based storage. The idea is that the user would define a limited area, a particular zoom level and an interval.

On init, all tiles in the selected area are copied to a new time-lapse table. After each period, find all tiles in main map that either have no previous entry in the time-lapse table, or where the last updated timestamp is higher than the last seen tile in the time-lapse table and the hash code is different, and insert all such tiles into the time-lapse table with an increased snapshot-id or such.

It should be doable to write a query that does the copying "automatically" (let the DB do it for us), and I think it should be doable to make a query that returns a set of the latest tiles for a specific snapshot. Getting the latest version of a specific tile position for a certain snapshot would definitely be trivial, and perhaps what would be needed anyway depending on how the viewer is implemented.