2

I have a spatial table in PostGIS that gets written (Insert/Update/Delete) by a production web app. Almost every minute there's write to the table. The app shows the geometry of the table on web client via database query in the form of 'untiled clear-text-geojson'. The BBOX extent depends on the current client's bbox.

This way of delivering geojson to client now proves to be not efficient as the geojson gets bigger as the points count grow. I would like to try different way. One of them is with Geoserver Vector Tile. I was thinking that with binary data and tile, the required data sent to client potentially becomes smaller.

So I published the table as geoserver layer and activated the 'application/x-protobuf;type=mapbox-vector' under the Tile Caching tab of the layer.

With OpenLayers 5.1.3 I could visualize the geometry from the table, based on this article.

Next I ran a small test with QGIS adding 2 rows (with points geometry) directly to the table. The aim is to get to know whether the points got rendered to the vector tile.

Here's the step (some with corresponding picture):

  1. Open the OL map page in browser. Zoom-in upto zoom level 18, and stop. I intentionally stop zooming down to this zoom level. The map shows the existing points in the table within the map extent.(pict 1)

  2. Add 1 point (point 'A') with QGIS into the PostGIS table.

  3. Panning left and right on the map does not change the VT to show point A.
  4. Zooming-in exactly 1 level upto Zoom level 19, and stop. Again, I intentionally stop zooming down to this zoom level. Now point A is shown.enter image description here

  5. Add 1 more point (point 'B') with QGIS into the PostGIS table.

  6. Panning left and right on the map does not change the VT to show point B (similar to step 3).
  7. Zooming-in exactly 1 level upto Zoom level 20, and stop. Now point B and A are shown.(pict 3)
  8. Zooming-out exactly 1 level to Zoom level 19. The tile shows only point A and not B.(pict 4)
  9. Zooming-out exactly 1 level to Zoom level 18. The tile shows none of point A and B!.(pict 5).

  10. Last step: a double check with another browser on another client machine shows exactly similar symptoms:

    • Zoom level 20 shows point A and B
    • Zoom level 19 shows only point A
    • Zoom level 18 shows none of point A & B.

Now to the question:

  1. How to make Geoserver render these added points to the tile that have been generated (and shown) before?

  2. Is the above symptoms are normal with Geoserver Vector Tile?

  3. Is Geoserver Vector Tile appropriate for the above use case (showing points in a table that gets written dynamically)?

  • 2
    your entire use case seems to indicate that you do not want a cached layer, try using uncached png tiles instead – Ian Turton Aug 13 '18 at 12:16
  • 1
    If the vector tile is already in the cache it will not be re-created when you edit the data. Delete all tiles from the cache directory and from the memory of the browser if you want to know what GeoServer is doing. – user30184 Aug 13 '18 at 15:19
  • @ian, i suspected that too am afraid. So is there any spatial data serving protocol that suits the following? (1) vector, not image; (2) preferably in binary like MVT instead of clear-text; (3) tiled; and (4) not cached. – Rino Aug 14 '18 at 1:33
  • @user30184, I confirm that: the tile already in the cache it will not be re-created when there's edit in the data. I deleted browser cache and tile cache in server. As a result: now point A and B are shown in all zoom level (this means that both new points are rendered in all tile). – Rino Aug 14 '18 at 6:22
  • Tile expiration policy is documented and the default is "never", see geowebcache.org/docs/1.12.2/configuration/layers/…. I somehow feel your question or at least the title as it stands now irrelevant. – user30184 Aug 14 '18 at 8:19

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.