Union geometries faster in JTS?

Viewed 2259

I wrote code to join (union) geometries. I wrapped it into Java8 streams Collector. Inside it it just uses Geometry#union to union geometries:

geometries[0] = geometries[0].union(geometry);

Unfortunately, it works rather slow.

Is it possible to make it faster with some usage of prepared geometry or some other hacks?

UPDATE

Geometries are like this:enter image description here

and they are of very different scales.

2 Answers
Related