[GRASS-user] get x,y from <gravity point> of a centroid

Dear list,

how can I get the x,y -coordinates from the of a centroid ?

Regards

Chris


Express yourself instantly with MSN Messenger! MSN Messenger

how can I get the x,y -coordinates from the <gravity point> of a centroid ?

Regards

Chris

Try v.to.db:

http://grass.itc.it/grass63/manuals/html63_user/v.to.db.html

You'll need to add category numbers to your centroids first with v.category if you haven't done so;
v.to.db only reports coordinates for centroids with existing categories.

http://grass.itc.it/grass63/manuals/html63_user/v.category.html

~ Eric.

----------------------------------------

From: chrisbrandt74@hotmail.com
To: epatton@nrcan.gc.ca
Subject: RE: [GRASS-user] get x,y from of a centroid
Date: Fri, 7 Mar 2008 08:17:36 +0000

Hello,

I got the following result when executing the v.category and afterwards the v.to.db for my centroids to load up x,y-coordinates to my database:

updating database ...

More elements of category 4, nothing loaded to DB

More elements of category 2, nothing loaded to DB

More elements of category 3, nothing loaded to DB

More elements of category 5, nothing loaded to DB

More elements of category 6, nothing loaded to DB

More elements of category 7, nothing loaded to DB

More elements of category 8, nothing loaded to DB

More elements of category 9, nothing loaded to DB
8 categories read from map
8 records selected from table
0 categories read from map exist in selection from table
0 categories read from map don't exist in selection from table
0 records updated/inserted
0 update/insert errors
8 categories with more points (coordinates not loaded)

Any ideas what went wrong?

Regards

Christian

----------------------------------------

Subject: RE: [GRASS-user] get x,y from of a centroid
Date: Thu, 6 Mar 2008 11:53:22 -0500
From: epatton@nrcan.gc.ca
To: chrisbrandt74@hotmail.com; grass-user@lists.osgeo.org

how can I get the x,y -coordinates from the of a centroid ?

Regards

Chris

Try v.to.db:

http://grass.itc.it/grass63/manuals/html63_user/v.to.db.html

You'll need to add category numbers to your centroids first with v.category if you haven't done so;
v.to.db only reports coordinates for centroids with existing categories.

http://grass.itc.it/grass63/manuals/html63_user/v.category.html

~ Eric.

_________________________________________________________________
Express yourself instantly with MSN Messenger! Download today it's FREE!
http://messenger.msn.click-url.com/go/onm00200471ave/direct/01/

_________________________________________________________________
Express yourself instantly with MSN Messenger! Download today it's FREE!
http://messenger.msn.click-url.com/go/onm00200471ave/direct/01/

On 07/03/08 09:19, christian Brandt wrote:

----------------------------------------

From: chrisbrandt74@hotmail.com
To: epatton@nrcan.gc.ca
Subject: RE: [GRASS-user] get x,y from of a centroid
Date: Fri, 7 Mar 2008 08:17:36 +0000

Hello,

I got the following result when executing the v.category and afterwards the v.to.db for my centroids to load up x,y-coordinates to my database:

updating database ...

More elements of category 4, nothing loaded to DB

More elements of category 2, nothing loaded to DB

More elements of category 3, nothing loaded to DB

More elements of category 5, nothing loaded to DB

More elements of category 6, nothing loaded to DB

More elements of category 7, nothing loaded to DB

More elements of category 8, nothing loaded to DB

More elements of category 9, nothing loaded to DB
8 categories read from map
8 records selected from table
0 categories read from map exist in selection from table
0 categories read from map don't exist in selection from table
0 records updated/inserted
0 update/insert errors
8 categories with more points (coordinates not loaded)

Any ideas what went wrong?

Yes, apparently you have more than one centroid in each category. GRASS, therefore, doesn't know which x,y-coordinates to use in a given category as it has the choice between several.

You will have to create unique categories for your centroids. If you don't want to change the current category values, you could add a second layer and create unique category values there.

Moritz