I have a situation where I need to find out if a geometry being imported into a postGIS 2.1 database matches one drawn previously (i.e we want to know if the imported geometry is less up-to-date than the existing one).
I thought I could use st_equals for this, but it isn't working as expected.
This is the code I am using to find if the new geometry exists:
SELECT id FROM "GeomArchive" WHERE st_equals(geom, st_geometryfromtext(wkt,4326)however, it always returns false even when I pass in a geometry extracted from the "GeomArchive" table.
I saw this question, but the solution didn't help.
I find "=" works, which seems to make it unlikely that the problem is with rounding, since I would have expected a false result with this as well.
I'm not sure what "=" compares. Something I read in the pg documentation seemed to indicate that it actually only compares bounding boxes.
Anyway, I'd be grateful for an explanation as to why st_equals isn't working in this situation and if there's any way of getting it to work.
أكثر...
I thought I could use st_equals for this, but it isn't working as expected.
This is the code I am using to find if the new geometry exists:
SELECT id FROM "GeomArchive" WHERE st_equals(geom, st_geometryfromtext(wkt,4326)however, it always returns false even when I pass in a geometry extracted from the "GeomArchive" table.
I saw this question, but the solution didn't help.
I find "=" works, which seems to make it unlikely that the problem is with rounding, since I would have expected a false result with this as well.
I'm not sure what "=" compares. Something I read in the pg documentation seemed to indicate that it actually only compares bounding boxes.
Anyway, I'd be grateful for an explanation as to why st_equals isn't working in this situation and if there's any way of getting it to work.
أكثر...