id summary reporter owner description type status priority milestone component version resolution keywords cc 3838 topology.toTopoGeom fails with ERROR: XX000: SQL/MM Spatial exception - geometry crosses, when using tolerance 10 meter Lars Aksel Opsahl strk "Hi I am working on a case where I am testing Postgis Topology for merging new data from satellite images into a existing vector layer. The basic idea new is that new lines should snap to to existing lines based on given tolerance. I have reduced the problem down staring with one geometry object and the adding a new object that we want adjust to the existing polygon like this. I start with a empty layer and adds a linestring (the pink one) select topology.toTopoGeom('0102000020E864000032..', 'topo_ar5_forest_sysdata', '1', '1'); Then I have a new linestring (the red dotted) that intersects first geo but I want use snapTo to avoid duplicated lines so I use snapto like this. select topology.toTopoGeom('0102000020E864000019..', 'topo_ar5_forest_sysdata', '1', '10'); Then I get this error : ERROR: XX000: SQL/MM Spatial exception - geometry crosses edge 12 CONTEXT: PL/pgSQL function totopogeom(geometry,topogeometry,double precision) line 114 at FOR over SELECT rows PL/pgSQL function totopogeom(geometry,character varying,integer,double precision) line 89 at assignment LOCATION: pg_error, lwgeom_pg.c:164 In this case it seems to work OK with for instance with 1 meter and 5 meter as tolerance, but I need to use 10 meter in this case. Both objects are valid. A bug that looks something like is discussed in https://trac.osgeo.org/postgis/ticket/1641 . Attached is a sql that produce this error and image that show involved polygons. Is i doing something wrong here or is this a bug. Thanks Lars" defect closed medium PostGIS 2.5.0 topology 2.3.x fixed totopogeom, ERROR: XX000: SQL/MM Spatial exception - geometry crosses aperi