[GRASS-dev] error v.what.rast
Paulo van Breugel
p.vanbreugel at gmail.com
Fri Oct 10 00:19:08 PDT 2014
On Fri, Oct 10, 2014 at 9:00 AM, Paulo van Breugel <p.vanbreugel at gmail.com>
wrote:
>
>
> On Thu, Oct 9, 2014 at 11:49 PM, Markus Neteler <neteler at osgeo.org> wrote:
>
>> On Wed, Oct 8, 2014 at 9:44 AM, Paulo van Breugel
>> <p.vanbreugel at gmail.com> wrote:
>> > On Wed, Oct 8, 2014 at 9:21 AM, Markus Neteler <neteler at osgeo.org>
>> wrote:
>> >>
>> >> On Tue, Oct 7, 2014 at 11:20 PM, Paulo van Breugel
>> >> <p.vanbreugel at gmail.com> wrote:
>> >> > I am trying to upload raster values of the raster 'grid' to the
>> >> > attribute
>> >> > table of the gbif vector layer, as below:
>> >> >
>> >> > g.region rast=grid
>> >>
>> >> can you please post
>> >>
>> >> g.region rast=grid -p
>> >
>> >
>> > GRASS 7.1.svn (latlon):~ > g.region rast=grid -p
>> > projection: 3 (Latitude-Longitude)
>> > zone: 0
>> > datum: wgs84
>> > ellipsoid: a=6378137 es=0.006694379990141316
>> > north: 37:22:30N
>> > south: 39S
>> > west: 20:12:30W
>> > east: 57:40E
>> > nsres: 0:02:30
>> > ewres: 0:02:30
>> > rows: 1833
>> > cols: 1869
>> > cells: 3425877
>>
>> Can you please post with "-g" which is decimal?
>>
>
> n=37.375
> s=-34.875
> w=-17.5416666666667
> e=51.4166666666667
> nsres=0.0416666666666667
> ewres=0.0416666666666667
> rows=1734
> cols=1655
> cells=2869770
>
>
>>
>> >>
>> >>
>> >> > v.what.rast map=gbif raster=grid column=cell2arcm
>> >> > Reading features from vector map...
>> >> > 100%
>> >> > ERROR: Reading raster map <grid@> request for row 1830 is outside
>> region
>> >>
>> >> ... and also the boundary box of gbif?
>> >
>> > Projection: Latitude-Longitude
>> >
>> > N: 37:19:58.08N
>> > S: 38:52:30S
>> > E: 57:38:24E
>> > W: 20:02:49.92W
>>
>> Also here, can you please post with "-g" which is decimal?
>>
>
> n=37.3328
> s=-38.875
> w=-20.0472
> e=57.64
> nsres=0.0416663750683434
> ewres=0.0416776824034335
> rows=1829
> cols=1864
> cells=3409256
>
>>
>> The error message is generated in
>> lib/raster/get_row.c
>>
>> static int compute_window_row(int fd, int row, int *cellRow)
>> {
>> struct fileinfo *fcb = &R__.fileinfo[fd];
>> double f;
>> int r;
>>
>> /* check for row in window */
>> if (row < 0 || row >= R__.rd_window.rows) {
>> G_fatal_error(_("Reading raster map <%s@%s> request for row %d
>> is outside region"),
>> fcb->name, fcb->mapset, row);
>> }
>>
>> Perhaps a vector point just hits the extents of the computational region
>> or map?
>>
>
>
> You are right that the extends do not match completely. But I was under
> the impression that points outside the region simply got skipped? For
> example, if I reduce the region to a small area, and run v.what.rast, I get
> the warning message "WARNING: 2287133 points outside current region were
> skipped", after which the it happily continues to run updating the points
> that are within the region bounds, as per below.
>
> WARNING: 2287133 points outside current region were skipped
> Update vector attributes...
> 100%
> v.what.rast complete. 57621 records updated.
>
>
Sorry, I wasn't completely awake yet. It is about the extend of the raster
layer to be sampled being smaller than the region... and yes, that was the
case. Reducing the region to fit within the bounds of the raster layer
solved the problem. Seems obvious now I know the error I made, sorry.
Thanks a lot for your help, much appreciated!
>
>
>>
>> Markus
>>
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.osgeo.org/pipermail/grass-dev/attachments/20141010/179af255/attachment.html>
More information about the grass-dev
mailing list