<html><head><meta http-equiv="Content-Type" content="text/html charset=us-ascii"></head><body style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space; "><div>When I try to run the topogeom version of ST_Simplify() on a topogeomery layer that is a parent layer I get the following error:</div><div><br></div><div><div style="margin: 0px; font-size: 12px; font-family: Monaco; ">ERROR: function topology.st_simplify(topogeometry) does not exist</div><div style="margin: 0px; font-size: 12px; font-family: Monaco; ">LINE 1: SELECT st_multi(st_union(topology.ST_Simplify(topogeom))) as...</div><div style="margin: 0px; font-size: 12px; font-family: Monaco; "> ^</div><div style="margin: 0px; font-size: 12px; font-family: Monaco; ">HINT: No function matches the given name and argument types. You might need to add explicit type casts.</div><div style="margin: 0px; font-size: 12px; font-family: Monaco; ">QUERY: SELECT st_multi(st_union(topology.ST_Simplify(topogeom))) as geom FROM public.alsace, alsace_topo.relation pr WHERE pr.topogeo_id = 2 AND pr.layer_id = 2 AND id(topogeom) = pr.element_id AND layer_id(topogeom) = pr.element_type </div><div style="margin: 0px; font-size: 12px; font-family: Monaco; ">CONTEXT: PL/pgSQL function st_simplify(topogeometry,double precision) line 59 at EXECUTE statement</div><div style="margin: 0px; font-size: 12px; font-family: Monaco; min-height: 16px; "><br></div><div style="margin: 0px; font-size: 12px; font-family: Monaco; ">********** Error **********</div><div style="margin: 0px; font-size: 12px; font-family: Monaco; min-height: 16px; "><br></div><div style="margin: 0px; font-size: 12px; font-family: Monaco; ">ERROR: function topology.st_simplify(topogeometry) does not exist</div><div style="margin: 0px; font-size: 12px; font-family: Monaco; ">SQL state: 42883</div><div style="margin: 0px; font-size: 12px; font-family: Monaco; ">Hint: No function matches the given name and argument types. You might need to add explicit type casts.</div><div style="margin: 0px; font-size: 12px; font-family: Monaco; ">Context: PL/pgSQL function st_simplify(topogeometry,double precision) line 59 at EXECUTE statement</div></div><div><br></div><div><br></div><div>My version info is:</div><div><br></div><div>SELECT version() || ' ' || postgis_full_version();</div><div>"PostgreSQL 9.3.1 on x86_64-apple-darwin11.4.2, compiled by i686-apple-darwin11-llvm-gcc-4.2 (GCC) 4.2.1 (Based on Apple Inc. build 5658) (LLVM build 2336.11.00), 64-bit POSTGIS="2.1.1 r12113" GEOS="3.4.2-CAPI-1.8.2 r3921" PROJ="Rel. 4.8.0, 6 March 2012" GD (...)"</div><div><br></div><div><br></div><div>And here is the SQL I run to get the error:</div><br><div apple-content-edited="true">
<div style="font-size: 14px; ">CREATE DATABASE france;</div><div style="font-size: 14px; ">CREATE EXTENSION postgis;</div><div style="font-size: 14px; ">CREATE EXTENSION postgis_topology;</div><div style="font-size: 14px; "><br></div><div style="font-size: 14px; ">--Use QGis to import shape file from <a href="http://www.actualitix.fr/actgeoshap/regions/alsace.zip">http://www.actualitix.fr/actgeoshap/regions/alsace.zip</a></div><div style="font-size: 14px; "><br></div><div style="font-size: 14px; ">SET search_path to public, topology;</div><div style="font-size: 14px; ">SELECT CreateTopology('alsace_topo', find_srid('public', 'alsace', 'geom'));</div><div style="font-size: 14px; "><div>SELECT AddTopoGeometryColumn('alsace_topo', 'public', 'alsace', 'topogeom', 'MULTIPOLYGON', (</div><div>SELECT layer_id FROM layer WHERE table_name = 'alsace'</div><div>));</div></div><div style="font-size: 14px; "><div>UPDATE alsace SET topogeom = toTopoGeom(geom, 'alsace_topo', (</div><div>SELECT layer_id FROM layer WHERE table_name = 'alsace'</div><div>));</div></div><div style="font-size: 14px; ">SELECT st_simplify(topogeom, 10000) FROM alsace; -- works</div><div style="font-size: 14px; ">CREATE TABLE alsace_depts AS SELECT DISTINCT code_dept FROM alsace;</div><div style="font-size: 14px; "><div>SELECT topology.AddTopoGeometryColumn('alsace_topo', 'public', 'alsace_depts', 'topogeom', 'MULTIPOLYGON', (</div><div>SELECT layer_id FROM layer WHERE table_name = 'alsace'</div><div>));</div></div><div style="font-size: 14px; "><div>UPDATE alsace_depts SET topogeom = createTopoGeom('alsace_topo', 3, (SELECT layer_id FROM layer WHERE table_name = 'alsace_depts'), a.tgs) FROM</div><div>(</div><div>SELECT code_dept, topoElementArray_agg(array[id(topogeom),(SELECT layer_id FROM layer WHERE table_name = 'alsace')]) as tgs</div><div>FROM alsace</div><div>GROUP BY code_dept</div><div>) a</div><div>WHERE a.code_dept = alsace_depts.code_dept;</div></div><div style="font-size: 14px; ">ALTER TABLE alsace_depts ADD COLUMN dept_geom geometry(MultiPolygon, 2154);</div><div style="font-size: 14px; ">UPDATE alsace_depts SET dept_geom = topogeom::geometry(MultiPolygon,2154);</div><div style="font-size: 14px; ">SELECT st_simplify(topogeom, 10000) FROM alsace_depts; -- doesn't work: produces error</div><div style="font-size: 14px; "><br></div><div style="font-size: 14px; "><span style="font-size: medium; "> I think what the error says is that the function is calling another function that doesn't exist (ST_Simplify(topogeom)). Is it supposed to be calling the function ST_Simplify(topogeom, double) instead? What would be the best way to fix this?</span></div><div style="font-size: 14px; "><span style="font-size: medium; "><br></span></div><div style="font-size: 14px; "><span style="font-size: medium; ">Thank you,</span></div><div style="font-size: 14px; "><span style="font-size: medium; "><br></span></div><div style="font-size: 14px; "><span style="font-size: medium; ">Duncan</span></div><div style="font-size: 14px; "><span style="font-size: medium; "><br></span></div><div style="font-size: 14px; "><span style="font-size: medium; "><br></span></div></div></body></html>