Duh - just realized I had one additional unnecessary sub select - I think
the below is crisper

SELECT gid,  ST_Line_Substring(the_geom, 500*n/length ,
CASE WHEN 500*(n+1) < length THEN 500*(n+1)/length ELSE 1 END) As the_geom
FROM    (SELECT ts.gid, ST_LineMerge(ts.the_geom) As the_geom,
ST_Length(ts.the_geom) As length FROM line_segments ts
                ) t CROSS JOIN generate_series(0,10000) n 
WHERE n*500/length < 1


Sorry about that,
Regina




_______________________________________________
postgis-users mailing list
postgis-users@postgis.refractions.net
http://postgis.refractions.net/mailman/listinfo/postgis-users

Reply via email to