Hi
HiI am attempting to create a function to mimic ESRI linear referencing hatching to label measures along a road.
SELECT id, ne, n AS pointN, ST_X(pt) AS X, ST_Y(pt) AS Y, pt,
MakePointM(X(pt), Y(pt), ss + (es - ss) * Line_Locate_Point(Transform(geom, 3112), Transform(pt, 3112)), 4283) AS PointM
FROM (WITH RECURSIVE item(n, ne, ss, es, id, pt, geom) AS
(VALUES(0, NULL, 0, 0, NULL, NULL, NULL)
UNION
SELECT n+1, nw.ne, nw.ss, nw.es, nw.id, ST_PointN(nw.geom, n+1), nw.geom
FROM item, (SELECT pk_uid AS id, NETWORK_ELEMENT as ne, START_SLK AS ss, END_SLK AS es, geometry AS geom
FROM Network WHERE ROAD = 'M008' AND ss > 97) AS nw /*Where*/
WHERE n < ST_NumPoints(nw.geom))
SELECT n, ne, ss, es, id, pt, geom FROM item)
GROUP BY ne, id, pointN
HAVING id IS NOT NULL;
What I'd like to do is then recreate the line data by NETWORK_ELEMENT from the pointM geometry. Is this possible within this query or should I create a temp table?
Presumably I would need to use WITH RECURSIVE again to create the line as there is no MakeLine(ID, ptN) function that I could find.
Thanks
Duncan