3

I have a large geometry (MultiPolygon) for a (fictional) world map. It basically spans a large portion of the entire world: it's the difference between a buffered extension of the union of the entire world geometry and that union itself. In other words, a coastal buffer.

The geometry is in a PostGIS table (as one record). I serve this using GeoServer over WMS. Does it make sense to (automatically) split this giant geometry up into smaller ones, or is that completely unnecessary because PostGIS and/or GeoServer use the appropriate (sufficiently fast) intersection queries?

I'm not having a performance problem with this (yet) but the question is nagging at me.

1 Answer 1

3

It would be better to partition it. While GeoServer clips the geometry before painting it, it reads it all from the database. Of course this trick works only if you don't paint the border of the polygons, if you need to do that you need to create two layers, one with the partitioned polygons, and one with the partitioned borders, paint the first with a polygon symbolizer and the second with a line symbolizer (otherwise you'll see the cut lines be drawn).

2
  • A response from Andrea himself, neat :-) The border issue makes sense. Luckily I only need to fill it, not draw its contour. Do you happen to know if PostGIS has built-in functions that can make this kind of partitioning easy? Doesn't need to be very efficient since this is a preprocessing step. Commented Aug 27, 2012 at 19:18
  • 1
    It seems Stackexchange has the answer: gis.stackexchange.com/questions/16374/… (then you have to do the intersection, which is another sql query) Commented Aug 28, 2012 at 6:14

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.