Hi, <div><br></div><div>If polygon is valid and was only translated, scaled and shifted, you can get the transformation back inspecting first two points of outer ring. For invalid ones you can do that by finding two non-same points, matching them in both geometries by number. </div><div><br></div><div>If there was some other transformation, like spinning points in rings and reordering rings, for non-uniform on x and y scaling you will have to go brute force, trying to match some, preferably longest, edge of outer ring in first polygon to every edge of outer ring in second. </div><div><br></div><div>If scale was uniform, but one polygon was simplified, you can match endpoints of ST_LongestLine(geom, geom), choosing rotation minimizing ST_SymDifference area. <br><br><div class="gmail_quote"><div dir="ltr">On нд, 29 ліп 2018, 19:46 Rhys A.D. Stewart <<a href="mailto:rhys.stewart@gmail.com">rhys.stewart@gmail.com</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">Greetings folks,<br>
<br>
Lets say I have two polygons, A and B. These polygons are identical<br>
(I.E. st_astext(A) = st_astext(B) is true, vertex for vertex clones).<br>
If I were to move (both translate and rotate)  B somewhere else (using<br>
QGIS for example) is it possible to generate the transformation<br>
matrixthat could be used in st_affine to accomplish the same using<br>
postgis?<br>
<br>
<br>
Regards,<br>
<br>
Rhys<br>
Peace & Love|Live Long & Prosper<br>
_______________________________________________<br>
postgis-users mailing list<br>
<a href="mailto:postgis-users@lists.osgeo.org" target="_blank">postgis-users@lists.osgeo.org</a><br>
<a href="https://lists.osgeo.org/mailman/listinfo/postgis-users" rel="noreferrer" target="_blank">https://lists.osgeo.org/mailman/listinfo/postgis-users</a></blockquote></div></div>-- <br><div dir="ltr" class="gmail_signature" data-smartmail="gmail_signature"><div dir="ltr">Darafei Praliaskouski<br>Support me: <a href="http://patreon.com/komzpa">http://patreon.com/komzpa</a></div></div>