0

I have a multi polygon layer with 25 features, each containing millions of vertices, holes, etc. It is a statewide floodplain. Right now, it takes forever to draw even when zoomed in, plus the processing time when doing processes like intersection etc is extremely high as well.

I have tried storing layers in GPKG and shapefile to speed up performance but have not succeeded. I am looking for a clean way to handle layers like these.

I have tried reducing the number of vertices with Simplify Tool and that improved the performance somewhat but at the cost of altering the layer.

I am looking for a clean way to handle these kinds of enormous layers.

11
  • have you tried to rasterize the layer? does that make sense for you or is there a reason the layer has to be a polygon layer?
    – sn1ks
    Commented Jul 15, 2021 at 13:48
  • 2
    Copy the existing borders to polyline, overlay both with a coarse fishnet and then render the polygons without borders, with the polylines on top.
    – Vince
    Commented Jul 15, 2021 at 13:59
  • 1
    In ArcGIS it's called Intersect. See this Dicing Godzillas blog entry -- this is data-centric not software specific.
    – Vince
    Commented Jul 15, 2021 at 14:07
  • 1
    The best way to handle a layer this large would be to put it in a spatially enabled RDBMS like PostGIS/Postgres. You don't have to ask for all the points, just the ones you need. But also what is your audience? Is it just a graphic for print that is statewide; just duplicate the layer and simplify. Do you need only a county; just clip/filter. If you are doing scientific/engineering and need the fidelity, you might just have to accept the speed with your current setup.
    – RomaH
    Commented Jul 15, 2021 at 14:55
  • 3
    In PostGIS, one would subdivide the polygons to lots of smaller ones (similar to what @Vince is suggesting), then have a spatial index on the small polygons. Doing so makes the indexes (which is just a bounding box comparison) efficient, and you just have to retrieve, display and perform computations on very simple polygons. Have a look at this article
    – JGH
    Commented Jul 15, 2021 at 14:58

1 Answer 1

1

This isn't a GIS application-specific problem, so I'm going to give a generic answer to the problem of performant rendering of very-large/complex datasets.

The issue here is the number of vertices in the features, combined with the extent of the features (with respect to overall dataset extent). Rendering algorithms are getting pretty good with most clipping situations, but million+ vertex "Godzilla" polygons1 are pretty much a worst case scenario.

The solution is to reduce the vertex count (and extent) per feature by:

  1. Making a copy the original polygon layer ("source_orig") as component polylines ("source_borders")
  2. Generating a coarse fishnet polygon layer (with an extent a little larger than the dataset, and with somewhere between 100 and 200 cells)
  3. Intersecting the grid with both flavors of source data (producing "gridded_source" and "gridded_borders")
  4. Dissolving the "gridded_borders" layer on fishnet-id to "optimized_borders"
  5. Removing "source_orig" from your map, and adding both "gridded_source" and "optimized_borders" to the map, with boundaries for "gridded_source" not symbolized, and "optimized_borders" above "gridded_source" in the draw order.

A similar approach can be used with millions of points (or lines), overlying a grid, and dissolving to multi-part points (or lines) on fishnet-id and whatever attribute on which you want to symbolize, to generate draw-optimized datasets.

You can also use the dicing approach to optimize point-in-polygon performance, as noted in this blog entry, which evaluates the impact of grid size on Identify operations with complex country polygons.

Note that this does not and cannot address situations where you really need the the full feature to perform an operation, though if your generalization algorithm is smart enough to consider both sides of the polygon boundary (a la Esri's Simplify Polygon (Cartography)), you might be able to do some generalization before dissolving back into "source_generalized".


1The link to the original "Dicing Godzillas" blog page seems to have died, but this replacement addresses the issue from an ArcGIS Desktop perspective.

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.