I installed the plugin qgsaffine but cannot find the entry in the menu bar. Where do I find this. Can anyone here help me with this?
[GIS] Where to find qgsaffine in the menu
qgis
Related Solutions
You can do this in PostGIS using ST_Affine. The functionality to rotate around an arbitrary point was added to ST_Rotate for PostGIS 2.0.
If you have an earlier version (like PostGIS 1.5, or even earlier), you can add these functions:
CREATE OR REPLACE FUNCTION st_rotate(geometry, double precision, geometry)
RETURNS geometry AS
'SELECT ST_Affine($1, cos($2), -sin($2), 0, sin($2), cos($2), 0, 0, 0, 1, ST_X($3) - cos($2) * ST_X($3) + sin($2) * ST_Y($3), ST_Y($3) - sin($2) * ST_X($3) - cos($2) * ST_Y($3), 0)'
LANGUAGE sql IMMUTABLE STRICT
COST 100;
COMMENT ON FUNCTION st_rotate(geometry, double precision, geometry) IS 'args: geomA, rotRadians, pointOrigin - Rotate a geometry rotRadians counter-clockwise about an origin.';
CREATE OR REPLACE FUNCTION st_rotate(geometry, double precision, double precision, double precision)
RETURNS geometry AS
'SELECT ST_Affine($1, cos($2), -sin($2), 0, sin($2), cos($2), 0, 0, 0, 1, $3 - cos($2) * $3 + sin($2) * $4, $4 - sin($2) * $3 - cos($2) * $4, 0)'
LANGUAGE sql IMMUTABLE STRICT
COST 100;
COMMENT ON FUNCTION st_rotate(geometry, double precision, double precision, double precision) IS 'args: geomA, rotRadians, x0, y0 - Rotate a geometry rotRadians counter-clockwise about an origin.';
See examples at ST_Rotate to get an idea on how to use it to rotate a geometry around an x, y point, including the centroid (common centre).
Because we all like math, the transformation matrix from the above functions is represented as:
[ cos(θ) | -sin(θ) || x0 - cos(θ) * x0 + sin(θ) * y0 ]
[ sin(θ) | cos(θ) || y0 - sin(θ) * x0 - cos(θ) * y0 ]
Where θ is the counter-clockwise rotation about an origin, x0 is the Easting/Longitude of the origin point, and y0 is the Northing/Latitude. This math could possibly be adapted to any affine transformation tool.
To use the qgsAffine tool, you need to understand where the values of the matrix flow to. A good spreadsheet template is also required to do pre-calculations. The qgsAffine dialog looks something like this:
X Y
+---+---+
Scale | a | e |
+---+---+
Rotation | d | b |
+---+---+
Translation | c | f |
+---+---+
where:
- a : cos(θ)
- b : -sin(θ)
- c : x0 - cos(θ) * x0 + sin(θ) * y0
- d : sin(θ)
- e : cos(θ)
- f : y0 - sin(θ) * x0 - cos(θ) * y0
For example, if you want to rotate a polygon 30° clockwise around 42°S, 174°E, here are your inputs to your spreadsheet:
- x0 = 174
- y0 = -42
- θ=-30 degrees or -0.523598776 radians
Then, copy/paste the results from a spreadsheet to the right box. Using the tab order in the from the dialog:
- a : 0.866025404
- d : -0.5
- c : 44.31157974
- e : 0.866025404
- b : 0.5
- f : 81.37306696
The same example from PostGIS would look something like:
SELECT ST_Rotate(geom, -30*pi()/180, 174.0, -42.0)
If you go the the Settings > Customisation menu options, it gives you a dialog that allows you to turn off whole toolbars and also remove menus and docks. You can also remove individual buttons or menu items too rather than the whole toolbar or menu.
You can also save these settings from this panel to an ini file, and then open an ini file on another machine.
This blog post talks about the feature:
Best Answer
In Qgis, Select Plugins > Manage Plugins and Select the qgsaffine plugin.
In Menu, it is located at Plugins > Geoprocessing > Affine