I would like to move a polygon's center to another location by specifying a latitude and longitude. I am using a EPSG:4326 - WGS 84 projection.
Asked
Active
Viewed 34 times
0
x(geometry (get_feature_by_id ('points',$id)))and do the same for the y coordinate. You could also create a point layer with your coordinate values (save them as CSV, then load them to QGIS) - the you have 1:1 the same case as in the solution linked in my first comment. – Babel Apr 01 '21 at 20:21{ 'EXPRESSION' : 'translate( \n $geometry, \n 10-\n x (centroid ($geometry)),\n y(\n geometry (\n get_feature_by_id (\n \'points\',\n $id\n )\n )\n )-\n y (centroid ($geometry))\n)', 'INPUT' : '/private/var/folders/16/nmcjxt8j1412rg5vsw_pwd3r0000gn/T/processing_hDlGND/e433a803034d4a5ba032059e6958fdcd/output.gpkg', 'OUTPUT' : 'TEMPORARY_OUTPUT', 'OUTPUT_GEOMETRY' : 0, 'WITH_M' : False, 'WITH_Z' : False }But I had better luck with the Affine Transform tool – bdelliott Apr 02 '21 at 03:02