[GRASS-user] V.overlay very slow

Hi all,
I'm trying to join a large set of "vectorial tiles" that i have, into a
unique vectorial map. What i'm doing is something like this, for each "tile"
(in the example is called filaN):

v.overlay ainput=sumaFilas atype=area alayer=1 binput=fila6 btype=area
blayer=1 output=sumaFilas2 operator=or olayer=1,0,0
v.db.addcol map=sumaFilas2 layer=1 'columns=union INTEGER'
v.db.update map=sumaFilas2 layer=1 column=union value=1
v.dissolve input=sumaFilas2 output=sumaFilas2 layer=1 column=union
--overwrite
g.remove vect=sumaFilas
g.rename vect=sumaFilas2,sumaFilas

At first, the v.overlay is instant, but when processing the map number 100,
it can be several hours.

Anyone knows an alternate way to do this?
The first solution I adopted was making this by rows of 100 "tiles", and
then joining the rows (what i'm doing in the example above). It worked for
me since i only has todo a "small" map (1 week of processing), but now i
need to do one MUCH more big.

Thanx in advance if anyone knows something.. or not :slight_smile:
Andres
--
View this message in context: http://n2.nabble.com/V-overlay-very-slow-tp4169783p4169783.html
Sent from the Grass - Users mailing list archive at Nabble.com.

If you just want to create one big vector with all features present in several other vectors, try v.patch followed by v.clean.

For cleaning after patching areas, you will need at least to break polygons and remove duplicates. If topology is still not correct, try cleaning small angles at nodes followed by breaking lines, then remove duplicates. If topology is still not correct, snapping vertices may be necessary, here try a very small threshold first. Also see the v.patch manual.

Hope that helps,

Markus

incanus wrote:

Hi all,
I'm trying to join a large set of "vectorial tiles" that i have, into a
unique vectorial map. What i'm doing is something like this, for each "tile"
(in the example is called filaN):

v.overlay ainput=sumaFilas atype=area alayer=1 binput=fila6 btype=area
blayer=1 output=sumaFilas2 operator=or olayer=1,0,0
v.db.addcol map=sumaFilas2 layer=1 'columns=union INTEGER'
v.db.update map=sumaFilas2 layer=1 column=union value=1 v.dissolve input=sumaFilas2 output=sumaFilas2 layer=1 column=union
--overwrite
g.remove vect=sumaFilas
g.rename vect=sumaFilas2,sumaFilas

At first, the v.overlay is instant, but when processing the map number 100,
it can be several hours.

Anyone knows an alternate way to do this?
The first solution I adopted was making this by rows of 100 "tiles", and
then joining the rows (what i'm doing in the example above). It worked for
me since i only has todo a "small" map (1 week of processing), but now i
need to do one MUCH more big.

Thanx in advance if anyone knows something.. or not :slight_smile:
Andres
  

Thanx again Markus, you always saving me :smiley:

patch followed by v.clean with break,rmdupl and later v.build make it really
fast!

Markus Metz-2 wrote:

If you just want to create one big vector with all features present in
several other vectors, try v.patch followed by v.clean.

For cleaning after patching areas, you will need at least to break
polygons and remove duplicates. If topology is still not correct, try
cleaning small angles at nodes followed by breaking lines, then remove
duplicates. If topology is still not correct, snapping vertices may be
necessary, here try a very small threshold first. Also see the v.patch
manual.

Hope that helps,

Markus

incanus wrote:

Hi all,
I'm trying to join a large set of "vectorial tiles" that i have, into a
unique vectorial map. What i'm doing is something like this, for each
"tile"
(in the example is called filaN):

v.overlay ainput=sumaFilas atype=area alayer=1 binput=fila6 btype=area
blayer=1 output=sumaFilas2 operator=or olayer=1,0,0
v.db.addcol map=sumaFilas2 layer=1 'columns=union INTEGER'
v.db.update map=sumaFilas2 layer=1 column=union value=1
v.dissolve input=sumaFilas2 output=sumaFilas2 layer=1 column=union
--overwrite
g.remove vect=sumaFilas
g.rename vect=sumaFilas2,sumaFilas

At first, the v.overlay is instant, but when processing the map number
100,
it can be several hours.

Anyone knows an alternate way to do this?
The first solution I adopted was making this by rows of 100 "tiles", and
then joining the rows (what i'm doing in the example above). It worked
for
me since i only has todo a "small" map (1 week of processing), but now i
need to do one MUCH more big.

Thanx in advance if anyone knows something.. or not :slight_smile:
Andres
  

_______________________________________________
grass-user mailing list
grass-user@lists.osgeo.org
http://lists.osgeo.org/mailman/listinfo/grass-user

--
View this message in context: http://n2.nabble.com/V-overlay-very-slow-tp4169783p4170405.html
Sent from the Grass - Users mailing list archive at Nabble.com.

By the way,
i don't know if what i've done is correct and can be a usefull "trick", or
it's a rookie mistake, or a casuality. I hope someone knows why this
happens, and could help anyone.

This is:

After trying the "v.patch, v.clean(break,rmdupl), v.build" thing, it was the
moment to create a new column for all geometries, in order to run
v.dissolve.
Then, v.dissolve doesn't worked. I see that v.info gives different
information (number of boundaries, areas, islands...) of the "same" map,
obtained from v.overlay's or v.patch,v.clean...

Then, I've tryed this:
   v.patch input=quad1,quad2,quad3.............quadN output=quadS
   v.overlay ainput=quadS binput=quadS operation=or output=MAP

And then, I've obtained the same map that running
   v.overlay quad1 or quad2 -> sum
   v.overlay quad3 or sum -> sum
   ....
   v.overlay quadN or sum -> MAP

but MUCH MORE FASTER, obviously.

After that, I passed that MAP to create the common column and running
v.dissolve, getting the right result.
--
View this message in context: http://n2.nabble.com/V-overlay-very-slow-tp4169783p4175821.html
Sent from the Grass - Users mailing list archive at Nabble.com.

incanus wrote:

By the way,
i don't know if what i've done is correct and can be a usefull "trick", or
it's a rookie mistake, or a casuality. I hope someone knows why this
happens, and could help anyone.

This is:

After trying the "v.patch, v.clean(break,rmdupl), v.build" thing,

v.build is not needed after v.clean.

it was the
moment to create a new column for all geometries, in order to run
v.dissolve.
Then, v.dissolve doesn't worked. I see that v.info gives different
information (number of boundaries, areas, islands...) of the "same" map,
obtained from v.overlay's or v.patch,v.clean...
  

Can you post that information, or better the output of v.build for each map (not all the input maps, only the results of v.patch and v.overlay)? Look out for "number of incorrect boundaries", "number of duplicate centroids" and "number of centroids outside area", that means that there is still something wrong with vector topology.

Markus M

that's an example with quad3 + quad4

############OUTPUT OF V.PATCH

Patching vector map <quad3@andresfr@andresfr>...

42 primitives registered
922 vertices registered
Building areas...
26 areas built
24 isles built
Attaching islands...
Attaching centroids...
Number of nodes: 40
Number of primitives: 42
Number of points: 0
Number of lines: 0
Number of boundaries: 26
Number of centroids: 16
Number of areas: 26
Number of isles: 24
Number of areas without centroid: 10
Intersections at borders will have to be snapped
Lines common between files will have to be edited
The header information also may have to be edited
v.patch complete. 2 vector maps patched
Patching vector map <quad4@andresfr@andresfr>...
Building topology for vector map <test>...
Registering primitives...

#########OUTPUT OF V.OVERLAY

Copying vector objects from vector map <quad3@andresfr>...
Copying vector objects from vector map <quad4@andresfr>...
Collecting input attributes...
Collecting input attributes...
Building partial topology...
Building topology for vector map <test2>...
Registering primitives...
26 primitives registered
906 vertices registered
Number of nodes: 24
Number of primitives: 26
Number of points: 0
Number of lines: 0
Number of boundaries: 26
Number of centroids: 0
Number of areas: -
Number of isles: -
Breaking lines...
Removing duplicates...
Cleaning boundaries at nodes...
26 areas built
Attaching islands...
Number of primitives: 37
Number of lines: 0
Querying vector map <quad3@andresfr>...
Number of nodes: 47
Building topology for vector map <test2>...
47 primitives registered
22 isles built
Attaching centroids...
Number of nodes: 43
Number of points: 0
Number of areas: 26
Number of isles: 22
v.overlay complete.

Number of areas without centroid: 10
Number of lines: 0
Number of boundaries: 31
Number of centroids: 16
Number of primitives: 47

Attaching islands...
26 areas built
925 vertices registered
Building areas...
Registering primitives...

Rebuilding topology...
Number of areas: 26
Number of isles: 22
Number of areas without centroid: 10

Number of primitives: 53
Number of points: 0
Number of lines: 0
Number of boundaries: 37
Number of centroids: 16

Attaching centroids...
Building topology for vector map <test2>...
Attaching centroids...

Writing centroids...

Querying vector map <quad4@andresfr>...

Number of boundaries: 37
Number of centroids: 0
Number of areas: 26
Number of isles: 22
Number of areas without centroid: 26

Number of points: 0

Number of nodes: 31

22 isles built

Attaching islands...
Building topology for vector map <test2>...
Building areas...

Markus Metz-2 wrote:

incanus wrote:

By the way,
i don't know if what i've done is correct and can be a usefull "trick",
or
it's a rookie mistake, or a casuality. I hope someone knows why this
happens, and could help anyone.

This is:

After trying the "v.patch, v.clean(break,rmdupl), v.build" thing,

v.build is not needed after v.clean.

it was the
moment to create a new column for all geometries, in order to run
v.dissolve.
Then, v.dissolve doesn't worked. I see that v.info gives different
information (number of boundaries, areas, islands...) of the "same" map,
obtained from v.overlay's or v.patch,v.clean...
  

Can you post that information, or better the output of v.build for each
map (not all the input maps, only the results of v.patch and v.overlay)?
Look out for "number of incorrect boundaries", "number of duplicate
centroids" and "number of centroids outside area", that means that there
is still something wrong with vector topology.

Markus M

_______________________________________________
grass-user mailing list
grass-user@lists.osgeo.org
http://lists.osgeo.org/mailman/listinfo/grass-user

--
View this message in context: http://n2.nabble.com/V-overlay-very-slow-tp4169783p4176118.html
Sent from the Grass - Users mailing list archive at Nabble.com.

Um, sorry, I was looking for the output of v.build for the cleaned result of v.patch and for the overlay result, I'm not (yet) interested in the output of v.patch and v.overlay.

What I'm looking for is the output of
v.build map=patched_and_cleaned_map
and
v.build map=overlay_map

incanus wrote:

that's an example with quad3 + quad4

############OUTPUT OF V.PATCH

Patching vector map <quad3@andresfr@andresfr>...

42 primitives registered
922 vertices registered
Building areas...
26 areas built
24 isles built
Attaching islands...
Attaching centroids...
Number of nodes: 40
Number of primitives: 42
Number of points: 0
Number of lines: 0
Number of boundaries: 26
Number of centroids: 16
Number of areas: 26
Number of isles: 24
Number of areas without centroid: 10
Intersections at borders will have to be snapped
Lines common between files will have to be edited
The header information also may have to be edited
v.patch complete. 2 vector maps patched
Patching vector map <quad4@andresfr@andresfr>...
Building topology for vector map <test>...
Registering primitives...

#########OUTPUT OF V.OVERLAY

Copying vector objects from vector map <quad3@andresfr>...
Copying vector objects from vector map <quad4@andresfr>...
Collecting input attributes...
Building partial topology...
Building topology for vector map <test2>...
Registering primitives...
26 primitives registered
906 vertices registered
Number of nodes: 24
Number of primitives: 26
Number of points: 0
Number of lines: 0
Number of boundaries: 26
Number of centroids: 0
Number of areas: -
Number of isles: -
Breaking lines...
Removing duplicates...
Cleaning boundaries at nodes...
26 areas built
Attaching islands...
Number of primitives: 37
Number of lines: 0
Querying vector map <quad3@andresfr>...
Number of nodes: 47
Building topology for vector map <test2>...
47 primitives registered
22 isles built
Attaching centroids...
Number of nodes: 43
Number of points: 0
Number of areas: 26
Number of isles: 22
v.overlay complete.

Number of areas without centroid: 10
Number of lines: 0
Number of boundaries: 31
Number of centroids: 16
Number of primitives: 47

Attaching islands...
26 areas built
925 vertices registered
Building areas...
Registering primitives...

Rebuilding topology...
Number of areas: 26
Number of isles: 22
Number of areas without centroid: 10

Number of primitives: 53
Number of points: 0
Number of lines: 0
Number of boundaries: 37
Number of centroids: 16

Attaching centroids...
Building topology for vector map <test2>...
Attaching centroids...

Writing centroids...

Querying vector map <quad4@andresfr>...

Number of boundaries: 37
Number of centroids: 0
Number of areas: 26
Number of isles: 22
Number of areas without centroid: 26

Number of points: 0

Number of nodes: 31

22 isles built

Attaching islands...
Building topology for vector map <test2>...
Building areas...

Markus Metz-2 wrote:
  

incanus wrote:
    

By the way,
i don't know if what i've done is correct and can be a usefull "trick",
or
it's a rookie mistake, or a casuality. I hope someone knows why this
happens, and could help anyone.

This is:

After trying the "v.patch, v.clean(break,rmdupl), v.build" thing,
      

v.build is not needed after v.clean.
    

it was the
moment to create a new column for all geometries, in order to run
v.dissolve.
Then, v.dissolve doesn't worked. I see that v.info gives different
information (number of boundaries, areas, islands...) of the "same" map,
obtained from v.overlay's or v.patch,v.clean...
  

Can you post that information, or better the output of v.build for each map (not all the input maps, only the results of v.patch and v.overlay)? Look out for "number of incorrect boundaries", "number of duplicate centroids" and "number of centroids outside area", that means that there is still something wrong with vector topology.

Markus M

_______________________________________________
grass-user mailing list
grass-user@lists.osgeo.org
http://lists.osgeo.org/mailman/listinfo/grass-user