[QGIS-Developer] Move a Feature Programmatically

Catania, Luke A ERDC-RDE-GRL-VA CIV Luke.A.Catania at erdc.dren.mil
Mon May 27 13:29:27 PDT 2024


I want to use the Advanced Digitizing Toolbar programmatically through python.

I have a QTableView conating a layer name that references GeoJSON in a database.  When I select the layer and hit a button on my UI, it places the GeoJSON representation of a building footprint at a specified location on the map.  That was just a first cut, reading the GeoJSON and placing it on the map.

I also have code that tracks the mouse cursor in the map canvas. What I want to do is when I hit the place button, I want my layer to appear at my mouse location and have it moving around the map canvas until I click on the mouse to place it as the location I clicked and then end the edit session.

So I am trying to access the Advanced Digitizing Toolbar's Move Feature(s) method so I can have the feature moving until I decide where I want to place it.  Is it possible to utilize that feature of the toolbar through code.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.osgeo.org/pipermail/qgis-developer/attachments/20240527/bf3ec146/attachment.htm>


More information about the QGIS-Developer mailing list