Hi,

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.

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.

If scale was uniform, but one polygon was simplified, you can match
endpoints of ST_LongestLine(geom, geom), choosing rotation minimizing
ST_SymDifference area.

On нд, 29 ліп 2018, 19:46 Rhys A.D. Stewart <[email protected]> wrote:

> Greetings folks,
>
> Lets say I have two polygons, A and B. These polygons are identical
> (I.E. st_astext(A) = st_astext(B) is true, vertex for vertex clones).
> If I were to move (both translate and rotate)  B somewhere else (using
> QGIS for example) is it possible to generate the transformation
> matrixthat could be used in st_affine to accomplish the same using
> postgis?
>
>
> Regards,
>
> Rhys
> Peace & Love|Live Long & Prosper
> _______________________________________________
> postgis-users mailing list
> [email protected]
> https://lists.osgeo.org/mailman/listinfo/postgis-users

-- 
Darafei Praliaskouski
Support me: http://patreon.com/komzpa
_______________________________________________
postgis-users mailing list
[email protected]
https://lists.osgeo.org/mailman/listinfo/postgis-users

Reply via email to