Geographic Information Systems Stack Exchange is a question and answer site for cartographers, geographers and GIS professionals. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I have a table made of merged point datasets in PostGIS. I want to select all of the features where two or more points have identical geom values.

At present I just want to select so I can review the associated field values.

share|improve this question
The geometries are now all in the same column? They're simple points, multipoints or something else? – lynxlynxlynx Jul 4 '12 at 11:09
yes, a single table exists, it has simple points with geometries all in the same column – EnE_ Jul 4 '12 at 14:07
up vote 12 down vote accepted

Not all the details are clear, but my general approach would be along these lines:

FROM thetable AS a, thetable AS b
WHERE ST_Equals(a.geom, b.geom) AND <>
share|improve this answer

Something like this:

SELECT,, p1.<other attrib>,,, p2.<other attrib> 
FROM points p1, points p2
WHERE ST_Intersects(p1.geom, p2.geom) AND <>;

Some notes:

  • With a large number of points you'll probably want to implement a spatial index on the table.
  • Also this will find only points that exactly match. Sometimes very small rounding errors can create pairs of points which are essentially overlapping, but the coordinates are different by 0.1 mm or so, and the above will not find that pair. So perhaps wrapping one of the points with a small buffer, or running ST_Dwithin() with a small tolerance might be better.
share|improve this answer

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.