[GRASS-user] How update vector layers?

2009-03-05 Thread Thybério Luna Freire
I have a location with sugarcane areas. They are in a vector layer and each
area have a line in a table in a pg database. There are new areas being
planted in the farm and i have them in a shape file. I imported the new
vectors and i want put them into the layer "sugarcane" to update it. My
question is: how can i do it without interfering in the table structure and
without to need create a new table? I tried v.overlay, but it adds new
columns to the new table and a don't want i new table. Then, i tried
v.patch, but this module is not apropriated to do this. It looks like very
simple to do, but simply don't know how.
Help me!!

Thybério Luna - Brazil
___
grass-user mailing list
grass-user@lists.osgeo.org
http://lists.osgeo.org/mailman/listinfo/grass-user


[GRASS-user] How update vector layers?

2009-03-07 Thread Thybério Luna Freire
Hi Vincent,
I've tried the following command:

v.patch -ae input=sugarcane,sugarcane_update output=sugarcane --o

it returns:
ERROR: Output vector map  is used as input

I'm using the -e and -a flags and overwriting the old vector layer, but the
message is the same.

I'm doing anything wrong?

Both vector maps have exactly the same columns and there aren't identical
attributes:

Cat (integer)
Cane_id(Integer)

thanks,
Thyberio
___
grass-user mailing list
grass-user@lists.osgeo.org
http://lists.osgeo.org/mailman/listinfo/grass-user


[GRASS-user] How update vector layers?

2009-03-07 Thread Thybério Luna Freire
The great problem in create a new map is that there is a database with rules
of integrity. If the table sugarcane is linked to other table by
primary/foreign keys i can't simply delete it and put the new table in your
place. This is my problem. I have to mantain the table sugarcane and keep
updating it, when necessary.

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


Re: [GRASS-user] How update vector layers?

2009-03-06 Thread Vincent Bain
Hi Thybério,

it is actually v.patch that you need to run for this purpose (AFAIU your
problem). v.patch allows to merge several maps with attribute
preservation (-e flag), but it only works for layer 1 features. I
suggest you to check if each linked table has the same columns
definition.

Instead of creating a new "merge" map, you can choose the "append file
to existing file" option (-a flag), then be carefull with the advice
given in the man page : "When using the -a flag, the user has to make
sure that the features in the different maps added to the output map do
not have overlapping category numbers, unless identical category numbers
reflect identical attributes, otherwise the attributes of the added maps
are lost".

After you perform v.patch don't forget to clean your vector (e.g.
removing duplicate features with v.clean)

Good luck,
Vincent

Le jeudi 05 mars 2009 à 21:38 -0300, Thybério Luna Freire a écrit :
> I have a location with sugarcane areas. They are in a vector layer and
> each area have a line in a table in a pg database. There are new areas
> being planted in the farm and i have them in a shape file. I imported
> the new vectors and i want put them into the layer "sugarcane" to
> update it. My question is: how can i do it without interfering in the
> table structure and without to need create a new table? I tried
> v.overlay, but it adds new columns to the new table and a don't want i
> new table. Then, i tried v.patch, but this module is not apropriated
> to do this. It looks like very simple to do, but simply don't know
> how.
> Help me!!
> 
> Thybério Luna - Brazil
> ___
> grass-user mailing list
> grass-user@lists.osgeo.org
> http://lists.osgeo.org/mailman/listinfo/grass-user

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


Re: [GRASS-user] How update vector layers?

2009-03-07 Thread Vincent Bain
If you are sure category values don't overlap, then you can use the -a
flag. But in this case I would NOT give both arguments -a and -e;
i.e. given that the sugarcane map already has a related table, the
features from sugarcane_update will populate the table with new rows (it
is the reason why cat numbers, which tag geometrical features, should be
distinct from previous rows in the sugarcane table)...
Else you can try to create a new map :
v.patch -e in=sugarcane,sugarcane_update out=merge,

If you suspect duplicate objets (e.g. adjacent areas boundaries), don't
forget to run v.clean with the tool rmdupl.

Vincent.


Le samedi 07 mars 2009 à 16:03 -0300, Thybério Luna Freire a écrit :
> Hi Vincent,
> I've tried the following command:
> 
> v.patch -ae input=sugarcane,sugarcane_update output=sugarcane --o
> 
> it returns: 
> ERROR: Output vector map  is used as input
> 
> I'm using the -e and -a flags and overwriting the old vector layer,
> but the message is the same.
> 
> I'm doing anything wrong?
> 
> Both vector maps have exactly the same columns and there aren't
> identical attributes:
> 
> Cat (integer)
> Cane_id(Integer)
> 
> thanks,
> Thyberio
> ___
> grass-user mailing list
> grass-user@lists.osgeo.org
> http://lists.osgeo.org/mailman/listinfo/grass-user

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


Re: [GRASS-user] How update vector layers?

2009-03-07 Thread Markus Neteler
On Sat, Mar 7, 2009 at 8:03 PM, Thybério Luna Freire  wrote:
> Hi Vincent,
> I've tried the following command:
>
> v.patch -ae input=sugarcane,sugarcane_update output=sugarcane --o
>
> it returns:
> ERROR: Output vector map  is used as input

You have to write the output to a new map name.

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


Re: [GRASS-user] How update vector layers?

2009-03-07 Thread Vincent Bain
Having a look at the man page of the v.patch command, I was surprised by
a semantic ambiguity : saying v.patch "Create[s] a new vector map layer
by combining other vector map layers" sounds quite odd, shouldn't we
say :"Create a new vector map by combining other vector maps", given
that only layer 1 is supported ? well, maybe there is no confusion and
I misunderstand something ?

In the current french translation of wxpython GUI, there are several
confusions between these notions of maps and layers*, which IMHO should
be clearly distinguished if we want to show a coherent vector data
model.

Bye,
VB

__
* I know I should keep working on translation files, but for the moment
I'm really over-loaded.



Le samedi 07 mars 2009 à 21:02 +0100, Markus Neteler a écrit :
> On Sat, Mar 7, 2009 at 8:03 PM, Thybério Luna Freire  
> wrote:
> > Hi Vincent,
> > I've tried the following command:
> >
> > v.patch -ae input=sugarcane,sugarcane_update output=sugarcane --o
> >
> > it returns:
> > ERROR: Output vector map  is used as input
> 
> You have to write the output to a new map name.
> 
> Markus
> ___
> grass-user mailing list
> grass-user@lists.osgeo.org
> http://lists.osgeo.org/mailman/listinfo/grass-user
> 

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


Re: [GRASS-user] How update vector layers?

2009-03-07 Thread Markus Neteler
On Sat, Mar 7, 2009 at 9:21 PM, Vincent Bain  wrote:
> Having a look at the man page of the v.patch command, I was surprised by
> a semantic ambiguity : saying v.patch "Create[s] a new vector map layer
> by combining other vector map layers" sounds quite odd, shouldn't we
> say :"Create a new vector map by combining other vector maps", given
> that only layer 1 is supported ?

Yes, fixed everywhere.

> well, maybe there is no confusion and
> I misunderstand something ?

No, it was confusing.

> In the current french translation of wxpython GUI, there are several
> confusions between these notions of maps and layers*, which IMHO should
> be clearly distinguished if we want to show a coherent vector data
> model.

Right - please point out these things as you come across them.

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


Re: [GRASS-user] How update vector layers?

2009-03-08 Thread Vincent Bain
Thybério,
as Markus said, you cannot proceed this way because your output map is
already involved in the patch process. So using the -a option, you must
not include the target map.

Try : v.patch -a -e --overwrite input=sugarcane_update output=sugarcane
To work safely regarding your database structure, I would suggest you to
test on a copy of map sugarcane (again : particularly be sure of
non-overlaping cat values...)

Keep trying, you'll get it !

Vincent

Le samedi 07 mars 2009 à 21:46 -0300, Thybério Luna Freire a écrit :
> The great problem in create a new map is that there is a database with
> rules
> of integrity. If the table sugarcane is linked to other table by
> primary/foreign keys i can't simply delete it and put the new table in
> your
> place. This is my problem. I have to mantain the table sugarcane and
> keep
> updating it, when necessary.
> 
> thyberio
> ___
> grass-user mailing list
> grass-user@lists.osgeo.org
> http://lists.osgeo.org/mailman/listinfo/grass-user

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


Re: [GRASS-user] How update vector layers?

2009-03-08 Thread Thybério Luna Freire
Now it works!!  :-D

The problem was that: the map "sugarcane" can´t be added to the input
parameter, only the update map. A litlle detail, but that give me headache!

Markus and Vincent, because guys like you newbies avoid the temptation (and
costs) of facilities of the ARCGI$.

Congratulations!

thyberio

2009/3/8 Vincent Bain 

> Thybério,
> as Markus said, you cannot proceed this way because your output map is
> already involved in the patch process. So using the -a option, you must
> not include the target map.
>
> Try : v.patch -a -e --overwrite input=sugarcane_update output=sugarcane
> To work safely regarding your database structure, I would suggest you to
> test on a copy of map sugarcane (again : particularly be sure of
> non-overlaping cat values...)
>
> Keep trying, you'll get it !
>
> Vincent
>
> Le samedi 07 mars 2009 à 21:46 -0300, Thybério Luna Freire a écrit :
> > The great problem in create a new map is that there is a database with
> > rules
> > of integrity. If the table sugarcane is linked to other table by
> > primary/foreign keys i can't simply delete it and put the new table in
> > your
> > place. This is my problem. I have to mantain the table sugarcane and
> > keep
> > updating it, when necessary.
> >
> > thyberio
> > ___
> > grass-user mailing list
> > grass-user@lists.osgeo.org
> > http://lists.osgeo.org/mailman/listinfo/grass-user
>
>
___
grass-user mailing list
grass-user@lists.osgeo.org
http://lists.osgeo.org/mailman/listinfo/grass-user