1

I have a GeoServer with integrated GeoWebCache. Data is stored on a PostGIS database. I'm looking to have pre-seeded layers, but since my data is going to change several times per day, I'm looking to avoid truncating and then re-seeding the layers from scratch. Data is changed through several other applications, mainly QGIS (directly operating on the PostGIS database).

So, from my research, this can be done by specifying a GeoRSS feed on the GeoWebCache configuration. This looks for an updated field on each RSS entry, in order to know which tiles to update.

Unfortunately, the native Geoserver RSS implementation doesn't have such a field, so I'm going to have to build one from scratch. This is fine, I doubt Geoserver would know of the changes either way, since the data is modified directly on the database.

So, the proposed solution:

  • Add a timestamp updated field on each db layer.
  • Add triggers to update that field on insert/update.
  • Poll the database and generate a GeoRSS feed periodically.
  • Link that feed in the GeoWebCache configuration.

My questions are:

  1. How to handle deleted features? Track deletions in a separate table, and link those to the GeoRSS feed with a null geometry?
  2. Is this the only/best way I can accomplish what I'm looking for or am I missing something?
1

1 Answer 1

2

What I found after further research:

Regarding #1: The GeoRSS feed must have the full geometry of the deleted entries (and not null), because the source code is looking for it in order to generate the needed tile-extents.

Regarding #2: The GeoRSS route is overkill and not really needed. Since I'll be adding triggers to the database anyway, a faster option is to use GeoWebCache's REST api to reseed just the extents that changed.

So to recap:

  • Add a mechanism to do API queries based on database triggers. (For example this, or this)
  • Add triggers to the related db tables.
  • Call the GeoWebCache Seed API endpoint, everytime a geometry is inserted/modified/deleted with that geometry's extents.

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