1

Following the suggestion from this topic I'm posting my question here.

I have a table in postgres/postgis with geo data and I want to show them on map via qgis.

Here is the table:

city  |  street  |  geo
A     |  A1      |  LINESTRING(17.257125 54.595952,17.253573 54.599437)

I do not know how to do this. I can show a single point on map (creating geo column with AddGeometryColumn function) without any problem, but how to show this part LINESTRING(17.257125 54.595952,17.253573 54.599437) (points with line between them). Any advices, suggestions or link to some articles about it?

I was thinking about splitting geo coordinates from Linestring(), but in the end this will not work at least that is my opinion.

I'm new to GIS things so please guide me.

1

1 Answer 1

2

PostgreSQL / PostGIS (pgAdmin3) create a view and use ST_GeomFromText (text WKT):

  • text WKT = geo;

enter image description here

3
  • Thank you for your answer, however I found that for this case I create geometry column but forgot to fill it with data. Now when I'm trying to do this in the same way as with my table with points only I have error message: Error: parse error - invalid geometry HINT: "Linestring(LINESTRING(" <-- parse error at position 22 within geometry. This is my query: UPDATE public.tablename SET geom = ST_GeomFromText('Linestring('|| x || ')',4269); where x is the name of table with linestring data.
    – Voystin
    Commented May 25, 2016 at 7:12
  • I did not understand, do you want to get a linear geometry starting from a points table?
    – pigreco
    Commented May 25, 2016 at 9:12
  • Actually doesn't matter anymore. I had a mistake in data in table. Data in Geo column were in format LINESTRING(17.257125 54.595952,17.253573 54.599437). When I removed LINESTRING, ( and ) everything is working fine. So thank you very much for your support.
    – Voystin
    Commented May 25, 2016 at 9:21

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.