3

I'm trying to put an x/y offset to the point-geometry-layer to get map-tip-informations from all overlapping points like in the Point Displacement Renderer.

For getting map-tip-informations it seems to be important that the point is visible at the stored coordinate and is not modified by an offset in the renderer. So I have to recalculate the stored coordinates and modify it with a varying offset which depends for example on the actual scale. With this recalulated, displaced coordinates I'm trying to create a new layer. This displaced points should be recognized by map-tips.

I created a virtual fields (X_modified, y_modified) and virtual_geometry with the field name "geometry" (by "geom_from_wkt('Point(X_modified || Y_modified)') - but there is no geometry-field-type available. The virtual layer didn't recognize the virtual geometry or other virtual fields...

-> Is it possible to create a virtual layer based upon virtual (geometry) fields of another layer ?

The calculation of the modified coordinates in the postgresql-data-provider seems not to be possible, because i do not know how to transfer the actual scale-variables (or other ones) from qgis to postgresql and its view-definitons. Or - do you know a way to do this ? [QGIS 2.18]

1 Answer 1

1

Unable to comment, so I'll have a stab at answering (possible badly), but to clarify: - You have a layer containing points - You would like to be able to access a point's location when creating map-tips - You do not want the point symbol to render over the actual x, y coordinates of the data, to improve visual clarity

I've always been an advocate of data/presentation separation so to me, storing the offsets seems like a bad idea anyway (the offset doesn't mean anything in the real world, it just helps you to visualise the data).

Why not use a data-defined override in the offset field of the style settings for that layer? You would be able to conditionally set the offset distance for different scales using the in-built variable available in the expression builder.

If you definitely want two layers: one for displaced and one for non-displaced points, then why not make sure there is a common id in both fields and perform a join? That way data for the original points should be available in the displaced points layer

1
  • I'd a approach like your suggested before, but as it seems still in qgis 2.18.3 the "map-tip"-function (and the "identify" function) does work for the displaced points (which are not at their stored/original position).
    – Ralf
    Jan 21, 2017 at 16:42

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.