Hello everybody,
I’m working with cadastre information and I’ve got the next problem. I’ve the polygons that represent the plots of the houses but without any attribute. I’ve also the points with the attributes of the previous polygons. That I would like to do is to add the attributes of the points to the polygons. Has anybody got any idea how to do it?
Thanks
Nuevo Windows Live, un mundo lleno de posibilidades Descúbrelo.
xavier garcia acosta wrote:
Hello everybody,
I'm working with cadastre information and I've got the next problem. I've the polygons that represent the plots of the houses but without any attribute. I've also the points with the attributes of the previous polygons. That I would like to do is to add the attributes of the points to the polygons. Has anybody got any idea how to do it?
Are these GRASS vectors? If so, then "polygons" do not have attributes. An area feature is made of closed boundary lines and the centroid. The boundary lines can belong to several areas, so attributes that are attached to the boundary lines do not represent a particular area. The centroid, on the other hand, will exactly correspond to the area.
So, if I understand your question, all you have to do is merge the two vectors (v.patch), then convert the points to centroids (v.type) and you're done. The points as centroids already hold the attributes.
Thanks
Nuevo Windows Live, un mundo lleno de posibilidades Descu'brelo. <http://www.microsoft.com/windows/windowslive/default.aspx>
This mail was received via Mail-SeCure System.
------------------------------------------------------------------------
_______________________________________________
grass-user mailing list
grass-user@lists.osgeo.org
http://lists.osgeo.org/mailman/listinfo/grass-user
This mail was received via Mail-SeCure System.
Yes, you have understood my question. I’ve tried that you have recommended to my and now I have the next problem, I’ve tried to do “v.patch” with the option “copy also attribute table” with my two GRASS vector maps and I have the error “Number of columns differ”. Do you know how can I solve this?
Xavier
Date: Thu, 25 Jun 2009 13:00:35 +0300
From: micha@arava.co.il
To: epistacio@hotmail.com
CC: grass-user@lists.osgeo.org
Subject: Re: [GRASS-user] Point attributes to a polygons
xavier garcia acosta wrote:
Hello everybody,
I’m working with cadastre information and I’ve got the next problem.
I’ve the polygons that represent the plots of the houses but without
any attribute. I’ve also the points with the attributes of the
previous polygons. That I would like to do is to add the attributes of
the points to the polygons. Has anybody got any idea how to do it?
Are these GRASS vectors? If so, then “polygons” do not have attributes.
An area feature is made of closed boundary lines and the centroid. The
boundary lines can belong to several areas, so attributes that are
attached to the boundary lines do not represent a particular area. The
centroid, on the other hand, will exactly correspond to the area.
So, if I understand your question, all you have to do is merge the two
vectors (v.patch), then convert the points to centroids (v.type) and
you’re done. The points as centroids already hold the attributes.
Thanks
Nuevo Windows Live, un mundo lleno de posibilidades Descu’brelo.
http://www.microsoft.com/windows/windowslive/default.aspx
This mail was received via Mail-SeCure System.
grass-user mailing list
grass-user@lists.osgeo.org
http://lists.osgeo.org/mailman/listinfo/grass-user
This mail was received via Mail-SeCure System.
Charlas más divertidas con el nuevo Windows Live Messenger
xavier garcia acosta wrote:
Yes, you have understood my question. I've tried that you have recommended to my and now I have the next problem, I've tried to do “v.patch” with the option “copy also attribute table” with my two GRASS vector maps and I have the error “Number of columns differ”. Do you know how can I solve this?
Yes you're right.
To get this correct you have to add an (empty) attribute table with exactly the same columns to the boundary vector first. So:
db.describe <your_point_vector> (to get the exact column types)
v.db.addtable <your_line_vector> column="col1 datatype, col2 datatype, ..."
then you succeed with:
v.patch -e <your_point_Vector>,<your_line_vector> out=tmp_patch
v.type tmp_patch out=point_line_vector
The output to v.type should show that you have boundaries and centroids. Check attributes with
v.db.select <your_line_vector>
--
Micha
Xavier
> Date: Thu, 25 Jun 2009 13:00:35 +0300
> From: micha@arava.co.il
> To: epistacio@hotmail.com
> CC: grass-user@lists.osgeo.org
> Subject: Re: [GRASS-user] Point attributes to a polygons
>
> xavier garcia acosta wrote:
>
> > Hello everybody,
> >
> > I'm working with cadastre information and I've got the next problem.
> > I've the polygons that represent the plots of the houses but without
> > any attribute. I've also the points with the attributes of the
> > previous polygons. That I would like to do is to add the attributes of
> > the points to the polygons. Has anybody got any idea how to do it?
> >
> Are these GRASS vectors? If so, then "polygons" do not have attributes.
> An area feature is made of closed boundary lines and the centroid. The
> boundary lines can belong to several areas, so attributes that are
> attached to the boundary lines do not represent a particular area. The
> centroid, on the other hand, will exactly correspond to the area.
>
> So, if I understand your question, all you have to do is merge the two
> vectors (v.patch), then convert the points to centroids (v.type) and
> you're done. The points as centroids already hold the attributes.
>
> > Thanks
> >
> > Nuevo Windows Live, un mundo lleno de posibilidades Descu'brelo.
> > <http://www.microsoft.com/windows/windowslive/default.aspx>
> >
> > This mail was received via Mail-SeCure System.
> > ------------------------------------------------------------------------
> >
> > _______________________________________________
> > grass-user mailing list
> > grass-user@lists.osgeo.org
> > http://lists.osgeo.org/mailman/listinfo/grass-user
> >
> > This mail was received via Mail-SeCure System.
> >
>
Charlas ma's divertidas con el nuevo Windows Live Messenger <http://download.live.com>
This mail was received via Mail-SeCure System.
------------------------------------------------------------------------
_______________________________________________
grass-user mailing list
grass-user@lists.osgeo.org
http://lists.osgeo.org/mailman/listinfo/grass-user
This mail was received via Mail-SeCure System.
Micha Silver wrote:
xavier garcia acosta wrote:
Yes, you have understood my question. I've tried that you have recommended to my and now I have the next problem, I've tried to do “v.patch” with the option “copy also attribute table” with my two GRASS vector maps and I have the error “Number of columns differ”. Do you know how can I solve this?
Yes you're right.
To get this correct you have to add an (empty) attribute table with exactly the same columns to the boundary vector first. So:
db.describe <your_point_vector> (to get the exact column types)
v.db.addtable <your_line_vector> column="col1 datatype, col2 datatype, ..."
then you succeed with:
v.patch -e <your_point_Vector>,<your_line_vector> out=tmp_patch
v.type tmp_patch out=point_line_vector
The output to v.type should show that you have boundaries and centroids. Check attributes with
v.db.select <your_line_vector>
Ooops, typo, sorry.
That last line should be
v.db.select <point_line_vector>
On 25/06/09 10:58, xavier garcia acosta wrote:
Hello everybody,
I'm working with cadastre information and I've got the next problem. I've the polygons that represent the plots of the houses but without any attribute. I've also the points with the attributes of the previous polygons. That I would like to do is to add the attributes of the points to the polygons. Has anybody got any idea how to do it?
If the points are within the polygons, you can also try with v.distance from=points to=polygons [...] upload=to_attr to_column=cat to load the cat values of the polygons into the attribute table of the points. Then you can use v.db.connect to connect the attribute table of the points to that of the polygons via the polygon cat value. You might want to copy the table (db.copy) before connecting it, in order not to use the same attribute table with the points and polygon layer (if you erase one of the two layers, you will also erase the attribute table...).
Moritz