0

I'm working on a project where I process national radar data and generate a GeoJSON with the data. The data is generated every 5 minutes and I delete the oldest data before I add the latest data. I'm currently trying to decide the best way to go about serving vector tiles from this data. My current two solutions are:

  1. Every 5 minutes I generate a new GeoJSON for the most current data, then using PostGIS I delete the oldest data from the table and then I insert the newest data. Once generated I serve tiles using a tool called Martin.

  2. Every 5 minutes, I delete the oldest data from a GeoJSON stored in the file system, then I add the newest data to it. Then I use Tippecanoe to generate a .mbtiles file from the stored GeoJSON and serve the vector tiles using that.

From my research, I've found information for generating tiles on the fly and serving static tiles. But I don't need either. Right now, using PostGIS seems like the best option but it feels like overkill to generate the tiles every time they're requested. There isn't too much information out there for this scenario and I'm wondering if anyone could offer some insight into what might be the most optimal way to handle this.

4
  • How often would tiles be requested? Pregenerating and caching tiles is helpful only if the tiles are actually used.
    – CL.
    Commented May 15, 2020 at 11:48
  • The tiles would be requested every time the map is loaded. It's the main feature of the map.
    – Jax
    Commented May 15, 2020 at 17:35
  • And how often is the map loaded? Every 5 minutes? Are there multiple users?
    – CL.
    Commented May 15, 2020 at 18:34
  • You didn't mention how large the geojson data is. If the data is of a reasonable size, meaning it could be loaded fairly quickly into memory in Node or other language, you could use a vector tile server the reads the geojson directly, and saves the tiles and/or geojson in a memory cache for X minutes. The Koop server from Esri works like this. You will likely need to manually adjust the cache settings for both the geojson file and the vector tile data if using the Koop server.
    – Malcolm
    Commented Aug 19, 2020 at 12:30

1 Answer 1

4

I use pg_tileserver to serve tiles directly from the database it is very performant when you use dots/points in my experience. Now with the mvt_postgis extension which creates vector tiles directly in the database this is very performant. So if you do not have a complicated multi-layer output for the real-time data you can just use 'pg_tileserver' .

You can add a cache settings and maybe a simple cache server that keeps tiles for a few minutes.

Only the tiles the user is currently looking at will be fetched.

https://github.com/CrunchyData/pg_tileserv

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.