@@ -2342,43 +2342,30 @@ lwgeom_subdivide_recursive(const LWGEOM *geom,
2342
2342
2343
2343
++ depth ;
2344
2344
2345
- LWCOLLECTION * col1 =
2346
- lwcollection_construct_empty (COLLECTIONTYPE , geom -> srid , lwgeom_has_z (geom ), lwgeom_has_m (geom ));
2347
- LWCOLLECTION * col2 =
2348
- lwcollection_construct_empty (COLLECTIONTYPE , geom -> srid , lwgeom_has_z (geom ), lwgeom_has_m (geom ));
2349
- //#pragma omp parallel sections
2350
2345
{
2351
- //#pragma omp section
2346
+ LWGEOM * subbox = (LWGEOM * )lwpoly_construct_envelope (
2347
+ geom -> srid , subbox1 .xmin , subbox1 .ymin , subbox1 .xmax , subbox1 .ymax );
2348
+ LWGEOM * clipped = lwgeom_intersection (geom , subbox );
2349
+ lwgeom_simplify_in_place (clipped , 0.0 , LW_TRUE );
2350
+ lwgeom_free (subbox );
2351
+ if (clipped && !lwgeom_is_empty (clipped ))
2352
2352
{
2353
- LWGEOM * subbox = (LWGEOM * )lwpoly_construct_envelope (
2354
- geom -> srid , subbox1 .xmin , subbox1 .ymin , subbox1 .xmax , subbox1 .ymax );
2355
- LWGEOM * clipped = lwgeom_intersection (geom , subbox );
2356
- lwgeom_simplify_in_place (clipped , 0.0 , LW_TRUE );
2357
- lwgeom_free (subbox );
2358
- if (clipped )
2359
- {
2360
- lwgeom_subdivide_recursive (clipped , dimension , maxvertices , depth , col1 );
2361
- lwgeom_free (clipped );
2362
- }
2353
+ lwgeom_subdivide_recursive (clipped , dimension , maxvertices , depth , col );
2354
+ lwgeom_free (clipped );
2363
2355
}
2364
- //#pragma omp section
2356
+ }
2357
+ {
2358
+ LWGEOM * subbox = (LWGEOM * )lwpoly_construct_envelope (
2359
+ geom -> srid , subbox2 .xmin , subbox2 .ymin , subbox2 .xmax , subbox2 .ymax );
2360
+ LWGEOM * clipped = lwgeom_intersection (geom , subbox );
2361
+ lwgeom_simplify_in_place (clipped , 0.0 , LW_TRUE );
2362
+ lwgeom_free (subbox );
2363
+ if (clipped && !lwgeom_is_empty (clipped ))
2365
2364
{
2366
- LWGEOM * subbox = (LWGEOM * )lwpoly_construct_envelope (
2367
- geom -> srid , subbox2 .xmin , subbox2 .ymin , subbox2 .xmax , subbox2 .ymax );
2368
- LWGEOM * clipped = lwgeom_intersection (geom , subbox );
2369
- lwgeom_simplify_in_place (clipped , 0.0 , LW_TRUE );
2370
- lwgeom_free (subbox );
2371
- if (clipped )
2372
- {
2373
- lwgeom_subdivide_recursive (clipped , dimension , maxvertices , depth , col2 );
2374
- lwgeom_free (clipped );
2375
- }
2365
+ lwgeom_subdivide_recursive (clipped , dimension , maxvertices , depth , col );
2366
+ lwgeom_free (clipped );
2376
2367
}
2377
2368
}
2378
- col = lwcollection_concat_in_place (col , col1 );
2379
- lwcollection_release (col1 );
2380
- col = lwcollection_concat_in_place (col , col2 );
2381
- lwcollection_release (col2 );
2382
2369
}
2383
2370
2384
2371
LWCOLLECTION *
0 commit comments