Fix/force order points with empty

Description

This MR aims to fix #314 (closed) (also reported on PostGIS 6029).

I added protection against EMPTY. I also added a test. Note that in “pure” SFCGAL, the multipolygon with an empty polygon is removed.

I took the opportunity to add forceLHR/forceRHR in SFCGALOP.

@robe2 can you confirm my fix, please?

From PostGIS Master with this branch:

test=# SELECT ST_AsText(CG_ForceLHR(ST_GeomFromText('MULTIPOLYGON (((9 9, 9 1, 1 1, 2 4, 7 7, 9 9)), EMPTY)', 4326))) ;
                    st_astext                    
-------------------------------------------------
 MULTIPOLYGON(((9 9,7 7,2 4,1 1,9 1,9 9)),EMPTY)
(1 ligne)

test=# SELECT postgis_full_version();
                                                                                                                                                                                                       postgis_full_version                                                                                                                                                                                                       
----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
 POSTGIS="3.7.0dev 3.3.0rc2-3533-gefa3aedb1" [EXTENSION] PGSQL="170" GEOS="3.14.1-CAPI-1.20.5" SFCGAL="SFCGAL 2.3.0, CGAL 6.1, BOOST 1.89.0" PROJ="9.7.0 NETWORK_ENABLED=OFF URL_ENDPOINT=https://cdn.proj.org USER_WRITABLE_DIRECTORY=/home/lbartoletti/.local/share/proj DATABASE_PATH=/usr/local/share/proj/proj.db" (compiled against PROJ 9.7.0) LIBXML="2.14.6" LIBJSON="0.18" LIBPROTOBUF="1.5.1" WAGYU="0.5.0 (Internal)"
(1 ligne)

test=# 

CI GitHub Status

  • MSYS2: MSYS2
  • VCPKG: Build with vcpkg
  • BSD: CI

Tests

  • Unit
  • C api

Merge request reports

Loading