<div dir="ltr"><div>Hi<br></div>I have a table with 945361 rows but the geometry (points) are distinct for 201606 locations (i.e., some rows refer to the same point in the space).<br><div><br>SELECT count(*) FROM juli.savannaswdsp;                           -- 945361<br>SELECT  count(DISTINCT geom) FROM juli.savannaswdsp;   -- 201606<br><br><div>Would it be possible to generate a column with codes for the points? that is, like an ID for each point instead for each row (e.g., from 1 to 201606), so rows with the same geom have the same code. <br><br></div><div>[ In R language this would be as follows: as.numeric(as.factor(geom))  ]<br></div><div><br></div><div>Thank for any suggestion<br></div><div><br clear="all"><div><div class="gmail_signature"><div dir="ltr"><div><div dir="ltr"><div><div dir="ltr">Juli<div><span style="color:rgb(51,51,153)">--</span><br><font color="#333399"><b>CIDE, CSIC</b>  |  <a href="http://www.uv.es/jgpausas" target="_blank">www.uv.es/jgpausas</a>  |  <a href="http://jgpausas.blogs.uv.es/" target="_blank">blog</a><br><br></font></div></div></div></div></div></div></div></div>
</div></div></div>