Skip to content

Commit

Permalink
Fix Conversion.toGeometryCollection for null first arg
Browse files Browse the repository at this point in the history
  • Loading branch information
dr-jts committed Apr 9, 2024
1 parent f568af7 commit 848a028
Showing 1 changed file with 3 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -73,12 +73,12 @@ public static Geometry toMultiPolygon(Geometry g1, Geometry g2)
.createMultiPolygon( GeometryFactory.toPolygonArray(polys));
}

public static Geometry toGeometryCollection(Geometry g, Geometry g2)
public static Geometry toGeometryCollection(Geometry g1, Geometry g2)
{
List atomicGeoms = new ArrayList();
if (g != null) addComponents(g, atomicGeoms);
if (g1 != null) addComponents(g1, atomicGeoms);
if (g2 != null) addComponents(g2, atomicGeoms);
return g.getFactory().createGeometryCollection(
return FunctionsUtil.getFactoryOrDefault(g1, g2).createGeometryCollection(
GeometryFactory.toGeometryArray(atomicGeoms));
}

Expand Down

0 comments on commit 848a028

Please sign in to comment.