Hi Maurizio,
a practical example just to check better your request:
1. we'll suppose a Linestring geometry having exactly 10 vertices
2. then we'll imagine a spatial table like the following one:
CREATE TABLE my_points (
position INTEGER PRIMARY KEY);
SELECT AddGeometryColumn('my_points', 'geom', someSrid, 'POINT',
'XY');
and we'll suppose that this table has been populated in this way:
INSERT INTO my_points VALUES( 3, MakePoint(x1, y1, srid));
INSERT INTO my_points VALUES( 7, MakePoint(x2, y2, srid));
INSERT INTO my_points VALUES( 12, MakePoint(x2, y3, srid));
INSERT INTO my_points VALUES( 37, MakePoint(x4, y4, srid));
3. the new function should return a new Linestring in which:
3a, the vertices corresponding to indices 0,1,2,4,5,6,8,9
will be the same of the input Linestring
3b. while the vertices corresponding to indices 3 and 7
will be replaced by the Points read from table "my_points"
and such substitution will unconditionally apply without
any check about the distance radius between the old
and the new Point.
3c. the two rows of "my_points" corresponding to positions
12 and 37 will be silently ignored because their indices
are outside the Linestring's range.
is all this correct ? I've correctly understood you request ?
preliminary checks to be performed by the new function:
a. if the input geometry is not a Linestring an exception
will be raised.
b. if the reference table does not exist an exception
will be raised.
c. if the reference table does not containt the requested
geometry column an exception will be raised.
d. if such geometry column is not of the POINT type,
or has not the same dimensions and/or the same SRID
of the Linestring an exception will be raised.
e. and finally if the above table contains two or
more rows declaring the same "position index"
an exception will be raised.
any further consideration ?
bye Sandro