1

I am wondering if large geometry (geometry with large vertex count) in PostGIS might cause performance issues for GeoServer (or other product) in serving the WMS (not WFS)?

This question also ask about effect of large vertex count but more in PostGIS process.

Many thanks in advance.

1
  • 1
    Yes it does. If you have lot of vertices, the mapping engine has to read them all and draw them. this takes CPU cycles, and hence takes more time, when compared to simpler features with fewer vertices. Commented Aug 5, 2014 at 4:27

1 Answer 1

1

Sure, it takes time to process all those vertices and render them down to the raster. And if you have enough vertices, they probably don't add any information to the picture at all. Like, if you have a river with 1000 vertices and map it into a 1000x1000 image, you might get one vertex per pixel, but probably you'll end up with lots of pixels with more than one vertex in them: a waste of vertices. And any vertices that formed a straight line when snapped into the image pixel grid would also be wasted: you can draw straight lines using just the end points.

Another bad thing that can happen with features that have lots of vertices is that, once you zoom in close enough that the vertices are drawing at a useful scale relative to your image, most of the feature is "off screen". So you have to retrieve the whole thing, just to draw a small portion of it. Think about retrieving all of Lake Michigan just to draw the Chicago shoreline.

And big objects can take a lot of network space! A 1K vertex object will have 16K bytes (plu s a bit of header space), and in hex will take up 32K. A 1M vertex object will take up 32 Megabytes! That's a fair amount of network bandwidth.

How big should objects be? Just big enough, and no bigger :)

4
  • re: " A 1M vertex object will take up 32 Megabytes" - since the question is for WMS (and hence the server is delivering an image), wouldn't the size of the image be the same, regardless of the complexity of the underlying data? Commented Aug 5, 2014 at 23:08
  • @Stephen Lead Yes the server is delivering images in WMS protocol, and yes, WMS image size stays the same regardless of the geometry complexity. But I was guessing that geometry with larger vertex count takes more computing power for rendering WMS images. Hence the performance issue lies in the effort of image rendering, not than in the effort for sending the image to the client. Now it is answered that large vertex count does cause performance.
    – Rino
    Commented Aug 6, 2014 at 8:53
  • @Rino cool, that's what I figured. Hence my questioning about the network bandwidth. I don't believe that will vary for a more complex object, but the processing speed will vary. Commented Aug 6, 2014 at 12:06
  • 1
    @StephenLead, right the output image will be the same size regardless. I let my database-guy self get out in front: in order to get the feature from the database to the renderer, it usually also has to traverse a network link. There's an overhead to that too, particularly as objects get big. There's also an overhead to just ripping that much data up off the disk into memory. Commented Aug 6, 2014 at 14:36

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.