Equality in postgis

المشرف العام

Administrator
طاقم الإدارة
I tried some functions in postgis. Scope of work, get the equality of two shapes, indipendently of their orientation inthe space. I detect the shapes from autocad and of course in lifetime of a project, can happen that two shapes in twodifferent draws are oriented int different way. so i tried the very first relationship, get difference of mirrored shapes(this was my very first trouble):

select st_equals(ST_GeomFromEWKT('TRIANGLE ((0 0, 5 10, 30 0, 0 0))'),ST_GeomFromEWKT('TRIANGLE ((0 0, 5 -10, 30 0, 0 0))')) And i get False. Perfect.But I was not more happy, when i just tried to rotate the geometry:

select st_equals(ST_GeomFromEWKT('TRIANGLE ((0 0, 5 10, 30 0, 0 0))'),ST_GeomFromEWKT('TRIANGLE ((0 0, -10 5, 0 30, 0 0))'))
These are the same triangle, just rotate of 90

أكثر...
 
أعلى