[GRASS-user] how to clean vector file after reprojection

Moritz Lennert mlennert at club.worldonline.be
Thu Feb 8 06:27:40 EST 2007


On 08/02/07 00:19, Hamish wrote:
> Moritz Lennert wrote:
>>> Yes, try "v.clean tool=snap". Or before reprojection "v.clean
>>> tool=break".
>> 'break' on the source map does not find any intersections to break.
>>
>> 'snap' on target map (v.clean in=nuts2 out=nuts2_snap_0_001 tool=snap 
>> thresh=0.001 - which if I calculated correctly should snap anything 
>> within a bit more than 100 meters) gives me an even worse result (even
>> less areas are recognized):
> 
> 
> try making snap very small in the lat/lon location. The default is
> intended to be 1mm, not 1degX10-3. so try 1e-8. 

tried this, but it makes it worse (thresh=0.000000001):

http://moritz.homelinux.org/grass/target_snap_0_000000001.jpg

> Based on your other
> screenshots what about enlarging the snap thresh to 0.1 or so (in the
> source loc'n) to get those lines to connect before reprojection?

http://moritz.homelinux.org/grass/source_snap_0_1.jpg.jpg

:-(

> I take
> it the same lines do not connect with d.vect+d.zoom?

That is another issue I have: trying to zoom in either in the GIS 
Manager or with d.vect+d.zoom I get CPU overheating (never had that 
before) and memory errors when I get to around 1e-8.

> It is very odd.

Yes. I don't understand the lose edges without nodes...

Actually the original files were shapefiles, and so I finally did the 
reprojection with the shpproj tool from shapelib. I can then import the 
resulting file into a lat-long GRASS location and there are no problems.

...

Exploring this a bit further: I just tried duplicating the cleaning done 
by v.in.ogr by launching:

v.clean in=inmap out=outmap_clean_vinogr 
tool=snap,bpol,rmdupl,break,rmdupl,rmsa,chdangle,rmdangle,chbridge,rmbridge 
thresh=0.000001

And, behold !, I get a perfect map. So, now I have to isolate which of 
the cleaning tools did the job.

Moritz




More information about the grass-user mailing list