3

In QGIS 2.18, I had been using the plugin "Plain Geometry Editor" to view, copy and paste the WKT geometry of features (as a solution to this question). However, this plugin is not available for QGIS 3.0. Is there any new core functionality within 3.0 that will do the same thing? or perhaps another plugin? ("GetWKT" allows me to view and copy, but not paste, the WKT data.)

2

In QGIS 3 you can use (like in earlier versions) the copy&paste of the objects in the attribute table. When you paste them you get the WKT and also the other attribute values. If it is not working the option is probably not set in the options (submenu datasources).

That means you have to paste it into another program an copy only the WKT from there if you don´t need more. Spreadsheet software like Calc do automatically recognize the delimiter of the copied data. Therefore you get an own column only for WKT.

  • But once I've copied the WKT from that other program, how would I update a feature in QGIS with that copied geometry? – Nathan May 22 '18 at 5:07
  • In the field calculator you use the function geom_from_wkt('Polygon(...)') and set the "Update existing field" to <geometry>. – Matte May 22 '18 at 6:44
  • That worked! But it's much easier than copy/paste into a separate program, using the "GetWKT" plugin that still works in 3.0. Here are the steps: 1. In the source layer, select a feature and run the GetWKT plugin. 2. Select and copy the returned WKT. 3. In the destination layer, select a feature and open Field Calculator. 4. Call the function geom_from_wkt() as explained above, using the copied WKT between the (). (Ensure that "Update only 1 selected feature" is also selected.) 5. The feature in the destination layer is updated with the new geometry. – Nathan May 22 '18 at 15:37
4

I suggest to try OpenJUMP while waiting for Plain Geometry Editor for QGIS 3. With OpenJUMP you can copy, paste, and edit geometries as WKT. QGIS can read and write the JUMP GML format (JML) and you can use that as a transfer format. OpenJUMP can handle all sort of geometries on one layer which is often a nice feature but for QGIS you must keep points, lines, and polygons on separate layers.

enter image description here

  • Ah yes—OpenJUMP to the rescue once again! Of course, I could also just use QGIS 2.18 with the plugin and edit my data files there, but nice to know OpenJUMP will also do it. – Nathan May 22 '18 at 5:09
3

I just released the version for QGIS 3, it is available from the main repo

Kudos to Giovanni who did the port.

2

There is a plugin perfect to do this in QGIS 3.

GEOMETRY PASTER.

We're looking for long answers that provide some explanation and context. Don't just give a one-line answer; explain why your answer is right, ideally with citations. Answers that don't include explanations may be removed.

  • 4
    Thank you for this first contribution; it is never too late to come with a good answer. It would be even better if you could provide some more information about the geometry paster (what it does exactly...) – radouxju Jan 30 at 8:29
  • I actually just discovered this plugin yesterday. Unfortunately, the first time I tried it I got error messages, I think having to do with the available space on the clipboard for the pasted geometry. So yes, this should be exactly what I need, if and when it is working solidly! – Nathan Jan 30 at 18:14

Your Answer

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

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