Re: [GRASS-user] Importing ASCII file
On Friday 24 of August 2012 13:16:40 sotototo wrote: Hi, Hi! Is there a way to calculate automatically the annual radiation in r.sun because the algorithm calculates one day at a time. Please, care to post mails with a clear and meaningful subject. All you need to do is to estimate the wanted daily values, sum'em up and, of course, divide them by the corresponding number of days. A simple script (bash or python) I guess would do it. Nikos ps- I've sent you some old (bash) scripts I've used for this (or relevant) -- hope they are useful! ___ grass-user mailing list grass-user@lists.osgeo.org http://lists.osgeo.org/mailman/listinfo/grass-user
Re: [GRASS-user] Importing ASCII file
I think you should run r.in.ascii http://grass.osgeo.org/grass63/manuals/html63_user/r.in.ascii.html if you want to use r.sun you have to import the digital terrain model first. then you have to create a slope and an aspect rasters and then run r.sun with the r.slope.aspect command http://grass.osgeo.org/grass63/manuals/html63_user/r.slope.aspect.html and then finally running r.sun El 24/08/12 03:13, sotototo escribió: Hi, Im new to Grass GIS and I have the same problem. I have an ascii Lidar data set with XYZ values in the following format. ncols 1999 nrows 1998 xllcorner 459000.27618609 yllcorner 298999.76202791 cellsize 0.5 NODATA_value - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - When I run r.in.arc I get the following error. Illegal yllcorner value in header: 298999.76202791 Illegal latitude for North ERROR: Can't get cell header I tried r.in.xyz and I got this error. ERROR: Not enough data columns. Incorrect delimiter or column number? Found the following character(s) in row 1: [ncols 1999] I also tried the r3.in.ascii and i got this error. ERROR: readHeaderString: header value invalid .. So could you please tell me if i do something wrong? I actually want to use the r.sun algorithm to calculate solar radiation and if Im not mistaken the first step is to import first the ascii file to GRASS. Thank you -- View this message in context: http://osgeo-org.1560.n6.nabble.com/Importing-ASCII-file-tp4984276p4997492.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 -- Alberto Pettazzi MeteoGalicia - Departamento de Climatología y Observación Consellería de Medio Ambiente, Territorio e Infraestruturas Rúa de Roma, 6 15707 Santiago de Compostela. A Coruña Teléfono: +34-881-999646 e-mail: alberto.petta...@meteogalicia.es mailto:alberto.petta...@meteogalicia.es ___ grass-user mailing list grass-user@lists.osgeo.org http://lists.osgeo.org/mailman/listinfo/grass-user
Re: [GRASS-user] Importing ASCII file
Hi, I think that the real problem is about the projection system in your raster file: xllcorner 459000.27618609 yllcorner 298999.76202791 and the error: Illegal latitude for North = grass just say that a latitue of 298999° is irrelevant ;) so there are 2 possibilities: 1 - your raster file use a projection and you need to import it into a new location with this projection 2 - the raster is really in decimal lat/lon, but *1 = xllcorner = 45.9 ° and yllcorner = 29.89° as your are using lidar data at a resolution of 0,5 it seems to me that the unit used in your ratser coordinate is meters, so you need to know the raster coordinate system before you can use it ;) cheers, Sylvain 2012/8/24 Alberto Pettazzi alberto.petta...@meteogalicia.es I think you should run r.in.ascii http://grass.osgeo.org/grass63/manuals/html63_user/r.in.ascii.html if you want to use r.sun you have to import the digital terrain model first. then you have to create a slope and an aspect rasters and then run r.sun with the r.slope.aspect command http://grass.osgeo.org/grass63/manuals/html63_user/r.slope.aspect.html and then finally running r.sun El 24/08/12 03:13, sotototo escribió: Hi, Im new to Grass GIS and I have the same problem. I have an ascii Lidar data set with XYZ values in the following format. ncols 1999 nrows 1998 xllcorner 459000.27618609 yllcorner 298999.76202791 cellsize 0.5 NODATA_value - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - When I run r.in.arc I get the following error. Illegal yllcorner value in header: 298999.76202791 Illegal latitude for North ERROR: Can't get cell header I tried r.in.xyz and I got this error. ERROR: Not enough data columns. Incorrect delimiter or column number? Found the following character(s) in row 1: [ncols 1999] I also tried the r3.in.ascii and i got this error. ERROR: readHeaderString: header value invalid .. So could you please tell me if i do something wrong? I actually want to use the r.sun algorithm to calculate solar radiation and if Im not mistaken the first step is to import first the ascii file to GRASS. Thank you -- View this message in context: http://osgeo-org.1560.n6.nabble.com/Importing-ASCII-file-tp4984276p4997492.html Sent from the Grass - Users mailing list archive at Nabble.com. ___ grass-user mailing listgrass-user@lists.osgeo.orghttp://lists.osgeo.org/mailman/listinfo/grass-user -- Alberto Pettazzi MeteoGalicia - Departamento de Climatología y Observación Consellería de Medio Ambiente, Territorio e Infraestruturas Rúa de Roma, 6 15707 Santiago de Compostela. A Coruña Teléfono: +34-881-999646 e-mail: alberto.petta...@meteogalicia.es ___ grass-user mailing list grass-user@lists.osgeo.org http://lists.osgeo.org/mailman/listinfo/grass-user ___ grass-user mailing list grass-user@lists.osgeo.org http://lists.osgeo.org/mailman/listinfo/grass-user
Re: [GRASS-user] Importing ASCII file
Hi, The projection system that I use is British_National_Grid Transverse_Mercator and the GCS_OSGB_1936. I imported the projection and the I ran r.in.arc and it worked! Thank you very much Actually my main purpose is to run the r.sun algorithm and calculate an annual solar radiation if possible. The ascii file that I use is already digitized from a DSM because I want to use certain areas(roofs) to calculate the solar radiation. So to use r.sun for my ascii file do I have to import first the original DSM dataset and calculate slope and aspect with r.slope.aspect and then run r.sun importing my ascii file? Does this makes sence at all? Thank you very much -- View this message in context: http://osgeo-org.1560.n6.nabble.com/Importing-ASCII-file-tp4984276p4997571.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] Importing ASCII file
I tested the r.sun algorithm on my DSM and DTM dataset by importing the DSM first and then executing the r.slope.aspect algorithm. Then I run the the r.sun algorithm and I imported the DSM, slope and aspect and as an output I chose only the Total global irradiance/irradiation option. The result was a very low resolution image.(Very large pixels) My DSM-DTM data set has a resolution of 0.5 meters though. Does this means that r.sun has a fixed resolution or am I doing something wrong? Thank you in advance. -- View this message in context: http://osgeo-org.1560.n6.nabble.com/Importing-ASCII-file-tp4984276p4997661.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] Importing ASCII file
I tested the r.sun algorithm on my DSM and DTM dataset by importing the DSM first and then executing the r.slope.aspect algorithm. Then I run the the r.sun algorithm and I imported the DSM, slope and aspect and as an output I chose only the Total global irradiance/irradiation option. The result was a very low resolution image.(Very large pixels) My DSM-DTM data set has a resolution of 0.5 meters though. Does this means that r.sun has a fixed resolution or am I doing something wrong? Thank you in advance. -- View this message in context: http://osgeo-org.1560.n6.nabble.com/Importing-ASCII-file-tp4984276p4997663.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] Importing ASCII file
I tested the r.sun algorithm on my DSM and DTM dataset by importing the DSM first and then executing the r.slope.aspect algorithm. Then I run the the r.sun algorithm and I imported the DSM, slope and aspect and as an output I chose only the Total global irradiance/irradiation option. The result was a very low resolution image.(Very large pixels) My DSM-DTM data set has a resolution of 0.5 meters though. Does this means that r.sun has a fixed resolution or am I doing something wrong? Thank you in advance. -- View this message in context: http://osgeo-org.1560.n6.nabble.com/Importing-ASCII-file-tp4984276p4997673.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] Importing ASCII file
Hi, The problem was that I had to run the g.region first so that I would set up my raster resolution!!! Then I imported my DSM, ran first r.slope.aspect to calculate slope and aspect and then I ran the r.sun algorithm and I had my first correct results!! Thank you very much everybody for your valuable help!! -- View this message in context: http://osgeo-org.1560.n6.nabble.com/Importing-ASCII-file-tp4984276p4997732.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] Importing ASCII file
Hi, Is there a way to calculate automatically the annual radiation in r.sun because the algorithm calculates one day at a time. Thank you -- View this message in context: http://osgeo-org.1560.n6.nabble.com/Importing-ASCII-file-tp4984276p4997735.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] Importing ASCII file
Hi, Im new to Grass GIS and I have the same problem. I have an ascii Lidar data set with XYZ values in the following format. ncols 1999 nrows 1998 xllcorner 459000.27618609 yllcorner 298999.76202791 cellsize 0.5 NODATA_value - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - When I run r.in.arc I get the following error. Illegal yllcorner value in header: 298999.76202791 Illegal latitude for North ERROR: Can't get cell header I tried r.in.xyz and I got this error. ERROR: Not enough data columns. Incorrect delimiter or column number? Found the following character(s) in row 1: [ncols 1999] I also tried the r3.in.ascii and i got this error. ERROR: readHeaderString: header value invalid .. So could you please tell me if i do something wrong? I actually want to use the r.sun algorithm to calculate solar radiation and if Im not mistaken the first step is to import first the ascii file to GRASS. Thank you -- View this message in context: http://osgeo-org.1560.n6.nabble.com/Importing-ASCII-file-tp4984276p4997492.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] Importing ASCII file
Rainer, Good idea. Here's the output of gdalinfo: gdalinfo prec_1.asc Driver: AAIGrid/Arc/Info ASCII Grid Files: prec_1.asc Size is 43200, 18000 Coordinate System is `' Origin = (-180.000,90.000) Pixel Size = (0.008,-0.008) Corner Coordinates: Upper Left (-180.000, 90.000) Lower Left (-180.000, -60.000) Upper Right ( 180.000, 90.000) Lower Right ( 180.000, -60.000) Center ( 0.000, 15.000) Band 1 Block=43200x1 Type=Int32, ColorInterp=Undefined NoData Value=- So it looks like Arc/Info ASCII grid is correct. Hamish, you're right, editing the cell size even with vi would be painful. I wouldn't be afraid to name names about the software, but the fact of the matter is that I don't know what software it is. I downloaded the data from http://www.ccafs-climate.org/data/ In any case, using the -l flag did the trick! Thanks a ton, that makes my day :) Case closed! Best, Daniel ___ grass-user mailing list grass-user@lists.osgeo.org http://lists.osgeo.org/mailman/listinfo/grass-user
Re: [GRASS-user] Importing ASCII file
Hi, http://osgeo-org.1560.n6.nabble.com/r-in-gdal-worldclim-data-G-set-window-geographic-latitude-not-valid-for-north-td3889261.html gdal_translate -a_ullr -180 90 180 -60 input_worldclim/hdr.adf new_boundary.tif g.region n=90N s=60S e=180E w=180W res=00:00:30 r.in.gdal input=new_boundary.tif output=worldclim_map Cheers Stefano www.spatial-ecology.net -Original Message- From: Daniel Lee [mailto:l...@isi-solutions.org] Sent: Thursday, June 28, 2012 08:30 AM To: 'Rainer M Krug' Cc: 'Rich Shepard', 'GRASS user list' Subject: Re: [GRASS-user] Importing ASCII file Rainer, Good idea. Here's the output of gdalinfo: gdalinfo prec_1.asc Driver: AAIGrid/Arc/Info ASCII Grid Files: prec_1.asc Size is 43200, 18000 Coordinate System is `' Origin = (-180.000,90.000) Pixel Size = (0.008,-0.008) Corner Coordinates: Upper Left (-180.000, 90.000) Lower Left (-180.000, -60.000) Upper Right ( 180.000, 90.000) Lower Right ( 180.000, -60.000) Center ( 0.000, 15.000) Band 1 Block=43200x1 Type=Int32, ColorInterp=Undefined NoData Value=- So it looks like Arc/Info ASCII grid is correct. Hamish, you're right, editing the cell size even with vi would be painful. I wouldn't be afraid to name names about the software, but the fact of the matter is that I don't know what software it is. I downloaded the data from http://www.ccafs-climate.org/data/ In any case, using the -l flag did the trick! Thanks a ton, that makes my day :) Case closed! Best, Daniel ___ grass-user mailing list grass-user@lists.osgeo.org http://lists.osgeo.org/mailman/listinfo/grass-user
[GRASS-user] Importing ASCII file
Dear list, I'm having a lot of trouble importing some ASCII data into GRASS. The data is pretty large (each file is 3.7 GB and I've got a ton of them) and has the ending *.asc. It seems like a perfect case for r.in.arc, but r.in.arc isn't working. Here's some info: Command output: r.in.arc input=/home/lee/co2/daten/gcm_results/prec_1.asc output=prec_1 Illegal latitude for North ERROR: Can't get cell header The cell header looks pretty tame. The contents: ncols 43200 nrows 18000 xllcorner -180 yllcorner -60 cellsize 0.008337679505 NODATA_value - @ The output of g.region -p: g.region -p projection: 3 (Latitude-Longitude) zone: 0 datum: wgs84 ellipsoid: wgs84 north: 90N south: 90S west: 180W east: 180E nsres: 1 ewres: 1 rows: 180 cols: 360 cells: 64800 Looks like it should work, right? Does anybody have any ideas? I've be really grateful for any help :) Best, Daniel -- B.Sc. Daniel Lee Geschäftsführung für Forschung und Entwicklung ISIS - International Solar Information Solutions GbR Vertreten durch: Daniel Lee, Nepomuk Reinhard und Nils Räder Softwarecenter 3 35037 Marburg Festnetz: +49 6421 379 6256 Mobil: +49 176 6127 7269 E-Mail: l...@isi-solutions.org Web: http://www.isi-solutions.org ___ grass-user mailing list grass-user@lists.osgeo.org http://lists.osgeo.org/mailman/listinfo/grass-user
Re: [GRASS-user] Importing ASCII file
Hi Rich, Thanks for the tip. Unfortunately, r.in.ascii is made for files with another type of header. Nonetheless, I tried it and here's the output: r.in.ascii input=/home/lee/co2/daten/gcm_results/prec_1.asc output=test north field missing from header south field missing from header east field missing from header west field missing from header rows field missing from header cols field missing from header Illegal row value ERROR: Can't get cell header Those values aren't in the header though and the requirements of r.in.arc match the header :( QGIS manages to open it, but I don't know how to script it and it's quite a large number of datasets. Any other ideas? Does anyone have experience with opening and exporting rasters in QGIS from a script? That would make things a bit easier, otherwise it takes a good 5 minutes or so to open each file. Thanks! Daniel -- B.Sc. Daniel Lee Geschäftsführung für Forschung und Entwicklung ISIS - International Solar Information Solutions GbR Vertreten durch: Daniel Lee, Nepomuk Reinhard und Nils Räder Softwarecenter 3 35037 Marburg Festnetz: +49 6421 379 6256 Mobil: +49 176 6127 7269 E-Mail: l...@isi-solutions.org Web: http://www.isi-solutions.org 2012/6/27 Rich Shepard rshep...@appl-ecosys.com On Wed, 27 Jun 2012, Daniel Lee wrote: I'm having a lot of trouble importing some ASCII data into GRASS. It seems like a perfect case for r.in.arc, but r.in.arc isn't working. Here's some info: Daniel, From the 6.5 manual r. index: r.in.arcConverts an ESRI ARC/INFO ascii raster file (GRID) into a (binary) raster map layer. r.in.ascii Converts ASCII raster file to binary raster map layer. Try r.in.ascii. Rich -- Richard B. Shepard, Ph.D. | Integrity - Credibility - Innovation Applied Ecosystem Services, Inc. |Helping Ensure Our Clients' Futures http://www.appl-ecosys.com Voice: 503-667-4517 Fax: 503-667-8863 __**_ grass-user mailing list grass-user@lists.osgeo.org http://lists.osgeo.org/**mailman/listinfo/grass-userhttp://lists.osgeo.org/mailman/listinfo/grass-user ___ grass-user mailing list grass-user@lists.osgeo.org http://lists.osgeo.org/mailman/listinfo/grass-user
Re: [GRASS-user] Importing ASCII file
On Wed, 27 Jun 2012, Daniel Lee wrote: Thanks for the tip. Unfortunately, r.in.ascii is made for files with another type of header. Nonetheless, I tried it and here's the output: Daniel, Then I've no idea how to advise you to proceed. I'm sure others have the solution for you. Good luck, Rich -- Richard B. Shepard, Ph.D. | Integrity - Credibility - Innovation Applied Ecosystem Services, Inc. |Helping Ensure Our Clients' Futures http://www.appl-ecosys.com Voice: 503-667-4517 Fax: 503-667-8863 ___ grass-user mailing list grass-user@lists.osgeo.org http://lists.osgeo.org/mailman/listinfo/grass-user
Re: [GRASS-user] Importing ASCII file
-BEGIN PGP SIGNED MESSAGE- Hash: SHA1 On 27/06/12 18:36, Daniel Lee wrote: Hi Rich, Thanks for the tip. Unfortunately, r.in.ascii is made for files with another type of header. Nonetheless, I tried it and here's the output: r.in.ascii input=/home/lee/co2/daten/gcm_results/prec_1.asc output=test north field missing from header south field missing from header east field missing from header west field missing from header rows field missing from header cols field missing from header Illegal row value ERROR: Can't get cell header I just checked - I have files with the extension .asc which start as follow: ncols 790 nrows 210 xllcorner 574000 yllcorner 6242000 cellsize 100.00 NODATA_value - - - - - - ... and I read them in via r.in.arc and it works ... As I said, try the gdal, maybe more robust? Rainer Those values aren't in the header though and the requirements of r.in.arc match the header :( QGIS manages to open it, but I don't know how to script it and it's quite a large number of datasets. Any other ideas? Does anyone have experience with opening and exporting rasters in QGIS from a script? That would make things a bit easier, otherwise it takes a good 5 minutes or so to open each file. Thanks! Daniel -- B.Sc. Daniel Lee Geschäftsführung für Forschung und Entwicklung ISIS - International Solar Information Solutions GbR Vertreten durch: Daniel Lee, Nepomuk Reinhard und Nils Räder Softwarecenter 3 35037 Marburg Festnetz: +49 6421 379 6256 Mobil: +49 176 6127 7269 E-Mail: l...@isi-solutions.org mailto:l...@isi-solutions.org Web: http://www.isi-solutions.org http://www.isi-solutions.org/ 2012/6/27 Rich Shepard rshep...@appl-ecosys.com mailto:rshep...@appl-ecosys.com On Wed, 27 Jun 2012, Daniel Lee wrote: I'm having a lot of trouble importing some ASCII data into GRASS. It seems like a perfect case for r.in.arc, but r.in.arc isn't working. Here's some info: Daniel, From the 6.5 manual r. index: r.in.arcConverts an ESRI ARC/INFO ascii raster file (GRID) into a (binary) raster map layer. r.in.ascii Converts ASCII raster file to binary raster map layer. Try r.in.ascii. Rich -- Richard B. Shepard, Ph.D. | Integrity - Credibility - Innovation Applied Ecosystem Services, Inc. |Helping Ensure Our Clients' Futures http://www.appl-ecosys.com Voice: 503-667-4517 tel:503-667-4517 Fax: 503-667-8863 tel:503-667-8863 _ grass-user mailing list grass-user@lists.osgeo.org mailto:grass-user@lists.osgeo.org http://lists.osgeo.org/__mailman/listinfo/grass-user http://lists.osgeo.org/mailman/listinfo/grass-user ___ grass-user mailing list grass-user@lists.osgeo.org http://lists.osgeo.org/mailman/listinfo/grass-user -BEGIN PGP SIGNATURE- Version: GnuPG v1.4.11 (GNU/Linux) Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org/ iEYEARECAAYFAk/rSg4ACgkQoYgNqgF2egqDVwCcDcPjxlgBCeKosEBqMthvh8J4 /00An02EcYMFwxw+z6IvS+p48xros2Yy =GHGx -END PGP SIGNATURE- ___ grass-user mailing list grass-user@lists.osgeo.org http://lists.osgeo.org/mailman/listinfo/grass-user
Re: [GRASS-user] Importing ASCII file
Daniel wrote: I'm having a lot of trouble importing some ASCII data into GRASS. The data is pretty large (each file is 3.7 GB and I've got a ton of them) and has the ending *.asc. It seems like a perfect case for r.in.arc, indeed, r.in.arc is the right tool for the job. but r.in.arc isn't working. Here's some info: Command output: r.in.arc input=/home/lee/co2/daten/gcm_results/prec_1.asc output=prec_1 Illegal latitude for North ERROR: Can't get cell header The cell header looks pretty tame. The contents: ncols 43200 nrows 18000 xllcorner -180 yllcorner -60 cellsize 0.008337679505 NODATA_value - the problem is with broken cellsize value, resulting in a latitude beyond the north pole. 0.008337679505 * 18000 - 60 ans = 90.07823109 which is 90. it seems that whatever software exported it (don't be afraid to name names :) was holding or calculating the resolution with single-precision floating point numbers but exporting it as if it were a double-precision number. So the second half the number is inexact jibberish. Edit the cell size back to 0.00833 (no small feat with a 3.7gb file, even for vi) and it'll work. Importing with GDAL would give the same illegal-north latitude result, although r.in.gdal now has a '-l' flag to reset the northern boundary into something legal (after which you Must repair it to the real value with r.region), although you could get the same effect by editing the header to lie about the cellsize or southern value to get it to fit into legal lat/lon, then again use r.region to set the bounds exactly. (the resolution as seen with r.info should end up exactly at 30 arc- sec; bypass the built in failsafe checks at your own risk) But the real solution is to get the software that created it to not export broken files. If works in QGIS because QGIS doesn't maintain an idea about polar coordinate systems, it just sees everything in Cartesian space and even a latitude of 50 won't worry it. (which, fwiw, is why raster-wrap at 180 longitude and geodesic lines work easily in GRASS but not QGIS) [not to single out QGIS, most other software don't do it either] Hamish ___ grass-user mailing list grass-user@lists.osgeo.org http://lists.osgeo.org/mailman/listinfo/grass-user