0

I get an error when trying to import this query as a spatial table in QGIS:

select geomFromText('LINESTRING Z(13.091464 47.061328 2597, 13.092059 47.061287 2580)') as geometry

'The result can't be loaded in QGIS..'

However, the results-panel of the QSpatiaLite Plugin shows a column with a valid 'GeomObject'

Does anybody know what's the problem here?

enter image description here

2
  • Can you show the schema for the table you're trying to import this into? In particular, can you tell us if there is a SRID set on it?
    – BradHards
    Commented Feb 22, 2015 at 5:56
  • Nope, no SRID. I just use the 'Load in QGIS as Spatial Table' function, and run the query.. Usually, with a working dataset, I'm then asked to choose a CRS and the table would be loaded to QGIS properly. Please, also see the screenshot added to the OP.
    – Kay
    Commented Feb 22, 2015 at 17:49

1 Answer 1

0

The z-value is not supported in QGIS. Removing the z-value and changing WKT to LINESTRING makes the SQL load in QGIS.

select geomFromText('LINESTRING(13.091464 47.061328, 13.092059 47.061287)') as geometry

Why do you want the two z-values 2597 and 2580 into QGIS?

6
  • I tried both 'LINESTRING Z' and 'LINESTRINGZ' and both return a GeomObject (so I suppose that's fine)! Where did you take the '1' and '2' after the altitude value from? I never used those in the original posting. HOwever, your proposed SQL with 'LINESTRING()' without the 'Z' returns a NULL, so I suppose this does not work. Have you tried this with QSpatiaLite?
    – Kay
    Commented Feb 24, 2015 at 10:29
  • I updated the answer
    – Jakob
    Commented Feb 24, 2015 at 13:02
  • So you actually don't know it either? I need the z-values because I want to export to kml, with linestrings including altitude-values..
    – Kay
    Commented Feb 24, 2015 at 17:18
  • 3D geometry is not supported in QGIS
    – Jakob
    Commented Feb 24, 2015 at 20:45
  • Thanks. Replace "Looks like" with "is not supported" in your answer and I'll check it..
    – Kay
    Commented Feb 25, 2015 at 6:50

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.