[GRASS-user] v.rast.stats error: "Unable to seek"

Stefan Blumentrath Stefan.Blumentrath at nina.no
Mon Feb 1 14:56:28 PST 2021


Hi Luis,

From the error message, it seems v.to.rast is failing, which may be due to a lack of resources - as Micha suggests.

Can you try
a) v.to.rast input=PSU output=test use=cat
if that does not work, we at least know it is not v.rast.stats and we might get a more specific error message... Not sure if the memory option in v.to.rast would have an effect here...

b) try to subdivide your data into chunks / tiles (polygons within tiles)?

Cheers
Stefan

-----Original Message-----
From: grass-user <grass-user-bounces at lists.osgeo.org> On Behalf Of Micha Silver
Sent: mandag 1. februar 2021 21:32
To: Luí s Moreira de Sousa <luis.de.sousa at protonmail.ch>; GRASS user list <grass-user at lists.osgeo.org>
Subject: Re: [GRASS-user] v.rast.stats error: "Unable to seek"

Hi Luis:


On 2/1/21 5:30 PM, Luí s Moreira de Sousa wrote:
> Hi Micha, thank you for replying.
>
> I recreated the PSU layer in another mapset with the default SQLite 
> back-end, v.rast.stats fails with the exact same error. So this is not 
> related to the back-end.
>
> Below are the outputs you requested. Thank you.
>
> > v.info PSU
> +----------------------------------------------------------------------------+
> | Name: PSU                                                       |
> | Mapset: MAL                                                       |
> | Location: S4AHomolosine                                             
> | |
> | Database: /home/duque004/Work/GRASSDATA                             
> | |
> | Title: |
> | Map scale: 1:1                                                       
> | | Name of creator:
> duque004                                                  |
> | Organization: |
> | Source date:     Fri Jan 29 08:13:08
> 2021                                  |
> | Timestamp (first layer): 
> none                                              |
> |----------------------------------------------------------------------------|
> | Map format: native                                                    
> | |
> |----------------------------------------------------------------------------|
> |   Type of map: vector (level: 
> 2)                                           |
> | |
> |   Number of points:       0               Number of centroids:
> 19468516   |
> |   Number of lines:        0               Number of boundaries: 
> 38945853   |
> |   Number of areas:        19468516        Number of islands:
> 1          |
> | |
> |   Map is 3D: No                                               |
> |   Number of dblinks: 1                                                
> ||
> | |
> |   Projection: 
> unknown                                                      |
> | |
> |               N:  4289569.27224353    S: 
> -4452930.72775647                 |
> |               E:  6679312.25515029    W: 
> -2226387.74484971                 |
> | |
> |   Digitization threshold: 
> 0                                                |
> | Comment: |
> | |
> +----------------------------------------------------------------------------+
>
> > r.info MAL_Mode_5x5
> +----------------------------------------------------------------------------+
> | Map:      MAL_Mode_5x5                   Date: Thu Jan 28 09:08:14
> 2021    |
> | Mapset:   MAL                            Login of Creator: 
> duque004        |
> | Location: S4AHomolosine |
> | DataBase: /home/duque004/Work/GRASSDATA |
> | Title:    5x5 neighborhood: mode of
> MAL_AFRICA                             |
> | Timestamp: none |
> |----------------------------------------------------------------------------|
> | |
> |   Type of Map:  raster               Number of Categories: 
> 0               |
> |   Data Type: 
> CELL                                                       |
> |   Rows: 87425                                                      |
> |   Columns: 89057                                                      
> ||
> |   Total Cells: 
> 7785808225                                                 |
> |        Projection: 
> unknown                                                 |
> |            N: 4289569.27224353    S: -4452930.72775647 Res:
> 100        |
> |            E: 6679312.25515029    W: -2226387.74484971 Res:
> 100        |
> |   Range of data:    min = 0  max =
> 1                                       |
> | |
> |   Data Description: |
> |    generated by
> r.neighbors                                                |
> | |
> | Comments: |
> |    r.neighbors input="MAL_AFRICA" output="MAL_Mode_5x5" 
> method="mode" s\   |
> | ize=5 |
> | |
> +----------------------------------------------------------------------------+
>

So the vector contains about 20 million polygons, and the raster about 8 billion cells. (~=32GB ?)

Does you computer have enough muscle for this?



>
> --
> Luís
>
> Sent with ProtonMail <https://eur01.safelinks.protection.outlook.com/?url=https%3A%2F%2Fprotonmail.com%2F&data=04%7C01%7C%7C3a73488d58cd411cbc0f08d8c6f07342%7C6cef373021314901831055b3abf02c73%7C0%7C0%7C637478083673619175%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C3000&sdata=4t7uF0b7BR9kcAqAReOPlaM6z8L7fwAJ94zMC66lzTc%3D&reserved=0> Secure Email.
>
> ‐‐‐‐‐‐‐ Original Message ‐‐‐‐‐‐‐
> On Friday, January 29, 2021 3:31 PM, Micha Silver <tsvibar at gmail.com>
> wrote:
>
>>
>>
>> On Fri, Jan 29, 2021 at 3:53 PM Luí­s Moreira de Sousa via grass-user 
>> <grass-user at lists.osgeo.org <mailto:grass-user at lists.osgeo.org>> wrote:
>>
>>     Dear all,
>>
>>     I am getting the error "Unable to seek" with v.stats.error. There
>>     is not much information that could point the cause, just a
>>     warning saying that some data base files are not found. I checked
>>     the database connection and everything looks in order (see
>>     below). Any hints on what may be causing this error?
>>
>>     Thank you.
>>
>>     > v.rast.stats map=PSU raster=MAL_Mode_5x5 method=number
>>     column_prefix=mal
>>     ERROR: Unable to seek: Invalid argument
>>     ERROR: An error occurred while converting vector to raster
>>     WARNING: No data base element files found
>>
>>     > db.connect -p
>>     driver: pg
>>     database: s4a
>>     schema: mal
>>     group:
>>
>>     > psql -d s4a -p 5434
>>     psql (12.5 (Ubuntu 12.5-0ubuntu0.20.04.1))
>>     Type "help" for help.
>>
>>     s4a=# \dt mal.*
>>                       List of relations
>>     Schema |           Name           | Type  |  Owner
>>     --------+--------------------------+-------+----------
>>     mal    | psu                      | table | duque004
>>     (1 rows)
>>
>>
>> Could it be simply CAPS in the vector name vs small letters in the 
>> Postgres table?
>> Can you post the outputs from:
>> v.info 
>> <https://eur01.safelinks.protection.outlook.com/?url=http%3A%2F%2Fv.i
>> nfo%2F&data=04%7C01%7C%7C3a73488d58cd411cbc0f08d8c6f07342%7C6cef3
>> 73021314901831055b3abf02c73%7C0%7C0%7C637478083673619175%7CUnknown%7C
>> TWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXV
>> CI6Mn0%3D%7C3000&sdata=Lc8A9SfmNwQKAMt3TTXYh%2FYBNurG6kUYAubGcxKh
>> 3hw%3D&reserved=0> PSU r.info 
>> <https://eur01.safelinks.protection.outlook.com/?url=http%3A%2F%2Fr.i
>> nfo%2F&data=04%7C01%7C%7C3a73488d58cd411cbc0f08d8c6f07342%7C6cef3
>> 73021314901831055b3abf02c73%7C0%7C0%7C637478083673619175%7CUnknown%7C
>> TWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXV
>> CI6Mn0%3D%7C3000&sdata=GyWpg6cTSQfOc0LOFHKvEzLa4lxJXbinsTJlPm0lbt
>> Y%3D&reserved=0> MAL_Mode_5x5
>>
>>
>>
>>     s4a=# select count(*) from mal.psu;
>>       count
>>     ----------
>>     19468516
>>     (1 row)
>>
>>
>>
>>
>>     -- 
>>     Luís
>>
>>     _______________________________________________
>>     grass-user mailing list
>>     grass-user at lists.osgeo.org <mailto:grass-user at lists.osgeo.org>
>>     https://eur01.safelinks.protection.outlook.com/?url=https%3A%2F%2Flists.osgeo.org%2Fmailman%2Flistinfo%2Fgrass-user&data=04%7C01%7C%7C3a73488d58cd411cbc0f08d8c6f07342%7C6cef373021314901831055b3abf02c73%7C0%7C0%7C637478083673629172%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C3000&sdata=2P01wK1Ak3X0QzZsMNLQa%2FLrQoVWrd8C7FgNezSRYRM%3D&reserved=0
>>     
>> <https://eur01.safelinks.protection.outlook.com/?url=https%3A%2F%2Fli
>> sts.osgeo.org%2Fmailman%2Flistinfo%2Fgrass-user&data=04%7C01%7C%7
>> C3a73488d58cd411cbc0f08d8c6f07342%7C6cef373021314901831055b3abf02c73%
>> 7C0%7C0%7C637478083673629172%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAw
>> MDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C3000&sdata=2
>> P01wK1Ak3X0QzZsMNLQa%2FLrQoVWrd8C7FgNezSRYRM%3D&reserved=0>
>>
>>
>>
>> --
>> Micha Silver
>> Ben Gurion Univ
>> Sde-Boker Remote Sensing Lab
>> cell: +972 (52) 3665918
>
--
Micha Silver
Ben Gurion Univ.
Sde Boker, Remote Sensing Lab
cell: +972-523-665918
https://eur01.safelinks.protection.outlook.com/?url=https%3A%2F%2Forcid.org%2F0000-0002-1128-1325&data=04%7C01%7C%7C3a73488d58cd411cbc0f08d8c6f07342%7C6cef373021314901831055b3abf02c73%7C0%7C0%7C637478083673629172%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C3000&sdata=PuJmTChNnqdqy%2F3CrSb3FbfoIMprgxLPwf%2B0j86VS8s%3D&reserved=0

_______________________________________________
grass-user mailing list
grass-user at lists.osgeo.org
https://eur01.safelinks.protection.outlook.com/?url=https%3A%2F%2Flists.osgeo.org%2Fmailman%2Flistinfo%2Fgrass-user&data=04%7C01%7C%7C3a73488d58cd411cbc0f08d8c6f07342%7C6cef373021314901831055b3abf02c73%7C0%7C0%7C637478083673629172%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C3000&sdata=2P01wK1Ak3X0QzZsMNLQa%2FLrQoVWrd8C7FgNezSRYRM%3D&reserved=0


More information about the grass-user mailing list