[GRASSLIST:9227] Re: V.drape issues

Dylan Beaudette dylan.beaudette at gmail.com
Sun Nov 27 23:39:53 EST 2005


On Nov 27, 2005, at 11:49 AM, Michael Barton wrote:

> Dylan,
>
>  I tried out v.drape yesterday, using Lorenzo Moretti’s build of 5 
> November. I tried to drape a vector of roads over an SRTM 30m dem.
>
>  My first attempt led to an error that said part of of the map was 
> outside the defined region. The roads are for the entire state of 
> Arizona and the SRTM was for only a part. So I made a vector of the 
> region (co-terminous with the SRTM) and clipped the roads. Then I 
> tried v.drape again using the roads clipped to the region. It 
> generated the error below and seemed to hang. This is being run in an 
> NAD27 UTM location.
>
> v.drape input=roads_chevelon 
> type=point,centroid,line,boundary,face,kernel 
> rast=SRTM_u01_p036r036_filled method=nearest output=roads3d_chevelon
>
>
>  GRASS_INFO_WARNING(684,1): [SRTM_u01_p036r036_filled in aaa2005] - 
> read request for row -18 is outside region
>  row = (int) G_northing_to_row (north, &window);
>  G_get_map_row (fd, maprow, row) < 0
>  DIAG:     Region is: n=3.84547e+06 s=3.77074e+06 e=548379 w=472478
>            Data point is north=3.84602e+06 east=497700
>
>  GRASS_INFO_ERROR(684,2):     Problem reading raster
>  GRASS_INFO_END(684,2)
>
>

Hi Michael, hope you don't mind me posting this to the GRASS list as 
well.

When I put this thing together, I built it around a model something 
like this:
loop through each line in vector
	loop through each point in line
		sample raster at this point with method x
		write sampled z value to vector[line][point]

Right now there is no checking for whether or not the raster being 
sampled actually exists at each point in the input vector, and whether 
each point is in the current region. If either one of these cases is 
true, then you will get an error like you mentioned. It looks like both 
of the errors you were having are related to reads outside of the 
current region.

Until I fix this heinous error, I would recommend working with a subset 
of your vector that fits completely within the extent of the elevation 
raster to be sampled. Also, make sure that the current region is just a 
hair smaller than the raster to be sampled and extent of the input 
vector-- as the sampling methods actually read a couple cells around 
the vector point.





>  Next I tried it with the Spearfish dataset. I tried to run v.drape on 
> the roads vector file over the elevation.dem raster. Here is the 
> result—pretty much the same as with my own data. (Note that the region 
> was set to match the raster).
>
> v.drape input=roads type=point,centroid,line,boundary,face,kernel 
> rast=elevation.dem method=nearest output=roads3d1
>
>  [elevation.dem in PERMANENT] - read request for row 176 is outside 
> region
>  row = (int) G_northing_to_row (north, &window);
>  G_get_map_row (fd, maprow, row) < 0
>  DIAG:     Region is: n=4.92651e+06 s=4.91444e+06 e=608416 w=589860
>            Data point is north=4.91406e+06 east=598566
>
>      Problem reading raster
>
>
>  Am I doing something wrong or does this indicate a bug?
>

This would be a bug. Sorry about that.

Dylan


--
Dylan Beaudette
Soils and Biogeochemistry Graduate Group
University of California at Davis
530.754.7341




More information about the grass-user mailing list