[GRASS-user] bug?: v.to.db wrong area

Achim Kisseler ak7 at jupiter.uni-freiburg.de
Mon Dec 7 13:20:15 EST 2009


I made the grid with:

-%<--
v.mkgrid --overwrite map=$1_grid_all grid="$north_south,$east_west"
position=coor coor="$southwest_corner" box="0:30,0:30"

echo "
########################################
## shrink grid to land-surface"
sqlite3 $2 "drop table $1_grid_patched"
v.overlay --o ainput=$1_grid_all binput=$1_area output=$1_grid_patched
v.db.addcol map=$1_grid_patched columns="keep INT"
sqlite3 $2 "UPDATE $1_grid_patched SET keep=1 WHERE (NOT b_cat IS NULL
OR  ((a_row*1000)+a_col) IN (SELECT (a_row*1000)+a_col FROM
$1_grid_patched WHERE NOT b_cat IS NULL))"
v.extract input=$1_grid_patched output=$1_grid_extracted where="keep=1"
--overwrite
v.db.addcol map=$1_grid_extracted columns="dissolve INT"
sqlite3 $2 "UPDATE $1_grid_extracted SET dissolve=((a_row*1000)+a_col)"
v.dissolve --overwrite input=$1_grid_extracted output=$1_grid
column=dissolve layer=1

(...)

sh renew_cats.sh $1_grid 2 centroid
db.droptable -f table=$1_grid
v.db.connect -d map=$1_grid
v.db.addtable map=$1_grid
-%<--

In the picture:
yellow grids seem ok (301.444-279.003 km²)
one is 194.532
the rest is 2.545.231-11.559.210

Achim



Pablo Carreira schrieb:
> Achim, how was the grid generated? Could you put some fo the results here?
> 
> 
> Pablo.
> 
> 
>> Date: Mon, 7 Dec 2009 18:32:14 +0100
>> From: ak7 at jupiter.uni-freiburg.de
>> To: markus.metz.giswork at googlemail.com
>> Subject: Re: [GRASS-user] bug?: v.to.db wrong area
>> CC: grass-user at lists.osgeo.org
>>
>> Hi Markus,
>>
>> its the same with hectares; kilometers writes out the result in
>> square-kilometers.
>>
>> Achim
>>
>> Markus Metz schrieb:
>> >
>> > Achim Kisseler wrote:
>> >> Hi,
>> >>
>> >> I am using
>> >>
>> >> v.to.db map=af_grid option=area columns=area type=centroid
>> >> units=kilometers
>> >>
>> > try units=hectares, kilometers are not an areal unit, don't know why
>> > v.to.db executes at all
>> >
>> > you can cross-check the results by querying the map
>> >
>> > hope that helps,
>> >
>> > Markus M
>> >
>> >> (in GRASS65 opensuse 11.1 64)
>> >>
>> >> to calculate the area size. Some of the areas are very wrong. Its a
> grid
>> >> in lat-lon, where areas should be nearly equal in size.
>> >>
>> >> Is this a known bug? I don't guess so.
>> >> Do I something wrong?
>> >>
>> >> Thanks,
>> >> Achim
>> >>
>> >> PS:
>> >> already did v.clean, r.mask -r (<- should not be have an effect)
>> >> _______________________________________________
>> >> grass-user mailing list
>> >> grass-user at lists.osgeo.org
>> >> http://lists.osgeo.org/mailman/listinfo/grass-user
>> >>
>> >>
>> _______________________________________________
>> grass-user mailing list
>> grass-user at lists.osgeo.org
>> http://lists.osgeo.org/mailman/listinfo/grass-user
> 
> ------------------------------------------------------------------------
> Agora a pressa é amiga da perfeição. Chegou Windows 7. Conheça.
> <http://www.microsoft.com/brasil/windows7/default.html?WT.mc_id=1539>
-------------- nächster Teil --------------
Ein Dateianhang mit Bin?rdaten wurde abgetrennt...
Dateiname   : grids.png
Dateityp    : image/png
Dateigr??e  : 33734 bytes
Beschreibung: nicht verf?gbar
URL         : http://lists.osgeo.org/pipermail/grass-user/attachments/20091207/5747f0fb/grids-0001.png


More information about the grass-user mailing list