@@ -255,14 +255,48 @@ public static void compareGeometryData(GeoPackageGeometryData expected,
255255 // Compare header bytes
256256 compareByteArrays (expected .getHeaderBytes (), actual .getHeaderBytes ());
257257
258+ Geometry expectedGeometry = expected .getGeometry ();
259+ Geometry actualGeometry = actual .getGeometry ();
260+
261+ byte [] expectedWKB = expected .getWkb ();
262+ byte [] actualWKB = actual .getWkb ();
263+
264+ byte [] expectedBytes = expected .getBytes ();
265+ byte [] actualBytes = actual .getBytes ();
266+
267+ if (expectedGeometry != null && actualGeometry != null
268+ && expectedGeometry
269+ .getGeometryType () == GeometryType .MULTILINESTRING ) {
270+ if (!(actualGeometry instanceof MultiLineString )) {
271+ @ SuppressWarnings ("unchecked" )
272+ GeometryCollection <LineString > geomCollection = (GeometryCollection <LineString >) actualGeometry ;
273+ MultiLineString multiLineString = new MultiLineString ();
274+ multiLineString .addGeometries (geomCollection .getGeometries ());
275+ actualGeometry = multiLineString ;
276+ int wkbLocation ;
277+ int byteLocation ;
278+ if (actual .getByteOrder () == ByteOrder .BIG_ENDIAN ) {
279+ wkbLocation = 4 ;
280+ byteLocation = 12 ;
281+ } else {
282+ wkbLocation = 1 ;
283+ byteLocation = 9 ;
284+ }
285+ byte code = (byte ) GeometryCodes
286+ .getCode (GeometryType .MULTICURVE );
287+ actualWKB [wkbLocation ] = code ;
288+ actualBytes [byteLocation ] = code ;
289+ }
290+ }
291+
258292 // Compare geometries
259- compareGeometries (expected . getGeometry (), actual . getGeometry () );
293+ compareGeometries (expectedGeometry , actualGeometry );
260294
261295 // Compare well-known binary geometries
262- compareByteArrays (expected . getWkb (), actual . getWkb () );
296+ compareByteArrays (expectedWKB , actualWKB );
263297
264298 // Compare all bytes
265- compareByteArrays (expected . getBytes (), actual . getBytes () );
299+ compareByteArrays (expectedBytes , actualBytes );
266300
267301 }
268302
0 commit comments