[postgis-tickets] [PostGIS] #5020: st_3dintersection causing core dump

PostGIS trac at osgeo.org
Tue Nov 16 20:02:21 PST 2021


#5020: st_3dintersection causing core dump
-------------------------+-------------------------------
  Reporter:  cege        |      Owner:  robe
      Type:  defect      |     Status:  closed
  Priority:  high        |  Milestone:  PostGIS SFCGAL
 Component:  sfcgal      |    Version:  3.1.x
Resolution:  worksforme  |   Keywords:  st_3dintersection
-------------------------+-------------------------------
Changes (by robe):

 * status:  new => closed
 * resolution:   => worksforme
 * milestone:  PostGIS 3.1.5 => PostGIS SFCGAL


Comment:

 Okay I just tried this on my system and I don't get a core-dump. So I
 suspect this issue is fixed in newer SFCGAL.

 My install is


 {{{
 POSTGIS="3.2.0dev 3.2.0beta1-18-g085cc7f04" [EXTENSION] PGSQL="140"
 GEOS="3.10.0-CAPI-1.16.0" PROJ="7.2.1" GDAL="GDAL 3.3.3, released
 2021/10/25" LIBXML="2.9.9" LIBJSON="0.12"
 LIBPROTOBUF="1.2.1" WAGYU="0.5.0 (Internal)" TOPOLOGY RASTER
 }}}

 Although it's puzzling my database doesn't show SFCGAL , but I'm
 definitely using it becuase if I do


 {{{
 DROP EXTENSION postgis_sfcgal;
 }}}

 and rerun I get ST_3DIntersection does not exist.  I know I am running
 SFCGAL 1.4.0 with CGAL 5.3 since I compiled it myself.

 Here is the script I am using, mild revision to use newer syntax.


 {{{
 create table public.buildings (
         building_id serial,
         building_name character varying (200) not null,
     location geometry(geometryZ)
 );
 CREATE EXTENSION IF NOT EXISTS postgis_sfcgal;
 --~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~


 -- insert two rows of data

 insert into public.buildings
 (building_name, location)
 values
 ('Building 1',st_extrude(st_geomfromtext('POLYGON((300 200 0, 300 2200 0,
 1600 2200 0, 1600 200 0, 300 200 0))',27700),0,0,600));


 --~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
 /* Building 2 */
 insert into public.buildings
 (building_name,location)
 values
 ('Building 2', st_extrude(st_geomfromtext('POLYGON    ((2000 1200 0, 2000
 2700 0, 2800 2700 0, 2800 1200 0, 2000 1200 0))',27700),0,0,600)
 );

 select a.building_id, b.building_id,
 ST_AsText(st_3dintersection(a.location, b.location))::varchar(75)
 from
 public.buildings a, public.buildings b;
 }}}


 Output is:


 {{{
 building_id | building_id |                                  st_astext
 -------------+-------------+-----------------------------------------------------------------------------
            1 |           1 | POLYHEDRALSURFACE Z (((300 200 0,300 2200
 0,1600 2200 0,300 200 0)),((1600
            1 |           2 | GEOMETRYCOLLECTION EMPTY
            2 |           1 | GEOMETRYCOLLECTION EMPTY
            2 |           2 | POLYHEDRALSURFACE Z (((2000 1200 0,2000 2700
 0,2800 2700 0,2000 1200 0)),((
 }}}

 On my sysem running PostGIS 3.1.4 with SFCGAL 1.4.0 works as well

 {{{
 PostgreSQL 14.1, compiled by Visual C++ build 1914, 64-bitPOSTGIS="3.1.4
 3.1.4" [EXTENSION] PGSQL="140" GEOS="3.9.1-CAPI-1.14.1" SFCGAL="1.4.0"
 PROJ="7.1.1" GDAL="GDAL 3.2.3, released 2021/04/27" LIBXML="2.9.9"
 LIBJSON="0.12" LIBPROTOBUF="1.2.1" WAGYU="0.5.0 (Internal)" RASTER
 }}}

 So if you can I'd suggest you try upgrading to a newer SFCGAL.

-- 
Ticket URL: <https://trac.osgeo.org/postgis/ticket/5020#comment:3>
PostGIS <http://trac.osgeo.org/postgis/>
The PostGIS Trac is used for bug, enhancement & task tracking, a user and developer wiki, and a view into the subversion code repository of PostGIS project.


More information about the postgis-tickets mailing list