gym
gym

Reputation: 1

Can a Geotools/JTS multipolygon geometry list contain other multipolygons

A Geotools/JTS MultiPolygon contains a list of geometries.

Do those geometries have to be Polygons, or could one of them be another MultiPolygon (or even something else)?

Same question also arises for MultiPoints and MultiLineStrings.

thx g

Upvotes: 0

Views: 110

Answers (1)

Ian Turton
Ian Turton

Reputation: 10976

Possibly but it may cause unexpected problems down the line. It would be better to either "promote" your Polygons to MultiPolygons or make the List hold Geometrys (or possibly their common interface Polygonal).

If you mix geometry types in a List you will have problems writing them to most DataStores which expect a consistent data type.

Upvotes: 0

Related Questions