More

How to get ST_MakeLine ready for QGIS?

How to get ST_MakeLine ready for QGIS?


CREATE VIEW new_line AS SELECT point1.gid, ST_MakeLine(point1.geom, point2.geom) FROM point1, point2 WHERE point1.gid = point2.gid;

It's possible to load the layer but QGIS says 'There is no entry in geometry_columns!'. The SRID is missing, too.


Just a little bit more of the Lunar Sea answer. Your query is ok. The problem is that you didn't gave a name to the geometry column so qgis doesn't like it. Specify ::geometry ecc… is important but not essential if you know what is inside your table. It could be possible that you have to specify Multilinestring instead of Linestring.

CREATE VIEW new_line AS SELECT point1.gid, ST_MakeLine(point1.geom, point2.geom)::geometry(Linestring, SRID) as geom FROM point1, point2 WHERE point1.gid = point2.gid;

EDIT:

The geom column needs registering in the view public.geometry_columns. This is done by adding '::geometry(linestring, SRID)' to the query:

ST_MakeLine(point1.geom, point2.geom)::geometry(linestring, SRID)

Thanks @user30184 for the link to the docs


Watch the video: QGIS Part4 - How to create your first map in 15 mins