Just a quick idea, when an underlying postgres/postgis database is available:

- use v.out.ogr to import vector data to your postgis database, to testtable
   - now db.connect and db.login
- when connected, something like "echo 'UPDATE testtable SET wkb_geometry=envelope(wkb_geometry)' | db.execute" should work
   - but not yet in the attribute table... (?)

...maybe too difficult.

Christian.






--------------------------------------------------
From: "Christian Kaiser" <christian.kai...@unil.ch>
Sent: Tuesday, January 05, 2010 6:28 PM
To: <grass-us...@lists.osgeo.org>
Subject: [GRASS-user] Uploading bounding box of vectors to database?

Hi everybody,

I would like to do a very simple thing:
upload the bounding box for each geometry (areas, boundaries, lines) to the attribute table.

v.to.db does not seem to provide this functionality. Is there an elegant way for doing this?

Of course, I could write out the map using v.out.ascii in standard format, parse this file using Python and extract the bounding box for each geometry this way. Is probably not very elegant, but could lead to a working Python module.

Or would it be more useful to implement this functionality in v.to.db? (I did never program in C with GRASS, but maybe, I could try with some help...)

Thank you for any suggestion.

Christian Kaiser
_______________________________________________
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

Reply via email to