<div dir="ltr"><div>Ciao Vero,</div><div><br></div><div>shapefile is not a good choice in this case for exporting such geometry because is not apt to store topological information. You may want to export your dataset in a different format, e.g. geopackage.</div><div><br></div><div>Hope this helps,<br></div></div><br><div class="gmail_quote"><div dir="ltr" class="gmail_attr">On Tue, May 14, 2019 at 11:47 PM Veronica Andreo <<a href="mailto:veroandreo@gmail.com">veroandreo@gmail.com</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex"><div dir="ltr"><div dir="ltr"><div>Hi all,</div><div><br></div><div>I was working today with a very simple vector map which corresponds to clusters (circular polygons) that overlap and it is just fine that they overlap. So, i received a shapefile with 3 of these clusters. Two of them overlaped. When I import them into GRASS with v.import I get an extra centroid and area where 2 of the polygons overlap. <br></div><div><br></div><div>Problem arises when I want to query a raster map with those polygons since originally the attribute table contained only 3 polygons (which is just fine). However, v.what.rast will only upload values for 2 of those three polygons because it finds 2 centroids with the same category, AFAIU.</div><div><br></div><div>I tried with <span id="gmail-m_-5293045638171711633gmail-m_-4881497591274067376gmail-:4u.co" class="gmail-m_-5293045638171711633gmail-m_-4881497591274067376gmail-tL8wMe gmail-m_-5293045638171711633gmail-m_-4881497591274067376gmail-EMoHub" style="text-align:left" dir="ltr"><br></span></div><div><span id="gmail-m_-5293045638171711633gmail-m_-4881497591274067376gmail-:4u.co" class="gmail-m_-5293045638171711633gmail-m_-4881497591274067376gmail-tL8wMe gmail-m_-5293045638171711633gmail-m_-4881497591274067376gmail-EMoHub" style="text-align:left" dir="ltr"><br></span></div><div><span id="gmail-m_-5293045638171711633gmail-m_-4881497591274067376gmail-:4u.co" class="gmail-m_-5293045638171711633gmail-m_-4881497591274067376gmail-tL8wMe gmail-m_-5293045638171711633gmail-m_-4881497591274067376gmail-EMoHub" style="text-align:left" dir="ltr">v.clean input=clusters output=clusters_clean1 tool=break,rmdupl,rmsa,rmdac<br></span></div><div><span id="gmail-m_-5293045638171711633gmail-m_-4881497591274067376gmail-:4u.co" class="gmail-m_-5293045638171711633gmail-m_-4881497591274067376gmail-tL8wMe gmail-m_-5293045638171711633gmail-m_-4881497591274067376gmail-EMoHub" style="text-align:left" dir="ltr"><br></span></div><div><span id="gmail-m_-5293045638171711633gmail-m_-4881497591274067376gmail-:4u.co" class="gmail-m_-5293045638171711633gmail-m_-4881497591274067376gmail-tL8wMe gmail-m_-5293045638171711633gmail-m_-4881497591274067376gmail-EMoHub" style="text-align:left" dir="ltr">and <br></span></div><div><span id="gmail-m_-5293045638171711633gmail-m_-4881497591274067376gmail-:4u.co" class="gmail-m_-5293045638171711633gmail-m_-4881497591274067376gmail-tL8wMe gmail-m_-5293045638171711633gmail-m_-4881497591274067376gmail-EMoHub" style="text-align:left" dir="ltr"><span id="gmail-m_-5293045638171711633gmail-:4u.co" class="gmail-m_-5293045638171711633gmail-tL8wMe gmail-m_-5293045638171711633gmail-EMoHub" style="text-align:left" dir="ltr"><br></span></span></div><div><span id="gmail-m_-5293045638171711633gmail-m_-4881497591274067376gmail-:4u.co" class="gmail-m_-5293045638171711633gmail-m_-4881497591274067376gmail-tL8wMe gmail-m_-5293045638171711633gmail-m_-4881497591274067376gmail-EMoHub" style="text-align:left" dir="ltr"><span id="gmail-m_-5293045638171711633gmail-:4u.co" class="gmail-m_-5293045638171711633gmail-tL8wMe gmail-m_-5293045638171711633gmail-EMoHub" style="text-align:left" dir="ltr">v.clean input=clusters type=centroid output=clusters_clean2 tool=rmdupl</span></span></div><div><span id="gmail-m_-5293045638171711633gmail-m_-4881497591274067376gmail-:4u.co" class="gmail-m_-5293045638171711633gmail-m_-4881497591274067376gmail-tL8wMe gmail-m_-5293045638171711633gmail-m_-4881497591274067376gmail-EMoHub" style="text-align:left" dir="ltr"><span id="gmail-m_-5293045638171711633gmail-:4u.co" class="gmail-m_-5293045638171711633gmail-tL8wMe gmail-m_-5293045638171711633gmail-EMoHub" style="text-align:left" dir="ltr"><br></span></span></div><div><span id="gmail-m_-5293045638171711633gmail-m_-4881497591274067376gmail-:4u.co" class="gmail-m_-5293045638171711633gmail-m_-4881497591274067376gmail-tL8wMe gmail-m_-5293045638171711633gmail-m_-4881497591274067376gmail-EMoHub" style="text-align:left" dir="ltr"></span></div><div><span id="gmail-m_-5293045638171711633gmail-m_-4881497591274067376gmail-:4u.co" class="gmail-m_-5293045638171711633gmail-m_-4881497591274067376gmail-tL8wMe gmail-m_-5293045638171711633gmail-m_-4881497591274067376gmail-EMoHub" style="text-align:left" dir="ltr">but nothing seemed to do the kind of cleaning I wanted. I ended up using brute force and removing the extra centroid manually in the GUI. That helped with v.what.rast (all cats in the attr table were updated) but part of the original and correct geometry was clearly gone. I am sure that's not the right combination nor the right way either. <br></span></div><div><span id="gmail-m_-5293045638171711633gmail-m_-4881497591274067376gmail-:4u.co" class="gmail-m_-5293045638171711633gmail-m_-4881497591274067376gmail-tL8wMe gmail-m_-5293045638171711633gmail-m_-4881497591274067376gmail-EMoHub" style="text-align:left" dir="ltr"><br></span></div><div><span id="gmail-m_-5293045638171711633gmail-m_-4881497591274067376gmail-:4u.co" class="gmail-m_-5293045638171711633gmail-m_-4881497591274067376gmail-tL8wMe gmail-m_-5293045638171711633gmail-m_-4881497591274067376gmail-EMoHub" style="text-align:left" dir="ltr">In the wiki [0], I only found this piece of text: "If the <b>input polygons have logical errors</b>.... You can investigate overlapping areas in the imported vector with '<span class="gmail-m_-5293045638171711633gmail-plainlinks"><a rel="nofollow" class="gmail-m_-5293045638171711633external gmail-m_-5293045638171711633gmail-text" href="https://grass.osgeo.org/grass76/manuals/d.vect.html" target="_blank">d.vect</a></span>
 yourmap type=area layer=2' (only overlapping areas have a category in 
layer 2 after import). Additionally you may show the centroids of 
layer=2 to easier find tiny overlapping areas with '<span class="gmail-m_-5293045638171711633gmail-plainlinks"><a rel="nofollow" class="gmail-m_-5293045638171711633external gmail-m_-5293045638171711633gmail-text" href="https://grass.osgeo.org/grass76/manuals/d.vect.html" target="_blank">d.vect</a></span> yourmap type=centroid layer=2'" <br></span></div><div><span id="gmail-m_-5293045638171711633gmail-m_-4881497591274067376gmail-:4u.co" class="gmail-m_-5293045638171711633gmail-m_-4881497591274067376gmail-tL8wMe gmail-m_-5293045638171711633gmail-m_-4881497591274067376gmail-EMoHub" style="text-align:left" dir="ltr"><br></span></div><div><span id="gmail-m_-5293045638171711633gmail-m_-4881497591274067376gmail-:4u.co" class="gmail-m_-5293045638171711633gmail-m_-4881497591274067376gmail-tL8wMe gmail-m_-5293045638171711633gmail-m_-4881497591274067376gmail-EMoHub" style="text-align:left" dir="ltr">However, it says nothing about how to proceed further as to keep correctly overlapping polygons, each with its own centroid and remove the duplicated ones that are generated when importing.</span></div><div><span id="gmail-m_-5293045638171711633gmail-m_-4881497591274067376gmail-:4u.co" class="gmail-m_-5293045638171711633gmail-m_-4881497591274067376gmail-tL8wMe gmail-m_-5293045638171711633gmail-m_-4881497591274067376gmail-EMoHub" style="text-align:left" dir="ltr"><br></span></div><div><span id="gmail-m_-5293045638171711633gmail-m_-4881497591274067376gmail-:4u.co" class="gmail-m_-5293045638171711633gmail-m_-4881497591274067376gmail-tL8wMe gmail-m_-5293045638171711633gmail-m_-4881497591274067376gmail-EMoHub" style="text-align:left" dir="ltr">Can someone please share the set of steps that should be followed in these cases? Maybe it's a silly question, but I'm more a raster person so I am very easily lost with vector issues.</span></div><div><span id="gmail-m_-5293045638171711633gmail-m_-4881497591274067376gmail-:4u.co" class="gmail-m_-5293045638171711633gmail-m_-4881497591274067376gmail-tL8wMe gmail-m_-5293045638171711633gmail-m_-4881497591274067376gmail-EMoHub" style="text-align:left" dir="ltr"><br></span></div><div><span id="gmail-m_-5293045638171711633gmail-m_-4881497591274067376gmail-:4u.co" class="gmail-m_-5293045638171711633gmail-m_-4881497591274067376gmail-tL8wMe gmail-m_-5293045638171711633gmail-m_-4881497591274067376gmail-EMoHub" style="text-align:left" dir="ltr">Thanks much in advance!</span></div><div><span id="gmail-m_-5293045638171711633gmail-m_-4881497591274067376gmail-:4u.co" class="gmail-m_-5293045638171711633gmail-m_-4881497591274067376gmail-tL8wMe gmail-m_-5293045638171711633gmail-m_-4881497591274067376gmail-EMoHub" style="text-align:left" dir="ltr">Vero<br></span></div><div><span id="gmail-m_-5293045638171711633gmail-m_-4881497591274067376gmail-:4u.co" class="gmail-m_-5293045638171711633gmail-m_-4881497591274067376gmail-tL8wMe gmail-m_-5293045638171711633gmail-m_-4881497591274067376gmail-EMoHub" style="text-align:left" dir="ltr"><br></span></div><div><span id="gmail-m_-5293045638171711633gmail-m_-4881497591274067376gmail-:4u.co" class="gmail-m_-5293045638171711633gmail-m_-4881497591274067376gmail-tL8wMe gmail-m_-5293045638171711633gmail-m_-4881497591274067376gmail-EMoHub" style="text-align:left" dir="ltr"></span></div><div><span id="gmail-m_-5293045638171711633gmail-m_-4881497591274067376gmail-:4u.co" class="gmail-m_-5293045638171711633gmail-m_-4881497591274067376gmail-tL8wMe gmail-m_-5293045638171711633gmail-m_-4881497591274067376gmail-EMoHub" style="text-align:left" dir="ltr">[0] <a href="https://grasswiki.osgeo.org/wiki/Vector_topology_cleaning" target="_blank">https://grasswiki.osgeo.org/wiki/Vector_topology_cleaning</a><br></span></div></div></div>
_______________________________________________<br>
grass-user mailing list<br>
<a href="mailto:grass-user@lists.osgeo.org" target="_blank">grass-user@lists.osgeo.org</a><br>
<a href="https://lists.osgeo.org/mailman/listinfo/grass-user" rel="noreferrer" target="_blank">https://lists.osgeo.org/mailman/listinfo/grass-user</a></blockquote></div><br clear="all"><br>-- <br><div dir="ltr" class="gmail_signature"><div dir="ltr"><div><div dir="ltr"><div><div dir="ltr"><div><div dir="ltr"><div><font color="#666666">Margherita Di Leo</font></div></div></div></div></div></div></div></div></div>