I need to create a table of points based on linestring.
Basically I have a linestring table (l_table) and I will generate start, end, centroid of each line. It's necessary to merge these 3 columns into one geometry points column.I desire to keep the original "ID" column associated with the new geometry point. Finally, One more column to describe the new point geometry: start, end or centroid.
Something like this:
create table point_from_line as (
select l.id, st_startpoint(l.geom), st_centroid(l.geom), st_endpoint(l.geom)
case st_startpoint ... then 'start'
case st_centroid ... then 'centroid'
case st_endpoint ... then 'end'
end as geom_origin
from linestring_table
where l.id any condition...
Note: the geom column result need to be associated with the original id of linestring and one more column to describe if is start, center or end point.
Input columns: l.id, l.geom (linestring);
Output columns: l.id, p.geom (the unified result of st_start, st_centroid, st_endpoint), _p.geometry_origin_ (classification in: start,end, centroid for each row of p.geom)
Could someone help me?