[GRASS-user] Point attributes to a polygons

Micha Silver micha at arava.co.il
Thu Jun 25 09:35:19 EDT 2009


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 at arava.co.il
> > To: epistacio at hotmail.com
> > CC: grass-user at 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 at 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 at lists.osgeo.org
> http://lists.osgeo.org/mailman/listinfo/grass-user
>
> This mail was received via Mail-SeCure System.
>
>
>   




More information about the grass-user mailing list