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.

  • How often would tiles be requested? Pregenerating and caching tiles is helpful only if the tiles are actually used. – CL. May 15 at 11:48
  • The tiles would be requested every time the map is loaded. It's the main feature of the map. – Jax May 15 at 17:35
  • And how often is the map loaded? Every 5 minutes? Are there multiple users? – CL. May 15 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 Aug 19 at 12:30

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.