[postgis-tickets] [PostGIS] #2547: ST_Simplify(TopoGeometry) doesn't simplify hierarchical topogeoms
PostGIS
trac at osgeo.org
Thu Nov 21 08:09:48 PST 2013
#2547: ST_Simplify(TopoGeometry) doesn't simplify hierarchical topogeoms
--------------------------------------------+-------------------------------
Reporter: duncandoo | Owner: strk
Type: defect | Status: new
Priority: medium | Milestone: PostGIS 2.1.2
Component: topology | Version: 2.1.x
Keywords: st_simplify topology hierarchy |
--------------------------------------------+-------------------------------
Running the topogeom version of ST_Simplify() on a topogeomery layer that
is a parent layer I get the following error:
{{{
ERROR: function topology.st_simplify(topogeometry) does not exist
LINE 1: SELECT st_multi(st_union(topology.ST_Simplify(topogeom))) as...
^
HINT: No function matches the given name and argument types. You might
need to add explicit type casts.
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
CONTEXT: PL/pgSQL function st_simplify(topogeometry,double precision)
line 59 at EXECUTE statement
********** Error **********
ERROR: function topology.st_simplify(topogeometry) does not exist
SQL state: 42883
Hint: No function matches the given name and argument types. You might
need to add explicit type casts.
Context: PL/pgSQL function st_simplify(topogeometry,double precision) line
59 at EXECUTE statement
}}}
And here is the SQL I run to get the error:
{{{
CREATE DATABASE france;
CREATE EXTENSION postgis;
CREATE EXTENSION postgis_topology;
--Use QGis to import shape file from
http://www.actualitix.fr/actgeoshap/regions/alsace.zip
SET search_path to public, topology;
SELECT CreateTopology('alsace_topo', find_srid('public', 'alsace',
'geom'));
SELECT AddTopoGeometryColumn('alsace_topo', 'public', 'alsace',
'topogeom', 'MULTIPOLYGON', (
SELECT layer_id FROM layer WHERE table_name = 'alsace'
));
UPDATE alsace SET topogeom = toTopoGeom(geom, 'alsace_topo', (
SELECT layer_id FROM layer WHERE table_name = 'alsace'
));
SELECT st_simplify(topogeom, 10000) FROM alsace; -- works
CREATE TABLE alsace_depts AS SELECT DISTINCT code_dept FROM alsace;
SELECT topology.AddTopoGeometryColumn('alsace_topo', 'public',
'alsace_depts', 'topogeom', 'MULTIPOLYGON', (
SELECT layer_id FROM layer WHERE table_name = 'alsace'
));
UPDATE alsace_depts SET topogeom = createTopoGeom('alsace_topo', 3,
(SELECT layer_id FROM layer WHERE table_name = 'alsace_depts'), a.tgs)
FROM
(
SELECT code_dept, topoElementArray_agg(array[id(topogeom),(SELECT layer_id
FROM layer WHERE table_name = 'alsace')]) as tgs
FROM alsace
GROUP BY code_dept
) a
WHERE a.code_dept = alsace_depts.code_dept;
ALTER TABLE alsace_depts ADD COLUMN dept_geom geometry(MultiPolygon,
2154);
UPDATE alsace_depts SET dept_geom = topogeom::geometry(MultiPolygon,2154);
SELECT st_simplify(topogeom, 10000) FROM alsace_depts; -- doesn't work:
produces error
}}}
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?
--
Ticket URL: <http://trac.osgeo.org/postgis/ticket/2547>
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