I am running QGIS 1.8 (SpatiaLite 3.0.1) and QSpatiaLite 6.0.1.

I have a spatial table EventPrecise (with geometry column p in EPSG:4326). I want to join this table with another, non-spatial table Event and produce a new spatial table out of it with EPSG:21781, while at the same time filtering on a non-spatial attribute t. This is my query:

SELECT e.id, e.oid, e.type, e.subtype, e.t, ST_Transform(ep.p, 21781) AS p
FROM event e LEFT OUTER JOIN eventprecise ep ON e.id = ep.eid
WHERE datetime(e.t) > datetime('2013-02-05 18:20:00') AND datetime(e.t) < datetime('2013-02-19 08:31:00');

When running this query in QSpatiaLite with options "Create Spatial Table & Load in QGIS", and geometry column = "p", I get the error:

'%s' doesn't correspond to a geometry field, try with another field name

Creating a View works though.. is this a bug?

EDIT: Turns out that it works when doing an INNER JOIN, so p is never null - still, is this normal behaviour?

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.