[GRASS-user] Uploading bounding box of vectors to database?

Christian Kaiser Christian.Kaiser at unil.ch
Tue Jan 5 17:09:52 EST 2010


On 5 janv. 2010, at 22:38, Hamish wrote:

> Christian Kaiser wrote:
>> 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?
> 
> 
> 'v.info -g' will give you the bounding box, easy peasy.
> 
> 
> 
> MAP=your_map_name
> 
> v.db.addcol $MAP column="north DOUBLE PRECISION, \
>  south DOUBLE PRECISION, east DOUBLE PRECISION, west DOUBLE PRECISION"
> 
> eval `v.info -g $MAP`
> 
> echo "UPDATE $MAP SET north = $north, south = $south, \
>  east = $east, west = $west" | db.execute
> 
> 
> 
> Hamish
> 


Hamish,

Thank you for your answer. It seems to me that v.info -g prints out the region for all the map. What I would need is the bounding box of EACH geometry (area for instance) in the map, and not the map as a whole. Probably my question was not clear... ;-)

Any idea?

Christian
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.osgeo.org/pipermail/grass-user/attachments/20100105/70d7be55/attachment.html


More information about the grass-user mailing list