In helping students with an overlay assignment for my spatial technologies class, it became apparent that they were getting strange results in trying to clip a set of state-wide soil and geology maps with the boundary of a national forest here in Arizona. A series of soil and geology polygons simply were not being clipped--i.e., ignored by v.cutter.
Last night I did a lot of exploratory work and finally realized that this is due to a known bug in v.cutter. According to the manual...
- - - -
BUGS
There are a few rare situations that are not currently handled correctly. These mostly involve nodes or vertices intersecting exactly with lines of the opposite map. You will know you have hit one of these cases because a lot of strange text will start spitting out.
Borders between areas with the same attributes are not dissolved.
There are many places where the code could be optimized greatly.
- - - -
It turns out that the soil and geology polygons stop at the Arizona state border. The National Forest boundary also stops at the Arizona state border. This apparently is enough of an overlap to cause v.cutter to ignore those polygons.
v.cutter is one of the few and very important geoprocessing tools in the GRASS vector toolbox. IMHO, it is important for it to work correctly. I don't know if this bug is corrected in version 5.7 (hopefully Radim can enlighten here). However, I want to make a plea that it be fixed if possible in both 5.3 and 5.7.
Thanks.
Michael
______________________________
Michael Barton, Professor & Curator
Department of Anthropology
Arizona State University
Tempe, AZ 85287-2402
USA
voice: 480-965-6262; fax: 480-965-7671
On Wed, Mar 10, 2004 at 10:23:30AM -0700, Michael Barton wrote:
[...]
v.cutter is one of the few and very important geoprocessing tools in
the GRASS vector toolbox. IMHO, it is important for it to work
correctly. I don't know if this bug is corrected in version 5.7
(hopefully Radim can enlighten here). However, I want to make a plea
that it be fixed if possible in both 5.3 and 5.7.
In 5.7 there is v.overlay:
http://grass.itc.it/grass57/tutorial/vectoroverlay.html
http://mpa.itc.it/radim/g51/index.html
Maybe your student can simply use GRASS 5.7 where all
such problems are already/almost solved?
Markus
On Wed, Mar 10, 2004 at 10:23:30AM -0700, Michael Barton wrote:
In helping students with an overlay assignment for my spatial
technologies class, it became apparent that they were getting strange
results in trying to clip a set of state-wide soil and geology maps
with the boundary of a national forest here in Arizona. A series of
soil and geology polygons simply were not being clipped--i.e., ignored
by v.cutter.
Last night I did a lot of exploratory work and finally realized that
this is due to a known bug in v.cutter. According to the manual...
FWIW, since in the application I have made we needed v.cutter, and since
unfortunately with the first data I had the bugs were not triggered, I
have had, after leaving my boss and explaining that GRASS was
working, the moral obligation to make this work when new data
triggered the desaster.
After reading the sources (well the whole sources...) I finally
identified the problems and implemented a workaround (v.cutter will be
eventually fixed in KerGIS when I rewrite it in CWEB). If for one reason
or another you can't achieve the result with 5.7, I will provide you
some explanations and a program (that can not be in GRASS since it's BSD
licenced).
Cheers,
--
Thierry Laronde (Alceste) <tlaronde@polynum.org>
Key fingerprint = 0FF7 E906 FBAF FE95 FD89 250D 52B1 AE95 6006 F40C
FWIW, here is an explanation on how to work around the bugs in v.cutter.
1 - don't use the area option since it's the part that is "less"
finished (there are a bunch of TODO comments) => by combining several
calls to the `line' part of v.cutter you can achieve the result;
2 - there are some bugs in v.cutter but there are other bugs in other
programs too, so the work around addresses several distinct problems.
Explanation:
a) Transform both the map `M' to be processed and the cutter map
`C' so that there are only segments (I use David Hilbert's Grundlagen
der Geometrie definitions) that is so:
1. Every `line` is a 2 _distinct_ points entity => no polylines, no
null length lines
2. AB is the same as BA => orientate the segment so that it is
always described in the same point order (this will ease the
suppression of duplicate `lines'...)
b) cut M `lines' with C
c) cut C `lines' with M
d) merge the two resulting maps and clean them
(suppress null lines and duplicates)
=> You will end with a complete result where you can built the areas.
Giving back the original attributes to the child areas is just a matter
of finding (in 5.0/5.3 with v.what) in which original area lies the
new centroid.
Cheers,
--
Thierry Laronde (Alceste) <tlaronde@polynum.org>
http://www.kergis.org/ | http://www.kergis.com/
Key fingerprint = 0FF7 E906 FBAF FE95 FD89 250D 52B1 AE95 6006 F40C