Opened 4 years ago

Closed 3 years ago

#4902 closed defect (invalid)

toTopoGeom exception on TIGER Counties

Reported by: pramsey Owned by: strk
Priority: medium Milestone: PostGIS 3.2.0
Component: postgis Version: master
Keywords: Cc:

Description

Download from:

Load to database

shp2pgsql -D -s 4269 -I tl_2019_us_county counties | psql postgis

Reproject and build topology

-- Planar projection
alter table counties alter column geom type geometry(multipolygon, 2163) using st_transform(geom, 2163);

SELECT topology.CreateTopology('counties_topo', 2163, 10.0);
SELECT topology.AddTopoGeometryColumn('counties_topo', 'public', 'counties', 'topo_geom', 'POLYGON');
UPDATE counties SET topo_geom = topology.toTopoGeom(geom, 'counties_topo', 1);

Yields error

ERROR:  SQL/MM Spatial exception - curve not simple
CONTEXT:  PL/pgSQL function totopogeom(geometry,topogeometry,double precision) line 115 at FOR over SELECT rows
PL/pgSQL function totopogeom(geometry,character varying,integer,double precision) line 88 at assignment

Latest postgis/geos

 POSTGIS="3.2.0dev 3.1.0rc1-162-g46efb9f2d" [EXTENSION] PGSQL="130" GEOS="3.10.0dev-CAPI-1.15.0" PROJ="8.0.0" GDAL="GDAL 3.2.0, released 2020/10/26" LIBXML="2.9.4" LIBJSON="0.15" LIBPROTOBUF="1.3.3" WAGYU="0.5.0 (Internal)" (core procs from "3.2.0dev 3.1.0rc1-155-gb16f9e0f6" need upgrade) TOPOLOGY RASTER (raster procs from "3.2.0dev 3.1.0rc1-155-gb16f9e0f6" need upgrade)

Change History (3)

comment:1 by pramsey, 4 years ago

Addendum, not just a problem with modern GEOS, fails with same error against GEOS="3.8.3-CAPI-1.13.4.

comment:2 by strk, 4 years ago

Does it still fail if you pass 1e-10 as the tolerance in the toTopoGeom call ? Snapping often introduces problems…

comment:3 by pramsey, 3 years ago

Resolution: invalid
Status: assignedclosed
Note: See TracTickets for help on using tickets.