[GRASS-user] v.reclass: no attribute table created

2017-05-12 Thread RichardCooper
Hi,

I'm not sure what I'm doing wrong, but after apparently successfully running
v.reclass the resulting vector layer contains no attribute table and no new
table is created. I have observed the same problem in sqlite and postgresql. 

v.reclass --overwrite input=zones@PERMANENT output=zones_reclassed@PERMANENT
rules=/home/user/Desktop/rulesf.rcl
WARNING: Vector map  already exists and will be overwritten
WARNING: For 368 elements no new category was defined
Building topology for vector map ...
Registering primitives...
1543 primitives registered
34380 vertices registered
Building areas...
510 areas built
240 isles built
Attaching islands...
Attaching centroids...
Number of nodes: 763
Number of primitives: 1543
Number of points: 0
Number of lines: 0
Number of boundaries: 1033
Number of centroids: 510
Number of areas: 510
Number of isles: 240

Here, I'm trying to reclassify categories with the text strings in col_name
to categories 1000 and 1001.
rules.rcf:
cat 1000
where col_name = 'text string'
cat 1001
where col_name = 'test string2'

The above output mentions 'no new category defined'?

Many thanks for your feedback.
Richard




--
View this message in context: 
http://osgeo-org.1560.x6.nabble.com/v-reclass-no-attribute-table-created-tp5320352.html
Sent from the Grass - Users mailing list archive at Nabble.com.
___
grass-user mailing list
grass-user@lists.osgeo.org
https://lists.osgeo.org/mailman/listinfo/grass-user

Re: [GRASS-user] t.create error: Unable to connect to psycopg2 database: newdb

2017-05-06 Thread RichardCooper
Replying somewhat late to my query last year, but I'm still getting the same
error with regard to using t.create with a PostgreSQL database connection
with GRASS 7.2.0

t.connect driver=pg database=grasscldb  
(Sat May  6 20:36:01 2017) Command finished (0 sec) 
(Sat May  6 20:36:08 2017)  
t.connect -p driver=pg database=grasscldb   
driver:pg
database:grasscldb
(Sat May  6 20:36:08 2017) Command finished (0 sec) 

t.create --overwrite output=cahpc_test_strd temporaltype=relative
semantictype=max title=title test description=descr test
ERROR: Unable to connect to psycopg2 database: grasscldb
Exception: "missing "=" after "grasscldb" in connection info string
"
Please use t.connect to set a read- and writable temporal database backend
(Sat May  6 20:37:36 2017) Command finished (0 sec)
  
System Info 
GRASS version: 7.2.0
GRASS SVN revision: exported
Build date: 2017-04-07  
Build platform: x86_64-pc-linux-gnu 
GDAL: 1.11.2
PROJ.4: 4.9.0   
GEOS: 3.4.2 
SQLite: 3.8.2   
Python: 2.7.6   
wxPython: 2.8.12.1  
Platform: Linux-3.13.0-95-generic-x86_64-with-LinuxMint-17.1-rebecca  



--
View this message in context: 
http://osgeo-org.1560.x6.nabble.com/t-create-error-Unable-to-connect-to-psycopg2-database-newdb-tp5296563p5319598.html
Sent from the Grass - Users mailing list archive at Nabble.com.
___
grass-user mailing list
grass-user@lists.osgeo.org
https://lists.osgeo.org/mailman/listinfo/grass-user

Re: [GRASS-user] Temporal framework: calculating annual 5-day extremes

2017-04-07 Thread RichardCooper
With a manual work around I was able to use t.rast.algebra, but needed to
both manually create a relative STRDS and then register the output rasters
from t.rast.algebra into the latter.

The error encountered in using t.rast.algebra (I'm not sure if me or a bug)
appears to be that an absolute STRDS is being created by t.rast.algebra but
the generated raster layers have a relative timestamp (e.g. 'Timestamp: 1
day / 2 days'). 

This expression output the required summed layers (and I then manually
created the relative STRDS and registered the output layers with
t.register):
t.rast.algebra -s --verbose expression=ag_rel200=(cahpa_rel200[0] +
cahpa_rel200[1] + cahpa_rel200[2] + cahpa_rel200[3] + cahpa_rel200[4])
basename=summed


Regarding the second error with t.register as noted above: the input raster
layers have a relative timestamp and I understand that if I wish to create
an absolute STRDS, then I need to modify each layer's timestamp from
relative to absolute accordingly.

Please let me know if the above makes sense.

Best regards,
Richard




--
View this message in context: 
http://osgeo-org.1560.x6.nabble.com/Temporal-framework-calculating-annual-5-day-extremes-tp5316014p5316391.html
Sent from the Grass - Users mailing list archive at Nabble.com.
___
grass-user mailing list
grass-user@lists.osgeo.org
https://lists.osgeo.org/mailman/listinfo/grass-user

Re: [GRASS-user] Temporal framework: calculating annual 5-day extremes

2017-04-07 Thread RichardCooper
I'm looking at t.rast.algebra, but I'm getting the following error which I
haven't been able to resolve. I'm not sure if I need to create an absolute
SRTDS as shown in the first error below. I then try and register a set of
raster layers with an absolute SRTDS but get the second error. I'd be
grateful for any suggestions.

Error 1:
On using t.rast.algebra with a relative SRTDS I get the following error:



Error 2:
Attempting to register raster layers in an absolute SRTDS:





--
View this message in context: 
http://osgeo-org.1560.x6.nabble.com/Temporal-framework-calculating-annual-5-day-extremes-tp5316014p5316354.html
Sent from the Grass - Users mailing list archive at Nabble.com.
___
grass-user mailing list
grass-user@lists.osgeo.org
https://lists.osgeo.org/mailman/listinfo/grass-user

Re: [GRASS-user] Temporal framework: calculating annual 5-day extremes

2017-04-07 Thread RichardCooper
I should add that t.rast.to.rast3 works for a STRDS containing 1000 layers,
but if more than 5000 layers I get the abovementioned error after increasing
the open file limits (to 40) on my notebook.

The number of open files on the system: 
lsof | wc -l
156036




--
View this message in context: 
http://osgeo-org.1560.x6.nabble.com/Temporal-framework-calculating-annual-5-day-extremes-tp5316014p5316295.html
Sent from the Grass - Users mailing list archive at Nabble.com.
___
grass-user mailing list
grass-user@lists.osgeo.org
https://lists.osgeo.org/mailman/listinfo/grass-user

Re: [GRASS-user] Temporal framework: calculating annual 5-day extremes

2017-04-07 Thread RichardCooper
Many thanks for the suggestions.

I'd really like to use the voxel approach but am getting the following error
on running t.rast.to.rast3 to create a voxel.

I've increased the hard and soft limits for open files to 4 on my
system, but I still am unable to convert a space time raster dataset  into a
3D raster map with only 5000 raster layers (note: I have 50K daily raster
layers that I need to analyse i voxel)

$ cat /proc/sys/fs/file-max
800532
$ ulimit -Sn
40
$ ulimit -Hn
40

Thanks,
Richard


Creation of STRDS and error on trying to convert to 3D data set:
t.create output=capha_test_5 temporaltype=relative semantictype=max
title=cahpa_test_5 description=cahpa_test_5

t.register --overwrite --verbose input=capha_test_5@cahpa
file=/home/rcooper/grassdatacl/climdata/cahpa/.tmp/rcooper-dell/3528.4
start=1 unit=day increment=1
Gathering map information...
Registering maps in the temporal database...
Registering maps in the space time dataset...
Updating space time dataset...
Update metadata, spatial and temporal extent from all registered maps of

Update metadata, spatial and temporal extent from all registered maps of

Update metadata, spatial and temporal extent from all registered maps of

Update metadata, spatial and temporal extent from all registered maps of

Update metadata, spatial and temporal extent from all registered maps of


t.rast.to.rast3 --overwrite --verbose input=capha_test_5@cahpa
output=cahpa_test_5_3d
Traceback (most recent call last):
  File "/usr/local/grass-7.2.0/scripts/t.rast.to.rast3",
line 194, in 
main()
  File "/usr/local/grass-7.2.0/scripts/t.rast.to.rast3",
line 152, in main
output=output, overwrite=grass.overwrite())
  File
"/usr/local/grass-7.2.0/etc/python/grass/script/core.py",
line 408, in run_command
ps = start_command(*args, **kwargs)
  File
"/usr/local/grass-7.2.0/etc/python/grass/script/core.py",
line 377, in start_command
return Popen(args, **popts)
  File
"/usr/local/grass-7.2.0/etc/python/grass/script/core.py",
line 74, in __init__
subprocess.Popen.__init__(self, args, **kwargs)
  File "/usr/lib/python2.7/subprocess.py", line 710, in
__init__
errread, errwrite)
  File "/usr/lib/python2.7/subprocess.py", line 1327, in
_execute_child
raise child_exception
OSError: [Errno 7] Argument list too long
(Fri Apr  7 17:30:33 2017) Command finished (2 sec) 














--
View this message in context: 
http://osgeo-org.1560.x6.nabble.com/Temporal-framework-calculating-annual-5-day-extremes-tp5316014p5316291.html
Sent from the Grass - Users mailing list archive at Nabble.com.
___
grass-user mailing list
grass-user@lists.osgeo.org
https://lists.osgeo.org/mailman/listinfo/grass-user

Re: [GRASS-user] Temporal framework: calculating annual 5-day extremes

2017-04-06 Thread RichardCooper
I have a time series of rainfall data, and for each year I want to calculate
the five-day period with maximum rainfall. So I would need to calculate the
sum of day1 to day5, then day2 to day6, then day3 to day7 etc for the whole
year, and then output the maximum grid cell 5-day values for each year into
a single raster.

To do this in t.rast.accumulate, I can see how to set a temporal cycle of 1
year (cycle= "12 months"), but not sure how to specify such a rolling sum
calculation of 5 days as described above. The default method is the 'mean'
as indicated in r.series.accumulation? I'm not too sure how the accumulation
is applied in the module.

Best regards,
Richard



--
View this message in context: 
http://osgeo-org.1560.x6.nabble.com/Temporal-framework-calculating-annual-5-day-extremes-tp5316014p5316076.html
Sent from the Grass - Users mailing list archive at Nabble.com.
___
grass-user mailing list
grass-user@lists.osgeo.org
https://lists.osgeo.org/mailman/listinfo/grass-user

[GRASS-user] Temporal framework: calculating annual 5-day extremes

2017-04-05 Thread RichardCooper
Hi,

I have a data set containing multiple years of daily raster layers and would
like to aggregate and output annual raster layers of 5-day extremes
(maxima).

Essentially, for each grid cell, I need to calculate rolling 5-day sums of
each year and then find the annual max of the latter sums, and output as a 
series of raster layers of annual 5-day extremes.

However, I'm trying to work out the best way in GRASS of doing this. Overall
t.rast.aggregate comes closest to the type of functionality needed. I've
also looked at t.rast3d.mapcalc, but unsure if calculating a rolling sum is
possible.

I'd be grateful for any suggestions on how I might approach this.

Thanks,

Richard



--
View this message in context: 
http://osgeo-org.1560.x6.nabble.com/Temporal-framework-calculating-annual-5-day-extremes-tp5316014.html
Sent from the Grass - Users mailing list archive at Nabble.com.
___
grass-user mailing list
grass-user@lists.osgeo.org
https://lists.osgeo.org/mailman/listinfo/grass-user

Re: [GRASS-user] t.create error: Unable to connect to psycopg2 database: newdb

2016-11-19 Thread RichardCooper
I upgraded to 7.0.6 and I can now reset the database to sqlite, but still
cannot connect to a PostgreSQL database. I'll check again on the t.connect
commands. Does anyone else have any trouble connecting to a potgresql db
with t.connect  and creating a temporal dataset with t.create?



--
View this message in context: 
http://osgeo-org.1560.x6.nabble.com/t-create-error-Unable-to-connect-to-psycopg2-database-newdb-tp5296563p5296586.html
Sent from the Grass - Users mailing list archive at Nabble.com.
___
grass-user mailing list
grass-user@lists.osgeo.org
http://lists.osgeo.org/mailman/listinfo/grass-user

[GRASS-user] t.create error: Unable to connect to psycopg2 database: newdb

2016-11-19 Thread RichardCooper
Hi,

I'm having some trouble with t.create/t.connection and postgresql. 

t.create is giving the following error on attempting to create a raster
space time dataset in postgresql, and then I'm also subsequently unable to
create a space time database in sqlite?

I'd be grateful for any suggestions on how to resolve.

Cheers,
Richard


For example:
# set connection in t.connect and try and create dataset:
t.connect driver=pg database=newdb   
(I've also tried t.connect driver=pg database="newdb user=user
password=***")
The VAR file contains the new settings.

t.create --overwrite output=teststrds type=stvds semantictype=max title=t
description=d
ERROR: Unable to connect to psycopg2 database: newdb
Exception: "missing "=" after "newdb" in connection info string
"
Please use t.connect to set a read- and writable temporal database backend

I then try to create a temporal dataset in sqlite, but I then get an error
with sqlite?
t.connect database=/home/rcooper/grassdatacl/climdata/newdb/tgis/sqlite.db  
t.connect -p
driver:sqlite
database:/home/rcooper/grassdatacl/climdata/newdb/tgis/sqlite.db

t.create --overwrite output=test_sq_strds type=stvds semantictype=max
title=t description=d
Creating temporal database:
/home/rcooper/grassdatacl/climdata/newdb/tgis/sqlite.db
ERROR: Unable to connect to psycopg2 database:
/home/rcooper/grassdatacl/climdata/newdb/tgis/sqlite.db
Exception: "missing "=" after "newdb" in connection info string
"
Please use t.connect to set a read- and writable temporal database backend

NOTE: I can connect to the postgresql database with db.login and db.connect,
so it doesn't seem to be a permissions issue.
db.login driver=pg database=newdb user=user password=*   

db.connect -p database=newdb
driver: pg
database: newdb
schema: public
group: 


System:
GRASS version: 7.0.1svn 
GRASS SVN Revision: 65041   
Build Date: 2015-04-10  
Build Platform: x86_64-unknown-linux-gnu
GDAL/OGR: 1.11.2
PROJ.4: 4.9.0   
GEOS: 3.4.2 
SQLite: 3.8.2   
Python: 2.7.6   
wxPython: 2.8.12.1  
Platform: Linux-3.13.0-95-generic-x86_64-with-LinuxMint-17.1-rebecca 




--
View this message in context: 
http://osgeo-org.1560.x6.nabble.com/t-create-error-Unable-to-connect-to-psycopg2-database-newdb-tp5296563.html
Sent from the Grass - Users mailing list archive at Nabble.com.
___
grass-user mailing list
grass-user@lists.osgeo.org
http://lists.osgeo.org/mailman/listinfo/grass-user

Re: [GRASS-user] g.rename problem with Python

2016-11-07 Thread RichardCooper
Resolved... was a python error on my side. Corrected now!



--
View this message in context: 
http://osgeo-org.1560.x6.nabble.com/g-rename-problem-with-Python-tp5294558p5294566.html
Sent from the Grass - Users mailing list archive at Nabble.com.
___
grass-user mailing list
grass-user@lists.osgeo.org
http://lists.osgeo.org/mailman/listinfo/grass-user

[GRASS-user] g.rename problem with Python

2016-11-07 Thread RichardCooper
I' trying to rename a bunch of imported netCDF layers which include
periods/dots in their filenames. I can rename replacing the '.' with '_' in
the g.rename GUI module, but in Python I get the following errors.

I'd be really grateful for any advice on how to deal with the periods in the
Python script. Alternatively, I could rename before importing into GRASS...

Thanks,
Richard

My script is as follows:

from grass_session import *
...
 #Rename layers replacing '.' with '_'
with open('glist_llrotate.txt') as gl:
for line in gl:
renamed = line.replace('.','_')
print 'Renamed layer:', renamed
grass.run_command('g.rename', raster = (line,renamed), overwrite =
True)
...

And the error: 
WARNING: Illegal filename . Character <
 > not allowed.

The gllist_llrotate.txt file contains content such as:
cahpa.f1jan.05216.nc.1
cahpa.f1jan.05216.nc.10
cahpa.f1jan.05216.nc.11
cahpa.f1jan.05216.nc.12

...

GRASS version: 7.0.1svn 
GRASS SVN Revision: 65041   
Build Date: 2015-04-10  
Build Platform: x86_64-unknown-linux-gnu
GDAL/OGR: 1.11.2
PROJ.4: 4.9.0   
GEOS: 3.4.2 
SQLite: 3.8.2   
Python: 2.7.6   
wxPython: 2.8.12.1  
Platform: Linux-3.13.0-95-generic-x86_64-with-LinuxMint-17.1-rebecca 



--
View this message in context: 
http://osgeo-org.1560.x6.nabble.com/g-rename-problem-with-Python-tp5294558.html
Sent from the Grass - Users mailing list archive at Nabble.com.
___
grass-user mailing list
grass-user@lists.osgeo.org
http://lists.osgeo.org/mailman/listinfo/grass-user

[GRASS-user] v.in.ogr: encoding problem with shapefile DBF file

2015-09-30 Thread RichardCooper
Hi,

I'm getting an error on attempting to import a shapefile with a DBF file
containing Thai characters (sample below) using v.in.ogr. I've also
attempted to set encoding as per
https://grass.osgeo.org/grass70/manuals/v.in.ogr.html

The file is utf-8 and the headers do not contain Thai characters.

I can open the file in QGIS and view Thai characters in its attribute table,
but in GRASS, only the attribute column headers are imported.

I'd be grateful for any suggestions.

Cheers,
Richard


Error from GRASS command console:
v.in.ogr input= ../Bridge.shp layer=Bridge output=Bridge --overwrite
encoding=utf8
Check if OGR layer  contains polygons...
WARNING: Vector map  already exists and will be overwritten
Importing 1189 features (OGR layer )...
DBMI-PostgreSQL driver error:
Unable to execute:
insert into public.Bridge values ( 1, '', '', '',
0.000, 0.000, 0.000,
'ถนนประชาร่วมใจ', '6', 6, 0, 0,
0.000, 6.000, '', '', 0, 0, 0, 0, 0, 0, 0,
0, '', 0, 0, '', '', '', '', '', 0.000, '', '', '',
'', '', '', 0.000, 0.000, 0.000, '',
'', '', '', 41, 0.000, '', 0.000, 0.00 )
ERROR:  invalid input syntax for type date: ""
LINE 1: ...มใจ', '6', 6, 0, 0, 0.000,
6.000, '', '', 0,...
 ^
DBMI-PostgreSQL driver error:
Unable to execute:
insert into public.Bridge values ( 1, '', '', '',
0.000, 0.000, 0.000,
'ถนนประชาร่วมใจ', '6', 6, 0, 0,
0.000, 6.000, '', '', 0, 0, 0, 0, 0, 0, 0,
0, '', 0, 0, '', '', '', '', '', 0.000, '', '', '',
'', '', '', 0.000, 0.000, 0.000, '',
'', '', '', 41, 0.000, '', 0.000, 0.00 )
ERROR:  invalid input syntax for type date: ""
LINE 1: ...มใจ', '6', 6, 0, 0, 0.000,
6.000, '', '', 0,...
 ^
ERROR: Cannot insert new row: insert into public.Bridge values ( 1, '', '',
'', 0.000, 0.000, 0.000, 'ถนนประชาร่วมใจ', '6', 6,
0, 0, 0.000, 6.000, '', '', 0, 0, 0, 0, 0, 0, 0, 0, '', 0,
0, '', '', '', '', '', 0.000, '', '', '', '', '', '', 0.000,
0.000, 0.000, '', '', '', '', 41, 0.000, '',
0.000, 0.00 )
(Thu Oct  1 13:30:44 2015) Command finished (0 sec) 


System info:
GRASS version: 7.0.1svn 
GRASS SVN Revision: 65041   
Build Date: 2015-04-10  
Build Platform: x86_64-unknown-linux-gnu
GDAL/OGR: 1.11.2
PROJ.4: 4.9.0   
GEOS: 3.4.2 
SQLite: 3.8.2   
Python: 2.7.6   
wxPython: 2.8.12.1  
Platform: Linux-3.13.0-37-generic-x86_64-with-LinuxMint-17.1-rebecca 


Top 8 lines of problem column in DBF file:
NameT,C,250
ถนนประชาร่วมใจ


ทางหลวงชนบท สค. 4011
ถนนวัดกระซ้าขาว
ซอยพระราม 2 (ซอย 4)
ถนนเอนกอุดมผล







--
View this message in context: 
http://osgeo-org.1560.x6.nabble.com/v-in-ogr-encoding-problem-with-shapefile-DBF-file-tp5227195.html
Sent from the Grass - Users mailing list archive at Nabble.com.
___
grass-user mailing list
grass-user@lists.osgeo.org
http://lists.osgeo.org/mailman/listinfo/grass-user

Re: [GRASS-user] t.vect.observe.strds: OSError: [Errno 7] Argument list too long

2015-06-01 Thread RichardCooper
A solution to this is to specify 'where' conditions under the optional tab,
e.g.,

start_time <= '2'

I determined this figure by trial and error - not sure if it is my computer
system that is the limiting factor requiring this be done in batches.



--
View this message in context: 
http://osgeo-org.1560.x6.nabble.com/t-vect-observe-strds-OSError-Errno-7-Argument-list-too-long-tp5208418p5208498.html
Sent from the Grass - Users mailing list archive at Nabble.com.
___
grass-user mailing list
grass-user@lists.osgeo.org
http://lists.osgeo.org/mailman/listinfo/grass-user


[GRASS-user] t.vect.observe.strds: OSError: [Errno 7] Argument list too long

2015-06-01 Thread RichardCooper
Hi,

I'd be grateful for any suggestions for resolving the following error on
running t.vect.observe.strds.

The vector file (cahpa_f1apr_05216_nc_remapped_nc_10_rtv_pran) contains six
points only.

Details of the STRDS are given below.

If I create a single raster layer STRDS, t.vect.observe.strds works. Is
there a limit to the number of layers that can be used?

Cheers,
Richard


t.vect.observe.strds --overwrite
input=cahpa_f1apr_05216_nc_remapped_nc_10_rtv_pran
strds=cahpa_05216_remapped_fine@cahpa05216 output=cahpa_05216_tvect_stvd
vector_output=cahpa_05216_tvect_v columns=prcp
Traceback (most recent call last):
  File "/home/rcooper/grass70/grass-7.0.1svn/scripts/t.vect.
observe.strds", line 303, in 
main()
  File "/home/rcooper/grass70/grass-7.0.1svn/scripts/t.vect.
observe.strds", line 199, in main
overwrite=overwrite)
  File "/home/rcooper/grass70/grass-7.0.1svn/etc/python/gras
s/script/core.py", line 372, in run_command
ps = start_command(*args, **kwargs)
  File "/home/rcooper/grass70/grass-7.0.1svn/etc/python/gras
s/script/core.py", line 359, in start_command
return Popen(args, **popts)
  File "/home/rcooper/grass70/grass-7.0.1svn/etc/python/gras
s/script/core.py", line 62, in __init__
subprocess.Popen.__init__(self, args, **kwargs)
  File "/usr/lib/python2.7/subprocess.py", line 710, in
__init__
errread, errwrite)
  File "/usr/lib/python2.7/subprocess.py", line 1327, in
_execute_child
raise child_exception
OSError: [Errno 7] Argument list too long
(Mon Jun  1 17:32:42 2015) Command finished (1 sec)   


+

t.info input=cahpa_05216_remapped_fine@cahpa05216   
 + Space Time Raster Dataset
-+
 |   
|
 + Basic information
-+
 | Id:  cahpa_05216_remapped_fine@cahpa05216
 | Name: .. cahpa_05216_remapped_fine
 | Mapset:  cahpa05216
 | Creator: ... rcooper
 | Temporal type: . relative
 | Creation time: . 2015-05-29 18:37:43.612305
 | Modification time:.. 2015-06-01 15:25:35.940146
 | Semantic type:.. max
 + Relative time
-+
 | Start time:. 0
 | End time:... 53579
 | Relative time unit:. days
 | Granularity: 1
 | Temporal type of maps:.. point
 + Spatial extent
+
 | North:.. 13.05
 | South:.. 11.95
 | East:..  100.67
 | West:... 98.91
 | Top: 0.0
 | Bottom:. 0.0
 + Metadata information
--+
 | Raster register table:..
raster_map_register_4fb1167c5d8549869f887390e14078b8
 | North-South resolution min:. 0.02
 | North-South resolution max:. 0.02
 | East-west resolution min:... 0.02
 | East-west resolution max:... 0.02
 | Minimum value min:.. 0.0
 | Minimum value max:.. 0.001792
 | Maximum value min:.. 0.0
 | Maximum value max:.. 0.008675
 | Aggregation type:... None
 | Number of registered maps:.. 53580
 |
 | Title:
 | cahpa_05216_remapped_fine
 | Description:
 | cahpa_05216_remapped_fine
 | Command history:
 | # 2015-05-29 18:37:43 
 | t.create output="cahpa_05216_remapped_fine"
 | temporaltype="relative" semantictype="max"
 | title="cahpa_05216_remapped_fine"
 | description="cahpa_05216_remapped_fine"
 | # 2015-05-29 18:49:52 
 | t.register
 | input="cahpa_05216_remapped_fine@cahpa05216"
 | file="/home/rcooper/DATA/APN_TRANSPORT/SCRIPTS/glist_reorder"
start="0"
 | unit="days" increment="1"
 | # 2015-06-01 15:25:27 
 | t.register --overwrite
 | input="cahpa_05216_remapped_fine@cahpa05216"
 | file="/home/rcooper/DATA/APN_TRANSPORT/SCRIPTS/glist_reorder"
start="0"
 | unit="days" increment="1"
 | 



System:
GRASS version: 7.0.1svn 
GRASS SVN Revision: 65041   
Build Date: 2015-04-10  
Build Platform: x86_64-unknown-linux-gnu
GDAL/OGR: 1.11.2
PROJ.4: 4.9.0   
GEOS: 3.4.2 
SQLite: 3.8.2   
Python: 2.7.6   
wxPython: 2.8.12.1  

[GRASS-user] Default method of rasterizing in v.to.rast

2015-02-23 Thread RichardCooper
Hi,

I'm trying to determine the default method of rasterization used by v.to
rast.

In the v.to.rast manual it states in relation to the  -d option, that 'All
cells touched by the line will be set, not only those on the render path',
but I'm not certain which method is being used by default.

I came across a paper by  Biagi and Negretti
   * which
describes how by default vectors are rasterized in GRASS  5. The latter
authors refer to the 'center' method as being the standard GRASS command in
5.0 (p. 4). Is this used in GRASS 7? From my observation (in the Map
Display), by default, vector area appear to be rasterized if the center of
the grid cell falls within the area boundary?

I haven't checked through the code, but maybe someone has some knowledge on
the history of v.to.rast?

Cheers,
Richard

*http://geomatica.como.polimi.it/workbooks/n2/articoli/lbmn.pdf



--
View this message in context: 
http://osgeo-org.1560.x6.nabble.com/Default-method-of-rasterizing-in-v-to-rast-tp5189410.html
Sent from the Grass - Users mailing list archive at Nabble.com.
___
grass-user mailing list
grass-user@lists.osgeo.org
http://lists.osgeo.org/mailman/listinfo/grass-user


Re: [GRASS-user] Searching for technical details on how v.rast.stats calculates means and other statistics

2015-02-21 Thread RichardCooper
I've resolved - I hadn't set g.region aligning to the raster prior to
v.to.rast:

This appears to work,with outputs from r.univar matching v.rast.stats:

g.region -p -a raster=cahpa_i0apr_05216_nc_remapped_nc_1@prcp05216ijk
res=0.22 
g.region -p align=cahpa_i0apr_05216_nc_remapped_nc_1@prcp05216ijk
v.to.rast --overwrite input=BMR_bndry_epsg4326@prcp05216ijk type=area
output=BMR_bndry_epsg4326_rasterized use=cat
r.univar -g -t map=cahpa_i0apr_05216_nc_remapped_nc_1@prcp05216ijk
zones=BMR_bndry_epsg4326_rasterized@prcp05216ijk

v.rast.stats map=BMR_bndry_epsg4326@prcp05216ijk
raster=cahpa_i0apr_05216_nc_remapped_nc_1@prcp05216ijk column_prefix=test
method=number,minimum,maximum,range,average,sum






--
View this message in context: 
http://osgeo-org.1560.x6.nabble.com/Searching-for-technical-details-on-how-v-rast-stats-calculates-means-and-other-statistics-tp5188809p5189189.html
Sent from the Grass - Users mailing list archive at Nabble.com.
___
grass-user mailing list
grass-user@lists.osgeo.org
http://lists.osgeo.org/mailman/listinfo/grass-user


Re: [GRASS-user] Searching for technical details on how v.rast.stats calculates means and other statistics

2015-02-21 Thread RichardCooper
Hi Markus, 

Thanks for your comments.

It still appears that v.rast.stats is giving me different values to
r.univar.

Essentially I'd like to clarify how the values are derived from
v.rast.stats.  I'm guessing that the discrepancy between my r.univar and
v.rast.stats outputs relates to how I'm using g.region?

The following shows my approach for deriving statistics from both r.univar
and v.rast.stats.

Cheers,
Richard


1. Using r.univar and zones to output stats
# set g.region for rasterizing vector 
g.region -p -a vector=BMR_bndry_epsg4326@prcp05216ijk res=0.22  
projection: 3 (Latitude-Longitude)
zone:   0
datum:  wgs84
ellipsoid:  wgs84
north:  14:31:12N
south:  13:12N
west:   99:39:36E
east:   101:12E
nsres:  0:13:12
ewres:  0:13:12
rows:   6
cols:   7
cells:  42

# rasterize vector to be used for zones
v.to.rast --overwrite input=BMR_bndry_epsg4326@prcp05216ijk type=area
output=BMR_bndry_epsg4326_rasterized use=cat
Reading areas...
Reading features...
Writing raster map...
Converted areas: 6 of 0
v.to.rast complete.

# set g.region for zones with r.univar
g.region -p rast=BMR_bndry_epsg4326_rasterized@prcp05216ijk 
projection: 3 (Latitude-Longitude)
zone:   0
datum:  wgs84
ellipsoid:  wgs84
north:  14:31:12N
south:  13:12N
west:   99:39:36E
east:   101:12E
nsres:  0:13:12
ewres:  0:13:12
rows:   6
cols:   7
cells:  42

g.region -p align=cahpa_i0apr_05216_nc_remapped_nc_1@prcp05216ijk   
projection: 3 (Latitude-Longitude)
zone:   0
datum:  wgs84
ellipsoid:  wgs84
north:  14:35:24N
south:  13:03N
west:   99:34:12E
east:   101:19:48E
nsres:  0:13:12
ewres:  0:13:12
rows:   7
cols:   8
cells:  56

r.univar -g -t map=cahpa_i0apr_05216_nc_remapped_nc_1@prcp05216ijk
zones=BMR_bndry_epsg4326_rasterized@prcp05216ijk
zone|label|non_null_cells|null_cells|min|max|range|mean|mean_of_abs|stddev|variance|coeff_var|sum|sum_abs
1|Category
1|4|0|3.58209799742326e-05|7.74326545069925e-05|4.16116745327599e-05|5.64720030524768e-05|5.64720030524768e-05|1.53324774982512e-05|2.35084866234379e-10|27.1505820043313|0.000225888012209907|0.000225888012209907
2|Category
2|2|0|3.53023679053877e-05|6.23035812168382e-05|2.70012133114506e-05|4.88029745611129e-05|4.88029745611129e-05|1.35006066557253e-05|1.82266380072614e-10|27.6634913694027|9.7605949159e-05|9.7605949159e-05
3|Category
3|1|0|8.14341983641498e-05|8.14341983641498e-05|0|8.14341983641498e-05|8.14341983641498e-05|0|0|0|8.14341983641498e-05|8.14341983641498e-05
4|Category
4|3|0|5.68314899282996e-05|8.2188387750648e-05|2.53568978223484e-05|6.57776896938837e-05|6.57776896938837e-05|1.16198714234862e-05|1.35021411898352e-10|17.6653687254186|0.000197333069081651|0.000197333069081651
5|Category
5|4|0|3.15697689075023e-05|4.9253627366852e-05|1.76838584593497e-05|3.7798413359269e-05|3.7798413359269e-05|7.09251495570204e-06|5.03037683968571e-11|18.7640546926894|0.000151193653437076|0.000151193653437076
6|Category
6|1|0|1.89598704309901e-05|1.89598704309901e-05|0|1.89598704309901e-05|1.89598704309901e-05|0|0|0|1.89598704309901e-05|1.89598704309901e-05
(Sun Feb 22 13:23:02 2015) Command finished (0 sec) 


2. Check outputs against v.to.rast

# set g.region for raster (stats to be derived from this layer):
g.region -p -a raster=cahpa_i0apr_05216_nc_remapped_nc_1@prcp05216ijk
res=0.22  
projection: 3 (Latitude-Longitude)
zone:   0
datum:  wgs84
ellipsoid:  wgs84
north:  35:38:24N
south:  15:10:48S
west:   89:45:36E
east:   140:34:48E
nsres:  0:13:12
ewres:  0:13:12
rows:   231
cols:   231
cells:  53361

v.rast.stats map=BMR_bndry_epsg4326@prcp05216ijk
raster=cahpa_i0apr_05216_nc_remapped_nc_1@prcp05216ijk
column_prefix=teststat method=number,minimum,maximum,range,average,sum

Outputs from attribute table:
cat,province,teststat_number,teststat_minimum,teststat_maximum,teststat_range,teststat_average,teststat_sum
1,krung_thep_maha_nakhon_bangkok,2,3.58209799742326e-05,6.23035812168382e-05,2.64826012426056e-05,4.90622805955354e-05,9.81245611910708e-05
2,samut_prakan,1,3.53023679053877e-05,3.53023679053877e-05,0,3.53023679053877e-05,3.53023679053877e-05
3,nonthaburi,2,5.02148177474737e-05,8.14341983641498e-05,3.12193806166761e-05,6.58245080558117e-05,0.000131649016111623
4,pathum_thani,3,4.46328085672576e-05,8.2188387750648e-05,3.7791833904e-05,6.12175620820684e-05,0.000183652686246205
5,nakhon_pathom,3,3.81464305974077e-05,6.24195599812083e-05,2.42731293838006e-05,4.99398726484893e-05,0.000149819617945468
6,samut_sakhon,2,1.89598704309901e-05,7.74326545069925e-05,5.84727840760024e-05,4.81962624689913e-05,9.63925249379827e-05




--
View this message in context: 
http://osgeo-org.1560.x6.nabble.com/Searching-for-technical-details-on-how-v-rast-stats-calculates-means-and-other-statistics-tp5188809p5189188.html
Sent from the Grass

Re: [GRASS-user] Searching for technical details on how v.rast.stats calculates means and other statistics

2015-02-20 Thread RichardCooper
The output from g.region:
g.region -p 
projection: 3 (Latitude-Longitude)
zone:   0
datum:  wgs84
ellipsoid:  wgs84
north:  35:38:24N
south:  15:10:48S
west:   89:45:36E
east:   140:34:48E
nsres:  0:13:12
ewres:  0:13:12
rows:   231
cols:   231
cells:  53361

This is r.univar without the zone file:
r.univar map=cahpa_i0apr_05216_nc_remapped_nc_1@prcp05216ijk
total null and non-null cells: 53361
total null cells: 16564
Of the non-null cells:
--
n: 36797
minimum: 0
maximum: 0.00282167
range: 0.00282167
mean: 7.79549e-05
mean of absolute values: 7.79549e-05
standard deviation: 0.000106692
variance: 1.13832e-08
variation coefficient: 136.864 %
sum: 2.86850755307868
(Fri Feb 20 21:41:59 2015) Command finished (0 sec) 

Please also see my earlier comment, where I edited the previous message:
copied here:

> I'll need to check again, but there seems to be a mismatch between
> categories reported in r.univar and the actual category in the zone file.
> E.g. category 2 reported by r.univar is derived from category 1 of the
> zones file? 






--
View this message in context: 
http://osgeo-org.1560.x6.nabble.com/Searching-for-technical-details-on-how-v-rast-stats-calculates-means-and-other-statistics-tp5188809p5188937.html
Sent from the Grass - Users mailing list archive at Nabble.com.
___
grass-user mailing list
grass-user@lists.osgeo.org
http://lists.osgeo.org/mailman/listinfo/grass-user


Re: [GRASS-user] Searching for technical details on how v.rast.stats calculates means and other statistics

2015-02-20 Thread RichardCooper
I seem to be getting an error with r.univar when using a zone file.

I run, g.region as follows:
g.region -a raster=cahpa_i0apr_05216_nc_remapped_nc_1@prcp05216ijk res=0.22   

Then r.univar (see below).
There are 6 categories in the zone file, but r.univar reports null cells for
category 1? Initially I thought it was me not setting g.region correctly,
but I can't seem to get it to work as expected.

Any ideas would be welcome.

Cheers,
Richard

r.univar map=cahpa_i0apr_05216_nc_remapped_nc_1@prcp05216ijk
zones=BMR_bndry_epsg4326_rasterized@prcp05216ijk
zone 1 Category 1
total null and non-null cells: 4
total null cells: 0
Of the non-null cells:
--
n: 4
minimum: 3.5821e-05
maximum: 7.74327e-05
range: 4.16117e-05
mean: 5.6472e-05
mean of absolute values: 5.6472e-05
standard deviation: 1.53325e-05
variance: 2.35085e-10
variation coefficient: 27.1506 %
sum: 0.000225888012209907
zone 2 Category 2
total null and non-null cells: 2
total null cells: 0
Of the non-null cells:
--
n: 2
minimum: 3.53024e-05
maximum: 6.23036e-05
range: 2.70012e-05
mean: 4.8803e-05
mean of absolute values: 4.8803e-05
standard deviation: 1.35006e-05
variance: 1.82266e-10
variation coefficient: 27.6635 %
sum: 9.7605949159e-05
zone 3 Category 3
total null and non-null cells: 1
total null cells: 0
Of the non-null cells:
--
n: 1
minimum: 8.14342e-05
maximum: 8.14342e-05
range: 0
mean: 8.14342e-05
mean of absolute values: 8.14342e-05
standard deviation: 0
variance: 0
variation coefficient: 0 %
sum: 8.14341983641498e-05
zone 4 Category 4
total null and non-null cells: 3
total null cells: 0
Of the non-null cells:
--


This is my zones file:
Type of Map:  raster   Number of Categories: 6   
 |   Data Type:CELL   
 |   Rows: 231
 |   Columns:  231
 |   Total Cells:  53361  
 |Projection: Latitude-Longitude  
 |N:  35:38:24NS:  15:10:48S   Res: 0:13:12   
 |E: 140:34:48EW:  89:45:36E   Res: 0:13:12   
 |   Range of data:min = 1  max = 6   
 |
 |   Data Source: 
 |Vector Map: BMR_bndry_epsg4326@prcp05216ijk
 |Original scale from vector map: 1:1 
 |
 |   Data Description:
 |generated by v.to.rast  
 |
 |   Comments:   
 |v.to.rast input="BMR_bndry_epsg4326@prcp05216ijk" layer="1" type="ar\   
 |ea" output="BMR_bndry_epsg4326_rasterized" use="cat" value=1 memory=\   
 |300 
 | 


This is the raster file:

  Type of Map:  raster   Number of Categories: 0   
 |   Data Type:FCELL  
 |   Rows: 230
 |   Columns:  230
 |   Total Cells:  52900  
 |Projection: Latitude-Longitude  
 |N:  35:29:24NS:  15:06:36S   Res: 0:13:12   
 |E: 140:29:24EW:  89:53:24E   Res: 0:13:12   
 |   Range of data:min = 0  max = 0.002821672 
 |   



--
View this message in context: 
http://osgeo-org.1560.x6.nabble.com/Searching-for-technical-details-on-how-v-rast-stats-calculates-means-and-other-statistics-tp5188809p5188865.html
Sent from the Grass - Users mailing list archive at Nabble.com.
___
grass-user mailing list
grass-user@lists.osgeo.org
http://lists.osgeo.org/mailman/listinfo/grass-user


[GRASS-user] Searching for technical details on how v.rast.stats calculates means and other statistics

2015-02-19 Thread RichardCooper
Hi,

I'm trying to determine the specifics of how v.rast.stats calculates means
and other statistics, for which I have a couple of queries. 

I apologise in advance if this information exists online, but I couldn't
find all the details in module guidelines or related documents and scripts.

I understand that v.rast.stats uses v.to.rast and r.univar for determining
means and statistics.

Qu. 1. Raster cells are only created (by v.to.rast) if their centre point is
within the area boundary ?
I'm using a vector area layer, and my observation after rasterizing, is that
this is the case, and cells are not created if their centre point lies
outside the area boundary.

Qu. 2. If a single cell representing a unique category in the zones layer
(generated previously by v.to.rast) overlays four cells in the input raster,
how is the mean calculated. Is it a simple sum of the four cell values
divided by n number of cells (four in this case), or is the value weighted
in some way? Not being a expert programmer, I can't really tell from the
r.univar script, and it doesn't appear from my observation to be a simple
mean calculation.

Many thanks for your comments,

Richard


GRASS version: 7.0.0svn 
GRASS SVN Revision: 64042   
Build Date: 2015-01-10  
Build Platform: i686-pc-linux-gnu   
GDAL/OGR: 1.11.1
PROJ.4: 4.9.0   
GEOS: 3.4.2 
SQLite: 3.7.9   
Python: 2.7.3   
wxPython: 2.8.12.1  
Platform: Linux-3.2.0-31-generic-pae-i686-with-LinuxMint-13-maya



--
View this message in context: 
http://osgeo-org.1560.x6.nabble.com/Searching-for-technical-details-on-how-v-rast-stats-calculates-means-and-other-statistics-tp5188809.html
Sent from the Grass - Users mailing list archive at Nabble.com.
___
grass-user mailing list
grass-user@lists.osgeo.org
http://lists.osgeo.org/mailman/listinfo/grass-user


Re: [GRASS-user] t.register: ERROR: day is out of range for month

2015-02-03 Thread RichardCooper
Apologies for re-posting, but I noticed that much of the post's content
disappeared in the email.

Also, as an update I tried to add both a start and end date to the input
file (following the t.register manual) but still get the same error on
running t.register:

ERROR: day is out of range for month
ERROR: Unable to convert string "1951-02-29"into a datetime object

The process in more detail:
Aim: to process and analyse a 360 day (30 day/month) climate database

t.create --overwrite output=cahpa05216fgh_stvds type=stvds semantictype=max
title="cahpa_05216fgh_prcp_stvds" description="CAHPA05216 for MAPSETfgh
Precipitation STVDS" 

t.register --overwrite input=test_stvds type=vector
file=/home/rcooper/glist_fgh_vectors.out
Gathering map information...
ERROR: day is out of range for month
ERROR: Unable to convert string "1951-02-29"into a datetime object


Sample of 360 day file input to t.register:
... 
bnd_cahpa_f1jan_05216_nc_remapped_nc_28|1951-01-28 
bnd_cahpa_f1jan_05216_nc_remapped_nc_29|1951-01-29 
bnd_cahpa_f1jan_05216_nc_remapped_nc_30|1951-01-30
bnd_cahpa_f1feb_05216_nc_remapped_nc_1|1951-02-01 
bnd_cahpa_f1feb_05216_nc_remapped_nc_2|1951-02-02 
bnd_cahpa_f1feb_05216_nc_remapped_nc_3|1951-02-03 
... 
bnd_cahpa_f1feb_05216_nc_remapped_nc_28|1951-02-28 
bnd_cahpa_f1feb_05216_nc_remapped_nc_29|1951-02-29 
bnd_cahpa_f1feb_05216_nc_remapped_nc_30|1951-02-30
bnd_cahpa_f1mar_05216_nc_remapped_nc_1|1951-03-01 
bnd_cahpa_f1mar_05216_nc_remapped_nc_2|1951-03-02 
bnd_cahpa_f1mar_05216_nc_remapped_nc_3|1951-03-03 
bnd_cahpa_f1mar_05216_nc_remapped_nc_4|1951-03-04 
... 

GRASS version: 7.0.0svn 
GRASS SVN Revision: 64042   
Build Date: 2015-01-10  
Build Platform: i686-pc-linux-gnu   
GDAL/OGR: 1.11.1
PROJ.4: 4.9.0   
GEOS: 3.4.2 
SQLite: 3.7.9   
Python: 2.7.3   
wxPython: 2.8.12.1  
Platform: Linux-3.2.0-31-generic-pae-i686-with-LinuxMint-13-maya 






--
View this message in context: 
http://osgeo-org.1560.x6.nabble.com/t-register-ERROR-day-is-out-of-range-for-months-tp5185155p5185370.html
Sent from the Grass - Users mailing list archive at Nabble.com.
___
grass-user mailing list
grass-user@lists.osgeo.org
http://lists.osgeo.org/mailman/listinfo/grass-user


[GRASS-user] t.register: ERROR: day is out of range for months

2015-02-03 Thread RichardCooper
Hello,

I'm trying to register climate model data using t.register with a 360 day
year/30 day month.

I've created a text file containing layer names and dates (see sample
below), however on running t.register I get the following error:



Thanks for your help.

Cheers,
Richard





Sample of input file to t.register 
...
bnd_cahpa_f1jan_05216_nc_remapped_nc_28|1951-01-28
bnd_cahpa_f1jan_05216_nc_remapped_nc_29|1951-01-29
*bnd_cahpa_f1jan_05216_nc_remapped_nc_30|1951-01-30*
bnd_cahpa_f1feb_05216_nc_remapped_nc_1|1951-02-01
bnd_cahpa_f1feb_05216_nc_remapped_nc_2|1951-02-02
bnd_cahpa_f1feb_05216_nc_remapped_nc_3|1951-02-03
...
bnd_cahpa_f1feb_05216_nc_remapped_nc_28|1951-02-28
bnd_cahpa_f1feb_05216_nc_remapped_nc_29|1951-02-29
*bnd_cahpa_f1feb_05216_nc_remapped_nc_30|1951-02-30*
bnd_cahpa_f1mar_05216_nc_remapped_nc_1|1951-03-01
bnd_cahpa_f1mar_05216_nc_remapped_nc_2|1951-03-02
bnd_cahpa_f1mar_05216_nc_remapped_nc_3|1951-03-03
bnd_cahpa_f1mar_05216_nc_remapped_nc_4|1951-03-04
...




--
View this message in context: 
http://osgeo-org.1560.x6.nabble.com/t-register-ERROR-day-is-out-of-range-for-months-tp5185155.html
Sent from the Grass - Users mailing list archive at Nabble.com.
___
grass-user mailing list
grass-user@lists.osgeo.org
http://lists.osgeo.org/mailman/listinfo/grass-user


Re: [GRASS-user] v.in.ogr: error importing shapefiles

2015-01-10 Thread RichardCooper
Resolved: with SVN version r64042 imports without error.





--
View this message in context: 
http://osgeo-org.1560.x6.nabble.com/v-in-ogr-error-importing-shapefiles-tp5180777p5180932.html
Sent from the Grass - Users mailing list archive at Nabble.com.
___
grass-user mailing list
grass-user@lists.osgeo.org
http://lists.osgeo.org/mailman/listinfo/grass-user


Re: [GRASS-user] make errors updating from svn version 63929 to 64041

2015-01-10 Thread RichardCooper
Thanks, confirming installation goes fine with  r64042.



--
View this message in context: 
http://osgeo-org.1560.x6.nabble.com/make-errors-updating-from-svn-version-63929-to-64041-tp5180904p5180912.html
Sent from the Grass - Users mailing list archive at Nabble.com.
___
grass-user mailing list
grass-user@lists.osgeo.org
http://lists.osgeo.org/mailman/listinfo/grass-user


[GRASS-user] make errors updating from svn version 63929 to 64041

2015-01-09 Thread RichardCooper
Hi,

I'm getting a long list of errors on running make after svn update. I've
tried running make in some of the error listed directories, and also
ldconfig.

Any suggestions would be welcome.

Thanks,
Richard

Details of updating:






--
View this message in context: 
http://osgeo-org.1560.x6.nabble.com/make-errors-updating-from-svn-version-63929-to-64041-tp5180904.html
Sent from the Grass - Users mailing list archive at Nabble.com.
___
grass-user mailing list
grass-user@lists.osgeo.org
http://lists.osgeo.org/mailman/listinfo/grass-user


Re: [GRASS-user] v.in.ogr: error importing shapefiles

2015-01-09 Thread RichardCooper
Ticket added at https://trac.osgeo.org/grass/ticket/2539




--
View this message in context: 
http://osgeo-org.1560.x6.nabble.com/v-in-ogr-error-importing-shapefiles-tp5180777p5180782.html
Sent from the Grass - Users mailing list archive at Nabble.com.
___
grass-user mailing list
grass-user@lists.osgeo.org
http://lists.osgeo.org/mailman/listinfo/grass-user


[GRASS-user] v.in.ogr: error importing shapefiles

2015-01-09 Thread RichardCooper
Hi,

I'm getting the following error on attempting to import a shape file,
without success, with v.in.ogr:

>From the command console:
{{{
Traceback (most recent call last):
  File "/usr/lib/python2.7/dist-
packages/wx-2.8-gtk2-unicode/wx/lib/filebrowsebutton.py",
line 140, in OnChanged

self.changeCallback(evt)
  File "/home/user/grass70/grass-7.0.0svn/gui/wxpython/gu
i_core/gselect.py", line 1920, in OnUpdate

self._reloadLayers()
  File "/home/user/grass70/grass-7.0.0svn/gui/wxpython/gu
i_core/gselect.py", line 1945, in _reloadLayers

layerName, featureType, projection = map(lambda x:
x.strip(), line.split(','))
ValueError
:
too many values to unpack
{{{

And after clicking Import, I receive the following popup message:
No layers selected. Operation canceled

The above relates to 7.0.0svn:
{{{
System Info 
GRASS version: 7.0.0svn 
GRASS SVN Revision: 63929   
Build Date: 2015-01-02  
Build Platform: i686-pc-linux-gnu   
GDAL/OGR: 1.11.1
PROJ.4: 4.9.0   
GEOS: 3.4.2 
SQLite: 3.7.9   
Python: 2.7.3   
wxPython: 2.8.12.1  
Platform: Linux-3.2.0-31-generic-pae-i686-with-LinuxMint-13-maya
}}}

I've tried with a couple of shapefiles.

Cheers,
Richard



--
View this message in context: 
http://osgeo-org.1560.x6.nabble.com/v-in-ogr-error-importing-shapefiles-tp5180777.html
Sent from the Grass - Users mailing list archive at Nabble.com.
___
grass-user mailing list
grass-user@lists.osgeo.org
http://lists.osgeo.org/mailman/listinfo/grass-user


[GRASS-user] v.centerpoint: area geometric median calculations

2014-12-30 Thread RichardCooper
Hi,

I'm using the v.centerpoint addon to determine the* centre point of an area
(a country vector layer in degrees lat/long)*, and understand from the
manual that the geometric median will give a more robust answer than the
center of gravity with regard to possible outliers.

My query: for determining the centre of an area, is either of the median
calculations (minimum distance to area triangulation or boundary segments)
preferable? Is one more robust than the other, or is one method more widely
used? 

Thanks very much for your comments.

Cheers,
Richard

*http://grass.osgeo.org/grass70/manuals/addons/v.centerpoint.html



--
View this message in context: 
http://osgeo-org.1560.x6.nabble.com/v-centerpoint-area-geometric-median-calculations-tp5179521.html
Sent from the Grass - Users mailing list archive at Nabble.com.
___
grass-user mailing list
grass-user@lists.osgeo.org
http://lists.osgeo.org/mailman/listinfo/grass-user


Re: [GRASS-user] Error on importing ESRI grid into GRASS 7

2014-12-04 Thread RichardCooper
I'll take a look at 'mock'.

To confirm, I also tried importing into my Windows installation with GDAL
1.11.0 and no errors were output.

Although errors were output in the Linux installation (GDAL 1.10.0), a
comparison of univariate statistics from the imported file in the Windows
machine indicates that the entire file imported without error.

Cheers,
Richard





--
View this message in context: 
http://osgeo-org.1560.x6.nabble.com/Error-on-importing-ESRI-binary-grid-into-GRASS-7-tp5175645p5176479.html
Sent from the Grass - Users mailing list archive at Nabble.com.
___
grass-user mailing list
grass-user@lists.osgeo.org
http://lists.osgeo.org/mailman/listinfo/grass-user


Re: [GRASS-user] Error on importing ESRI grid into GRASS 7

2014-12-02 Thread RichardCooper
I upgraded GDAL to 1.10.0 (via the Ubuntu repository) and the GRASS instance,
but the error still persists.

I'll try compiling GDAL from source (1.11.1) but will need to investigate
configure options, which appear numerous, before applying to my system,
e.g.,
http://grasswiki.osgeo.org/wiki/Compile_and_Install_Ubuntu#GDAL

Richard


   



--
View this message in context: 
http://osgeo-org.1560.x6.nabble.com/Error-on-importing-ESRI-binary-grid-into-GRASS-7-tp5175645p5175941.html
Sent from the Grass - Users mailing list archive at Nabble.com.
___
grass-user mailing list
grass-user@lists.osgeo.org
http://lists.osgeo.org/mailman/listinfo/grass-user


[GRASS-user] Error on importing ESRI grid into GRASS 7

2014-11-29 Thread RichardCooper
Hi,

I receive the following error on importing an ESRI binary grid file into
GRASS 7.



I guess that the error can be ignored as the imported file type is float32
so there is no .vat file?  I'm not sure if related to GRASS or GDAL?

Cheers,
Richard







--
View this message in context: 
http://osgeo-org.1560.x6.nabble.com/Error-on-importing-ESRI-grid-into-GRASS-7-tp5175645.html
Sent from the Grass - Users mailing list archive at Nabble.com.
___
grass-user mailing list
grass-user@lists.osgeo.org
http://lists.osgeo.org/mailman/listinfo/grass-user


Re: [GRASS-user] Renaming layers: temporary/session and permanent renaming

2014-11-03 Thread RichardCooper
After reading the wxgui guidelines, I see that the expected behaviour is a
right click to enable a call to g.rename*. This is apparently not working in
my GRASS version as noted above? I'm able to rename directly in the layer
name, but this is temporary, and no g.rename window opens.


*Ref: grass70_release/dist.i686-pc-linux-gnu/docs/html/wxGUI.html
'A right mouse click on a layer or left clicking the button to the right of
the layer opens a dropdown menu with options to remove or rename the layer
(g.remove, g.rename),...' 



--
View this message in context: 
http://osgeo-org.1560.x6.nabble.com/Renaming-layers-temporary-session-and-permanent-renaming-tp5170973p5170981.html
Sent from the Grass - Users mailing list archive at Nabble.com.
___
grass-user mailing list
grass-user@lists.osgeo.org
http://lists.osgeo.org/mailman/listinfo/grass-user


[GRASS-user] Renaming layers: temporary/session and permanent renaming

2014-11-03 Thread RichardCooper
Hi,

I can permanently rename a layer listed in the Layer Manager using the
g.rename module accessible through the menu system: File > Manage maps.

However, it is also possible to rename a layer by right-clicking on the
layer and typing in a new name. If someone is new to GRASS they may assume
that this is permanent renaming, instead of only lasting for the session.
Just a suggestion, but it might be more informative to a user if the latter
is called 'Session rename' or 'Temporary rename'?

Cheers,
Richard







--
View this message in context: 
http://osgeo-org.1560.x6.nabble.com/Renaming-layers-temporary-session-and-permanent-renaming-tp5170973.html
Sent from the Grass - Users mailing list archive at Nabble.com.
___
grass-user mailing list
grass-user@lists.osgeo.org
http://lists.osgeo.org/mailman/listinfo/grass-user


Re: [GRASS-user] v.in.geonames not importing txt file in GRASS 7.0.0beta3 Windows

2014-10-17 Thread RichardCooper
Ticket opened at http://trac.osgeo.org/grass/ticket/2453

Richard



--
View this message in context: 
http://osgeo-org.1560.x6.nabble.com/v-in-geonames-not-importing-txt-file-in-GRASS-7-0-0beta3-Windows-tp5166832p5167965.html
Sent from the Grass - Users mailing list archive at Nabble.com.
___
grass-user mailing list
grass-user@lists.osgeo.org
http://lists.osgeo.org/mailman/listinfo/grass-user


Re: [GRASS-user] v.in.geonames not importing txt file in GRASS 7.0.0beta3 Windows

2014-10-16 Thread RichardCooper
Regarding the 7.0.0svn version on Linux(62228), Thai characters display
correctly when a point is queried in the Map Display.



--
View this message in context: 
http://osgeo-org.1560.x6.nabble.com/v-in-geonames-not-importing-txt-file-in-GRASS-7-0-0beta3-Windows-tp5166832p5167925.html
Sent from the Grass - Users mailing list archive at Nabble.com.
___
grass-user mailing list
grass-user@lists.osgeo.org
http://lists.osgeo.org/mailman/listinfo/grass-user


Re: [GRASS-user] v.in.geonames not importing txt file in GRASS 7.0.0beta3 Windows

2014-10-16 Thread RichardCooper
Hi,

I replaced the geonames script in my existing 7.0.0beta3 installation (I'm
using this version on my computer for teaching this week) and it imports
fine. I do notice however that in the Map Display, the Thai characters of
the 'alternatename' field are not displaying correctly in the query results
window (pls see below). However, Thai characters are correctly displayed in
the imported file's attribute table.

Query results of one point in Map Display:

geonames_th@asiapopthai: 
  Category: 78127
  Layer: 1
  Key_column: cat
  Database:
C:\Users\rcooper\grassdata7\chula_4326\asiapopthai\sqlite\sqlite.db
  Type: Point
  Driver: sqlite
  Table: geonames_th
  Attributes: 
name: Ban_Dong_Samphan
countrycode: TH
geonameid: 7680691
gtopo30: 198
featurecode: PPL
longitude: 102.96903
cat: 78127
admin1code: 76
modification: 2012-01-21
timezone: Asia/Bangkok
featureclass: P
latitude: 17.7022
asciiname: Ban_Dong_Samphan
*alternatename:
Ban_Dong_Samphan,ban_dng_samphanth,บ้านดงสัมพันธ์*
population: 0
  Id: 78127


Attribute table: alternatename field: *Ban Dong Samphan,ban dng
samphanth,บ้านดงสัมพันธ์*

Richard
  



--
View this message in context: 
http://osgeo-org.1560.x6.nabble.com/v-in-geonames-not-importing-txt-file-in-GRASS-7-0-0beta3-Windows-tp5166832p5167923.html
Sent from the Grass - Users mailing list archive at Nabble.com.
___
grass-user mailing list
grass-user@lists.osgeo.org
http://lists.osgeo.org/mailman/listinfo/grass-user

Re: [GRASS-user] v.in.geonames not importing txt file in GRASS 7.0.0beta3 Windows

2014-10-15 Thread RichardCooper
For reference, my system:

(Wed Oct 15 20:24:41 2014) Command finished (1 sec) 
System Info 
GRASS version: 7.0.0beta3   
GRASS SVN Revision: 61541   
Build Date: 2014-08-06  
Build Platform: i686-pc-mingw32 
GDAL/OGR: 1.11.0
PROJ.4: 4.8.0   
GEOS: 3.4.2 
SQLite: 3.7.17  
Python: 2.7.4   
wxPython: 2.8.12.1  
Platform: Windows-7-6.1.7601-SP1 

I also tried with geonames CZ.txt, as follows:
v.in.geonames --overwrite input=C:\Users\rcooper\CZ.txt output=czgeonames   
Converting 21931 place names...
cat: =0: No such file or directory
cat: output=czgeonames: No such file or directory
cat: y=5: No such file or directory
cat: input=C:\Users\rcooper\grassdata7/chula_4326/asiapoptha
i/.tmp/unknown/1804.0: No such file or directory
cat: columns=geonameid integer,name varchar(200),asciiname
varchar(200),alternatename varchar(4000),latitude double
precision,longitude double precision,featureclass
varchar(1),featurecode varchar(10),countrycode
varchar(2),cc2 varchar(60),admin1code varchar(20),admin2code
varchar(20),admin3code varchar(20),admin4code
varchar(20),population integer,elevation varchar(5),gtopo30
integer,timezone varchar(50),modification date: File or path
name too long
Description:
 Creates a vector map from an ASCII points file or ASCII
vector file.
Keywords:
 vector, import, ASCII
Usage:
 v.in.ascii [-zentbr] input=name output=name [format=string]
   [separator=character] [skip=value] [columns=string]
[x=value]
   [y=value] [z=value] [cat=value] [--overwrite] [--help]
[--verbose]
   [--quiet]
Flags:
  -z   Create 3D vector map
  -e   Create a new empty vector map and exit. Nothing is
read from input.
  -n   Don't expect a header when reading in standard format
  -t   Do not create table in points mode
  -b   Do not build topology in points mode
  -r   Only import points falling within current region
(points mode)
 --o   Allow output files to overwrite existing files
 --h   Print usage summary
 --v   Verbose module output
 --q   Quiet module output
Parameters:
  input   Name of input file to be imported
   '-' for standard input
 output   Name for output vector map
 format   Input file format
  options: point,standard
  default: point
   point: simple x,y[,z] list
   standard: GRASS vector ASCII format
  separator   Field separator
   Special characters: pipe, comma, space, tab,
newline
  default: pipe
   skip   Number of header lines to skip at top of input
file (points mode)
  default: 0
columns   Column definition in SQL style (points mode)
   For example: 'x double precision, y double
precision, cat int, name varchar(10)'
  x   Number of column used as x coordinate (points
mode)
   First column is 1
  default: 1
  y   Number of column used as y coordinate (points
mode)
   First column is 1
  default: 2
  z   Number of column used as z coordinate (points
mode)
   First column is 1. If 0, z coordinate is not
used
  default: 0
cat   Number of column used as category (points
mode)
   First column is 1. If 0, unique category is
assigned to each row and written to new column 'cat'
  default: 0
ERROR: Required parameter  not set:
(Name of input file to be imported)
ERROR: Required parameter  not set:
(Name for output vector map)
ERROR: Vector map  not found
(Wed Oct 15 20:29:34 2014) Command finished (8 sec) 





--
View this message in context: 
http://osgeo-org.1560.x6.nabble.com/v-in-geonames-not-importing-txt-file-in-GRASS-7-0-0beta3-Windows-tp5166832p5167650.html
Sent from the Grass - Users mailing list archive at Nabble.com.
___
grass-user mailing list
grass-user@lists.osgeo.org
http://lists.osgeo.org/mailman/listinfo/grass-user


[GRASS-user] v.in.geonames not importing txt file in GRASS 7.0.0beta3 Windows

2014-10-10 Thread RichardCooper
Hi,

I'm getting the following error on attempting to import geonames into GRASS
7.0.0beta3 on Windows7.

I've tried to import via the GUI and command console without success.
However, it does import with GRASS 7svn[57721] on Linux.

Richard

(Fri Oct 10 16:47:43 2014)  
v.in.geonames input=C:\Users\rcooper\Desktop\TH.txt output=geonames_th  
Converting 171472 place names...
cat: =0: No such file or directory
cat: output=geonames_th: No such file or directory
cat: y=5: No such file or directory
cat: input=C:\Users\rcooper\grassdata7/chula_4326/asiapoptha
i/.tmp/unknown/408.0: No such file or directory
cat: columns=geonameid integer,name varchar(200),asciiname
varchar(200),alternatename varchar(4000),latitude double
precision,longitude double precision,featureclass
varchar(1),featurecode varchar(10),countrycode
varchar(2),cc2 varchar(60),admin1code varchar(20),admin2code
varchar(20),admin3code varchar(20),admin4code
varchar(20),population integer,elevation varchar(5),gtopo30
integer,timezone varchar(50),modification date: File or path
name too long
Description:
 Creates a vector map from an ASCII points file or ASCII
vector file.
Keywords:
 vector, import, ASCII
Usage:
 v.in.ascii [-zentbr] input=name output=name [format=string]
   [separator=character] [skip=value] [columns=string]
[x=value]
   [y=value] [z=value] [cat=value] [--overwrite] [--help]
[--verbose]
   [--quiet]
Flags:
  -z   Create 3D vector map
  -e   Create a new empty vector map and exit. Nothing is
read from input.
  -n   Don't expect a header when reading in standard format
  -t   Do not create table in points mode
  -b   Do not build topology in points mode
  -r   Only import points falling within current region
(points mode)
 --o   Allow output files to overwrite existing files
 --h   Print usage summary
 --v   Verbose module output
 --q   Quiet module output
Parameters:
  input   Name of input file to be imported
   '-' for standard input
 output   Name for output vector map
 format   Input file format
  options: point,standard
  default: point
   point: simple x,y[,z] list
   standard: GRASS vector ASCII format
  separator   Field separator
   Special characters: pipe, comma, space, tab,
newline
  default: pipe
   skip   Number of header lines to skip at top of input
file (points mode)
  default: 0
columns   Column definition in SQL style (points mode)
   For example: 'x double precision, y double
precision, cat int, name varchar(10)'
  x   Number of column used as x coordinate (points
mode)
   First column is 1
  default: 1
  y   Number of column used as y coordinate (points
mode)
   First column is 1
  default: 2
  z   Number of column used as z coordinate (points
mode)
   First column is 1. If 0, z coordinate is not
used
  default: 0
cat   Number of column used as category (points
mode)
   First column is 1. If 0, unique category is
assigned to each row and written to new column 'cat'
  default: 0
ERROR: Required parameter  not set:
(Name of input file to be imported)
ERROR: Required parameter  not set:
(Name for output vector map)
*ERROR: Vector map  not found*





--
View this message in context: 
http://osgeo-org.1560.x6.nabble.com/v-in-geonames-not-importing-txt-file-in-GRASS-7-0-0beta3-Windows-tp5166832.html
Sent from the Grass - Users mailing list archive at Nabble.com.
___
grass-user mailing list
grass-user@lists.osgeo.org
http://lists.osgeo.org/mailman/listinfo/grass-user


[GRASS-user] Delineation of Pfaffstetter basins

2014-02-26 Thread RichardCooper
Hi,

I was wondering if there is an automated approach and/or more guidelines*
for delineating Pfafstetter basins with GRASS?

I'm using r.stream.order and r.stream.basins modules  (as described in 
Jasiewicz & Metz (2011)), but uncertain as to the best approach to delineate
Pfafstetter basins.

Using r.stream.extract, I've output stream_rast, stream_vect and direction
layers.

Using r.stream.order, output a layer with Strahler's stream order

However, what is the best approach to output Pfafstetter basin topology
using r.stream.basins/r.reclass?


The challenge it seems is to generate data on tributary accumulations for
ordering of the Pfafstetter basins ... ?

Cheers,
Richard

*I've consulted 
http://grasswiki.osgeo.org/wiki/R.stream.*

Jasiewicz J, Metz M (2011) A new GRASS GIS toolkit for Hortonian analysis of
drainage networks. Computers & Geosciences 37 (2011) 1162–1173,
doi:10.1016/j.cageo.2011.03.003

r.stream.order/basins/order module guidelines



--
View this message in context: 
http://osgeo-org.1560.x6.nabble.com/Delineation-of-Pfaffstetter-basins-tp5106266.html
Sent from the Grass - Users mailing list archive at Nabble.com.
___
grass-user mailing list
grass-user@lists.osgeo.org
http://lists.osgeo.org/mailman/listinfo/grass-user

Re: [GRASS-user] v.to.rast densify option gives null output

2014-02-21 Thread RichardCooper
Thanks. I converted to lines, added categories and rasterized:

v.type input=waterways_finaledit@PERMANENT output=waterways_finaledit_lines
from_type=boundary to_type=line

v.category input=waterways_finaledit_lines@PERMANENT type=line
output=waterways_finaledit_lines_catadd option=add

v.to.rast -d --overwrite --verbose
input=waterways_finaledit_lines_catadd@PERMANENT type=line
output=waterways_finaledit_lines_catadd_vtr_dense use=val value=5

Richard





--
View this message in context: 
http://osgeo-org.1560.x6.nabble.com/v-to-rast-densify-option-gives-null-output-tp5105039p5105061.html
Sent from the Grass - Users mailing list archive at Nabble.com.
___
grass-user mailing list
grass-user@lists.osgeo.org
http://lists.osgeo.org/mailman/listinfo/grass-user


[GRASS-user] v.to.rast densify option gives null output

2014-02-21 Thread RichardCooper
Hi,

When I use the -d flag in v.to.rast, cells output are null. Omitting the -d
flag works fine for rasterization with default thin lines.

Not sure how to resolve. Is there an alternative GRASS module that can do
the same?

Cheers,
Richard
GRASS GIS 7.0 svn / rev 57721 / python 2.7.3 
Mint Linux / Ubuntu Precise 


Example of output:
v.to.rast -d --overwrite input=waterways_finaledit@PERMANENT type=area
output=waterways_finaledit_vtr_dense use=val value=5
Pass 1 of 3:
Reading areas...
Reading features...
Writing raster map...
Pass 2 of 3:
Reading areas...
Writing raster map...
Pass 3 of 3:
Reading areas...
Writing raster map...
Converted areas: 8415 of 13694
v.to.rast complete.


Type of Map:  raster   Number of Categories: 0   |
 |   Data Type:CELL  
|
 |   Rows: 11319 
|
 |   Columns:  7737  
|
 |   Total Cells:  87575103  
|
 |Projection: UTM (zone 47)  
|
 |N:2379330S:1360620   Res:90
|
 |E: 971010W: 274680   Res:90
|
 |   Range of data:min = NULL  max = NULL
|
 |   
|
 |   Data Source:
|
 |Vector Map: waterways_finaledit@PERMANENT  
|
 |Original scale from vector map: 1:1
|
 |   
|
 |   Data Description:   
|
 |generated by v.to.rast  



--
View this message in context: 
http://osgeo-org.1560.x6.nabble.com/v-to-rast-densify-option-gives-null-output-tp5105039.html
Sent from the Grass - Users mailing list archive at Nabble.com.
___
grass-user mailing list
grass-user@lists.osgeo.org
http://lists.osgeo.org/mailman/listinfo/grass-user