Re: [GRASS-user] Need help in reprojecting raster images
Thank you all. It worked. However I noticed that the projected boundary values of N, S, W and E in GRASS are not same as the values obtained from projecting the same image in ENVI image processing software and in gdalwarp. Projection of the scene in Lambert Azimuthal Equal Area is similar (but not exactly equal) in GRASS and gdal, but in ENVI it is totally different. I just did the comparison to see if things are similar from different softwares in case they have to be ported to other platforms. Any comments is appreciated. Uttam. On Wed, Sep 23, 2015 at 12:35 PM, Veronica Andreo wrote: > Hi Uttam, > > you may want to first do v.in.region in your input location, this creates > a vector with the limits of your input location (set g.region to your > raster of interest first), then v.proj the output of v.in.region in your > target location, set region there with the imported vector and just then > try to reproject the raster image. > > so, steps would be: > > # in input_location > g.region raster=your_raster > > v.in.region output=vector_region_of_interest > > # in target location > v.proj location=input_location mapset=input_mapset > input=vector_region_of_interest output=projected_boundaries > > g.region vector=projected_boundaries > > r.proj location=input_location mapset=input_mapset input=input_raster > output=output_raster > > You may also wanna check r.import if you use grass7.1 ( > https://grass.osgeo.org/grass71/manuals/r.import.html) or as an add-on in > grass 7.0 (https://grass.osgeo.org/grass70/manuals/addons/r.import.html). > You can install it with g.extension r.import > > HTH, > Vero > > 2015-09-23 15:21 GMT-03:00 Uttam Sinha : > >> >> >> Hi, >> >> I tried the way you told. I created a new location in laea without >> setting the default boundary. Then from this mapset I used >> >> r.proj location*=input_location* mapset=*input_mapset* input=*input_raster >> name* output= >> >> *output_raster* >> I get an error: >> >> >> ERROR: Input raster map is outside current region >> >> Any suggestions. >> >> Uttam. >> >> >> On Tue, Sep 22, 2015 at 11:59 PM, sajid pareeth >> wrote: >> >>> Hi Uttam >>> >>> If I understand you correctly you want to reproject a landsat image from >>> sinusoidal to laea projection!! >>> You dont have to manually set the bounding box while reprojecting a >>> raster, as GRASS will take care of it. >>> >>> First you create a new location and mapset with desired output >>> projection , which in this case is Lamberts Azimuthal Equal Area. >>> Then get into this mapset, use the following r.proj command. >>> r.proj location*=input_location* mapset=*input_mapset* input=*input_raster >>> name* output= >>> *output_raster* >>> >>> More details here: https://grass.osgeo.org/grass70/manuals/r.proj.html >>> >>> If you then need to set your working area to a particular bounding box, >>> use g.region >>> >>> g.region raster=*output_raster* >>> >>> regards >>> >>> Sajid >>> >>> On Tue, Sep 22, 2015 at 11:07 PM, Uttam Sinha >>> wrote: >>> Hi All, I have a set of Landsat images in Sinusoidal Projection, WGS84 Datum. I know the north, south, east and west extent of the boundary of the image. I want to reproject the image to Lamberts Azimuthal Equal Area, WGS84 Datum. I do not know what will be the coordinates of the north, south, east and west bounds in this projection. 1.) How do I convert upper left coordinates and bottom right coordinates of Sinusoidal Projection to Lamberts Azimuthal Equal Area to create a new destination Location? 2.) How do I reproject the images from Sinusoidal to Lamberts without georeferencing the image at source location (in sinusoidal projection) Appreciate any reply. Uttam. ___ 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 >> > > ___ grass-user mailing list grass-user@lists.osgeo.org http://lists.osgeo.org/mailman/listinfo/grass-user
Re: [GRASS-user] help t.rast.algebra
Thanks, Sören! I anxiously await for that paper :) Cheers, Vero El sep 25, 2015 12:31 PM, "Sören Gebbert" escribió: > Hi, > Sorry, i am unable to help here, since the algebra is a deep mistery for > me as well. I think that after i have finished a paper about it, the > algebra will be much better documented. > > Ciao > Sören > Am 25.09.2015 16:40 schrieb "Veronica Andreo" : > >> Hi Moritz, >> >> I eventually solved it like this: >> >> t.rast.aggregate -s input=cla granularity="1 years" method=minimum >> output=yearly_min basename=yearly_min >> t.rast.aggregate -s input=cla granularity="1 months" method=minimum >> output=monthly_min basename=monthly_min >> >> YEAR_I=2003 ; YEAR_F=2013 >> MONTH_I=1 ;MONTH_F=12 >> >> for YEAR in `seq $YEAR_I $YEAR_F` ; do >> for MONTH in `seq -w $MONTH_I $MONTH_F` ; do >> r.mapcalc expression="month_min_${YEAR}_${MONTH} = >> if(monthly_min_${YEAR}_${MONTH} == yearly_min_${YEAR}, ${MONTH}, null())" >> --o >> done >> done >> >> r.series input=`g.list type=raster pattern=*_ag sep=,` >> output=month_of_min_mode method=mode >> >> Alternatively, >> >> 1. t.rast.aggregate -s input=cla granularity="1 months" method=minimum >> output=monthly_min basename=monthly_min >> >> 2. t.rast.aggregate -s input=monthly_min granularity="1 years" >> method=min_rast output=yearly_min_index >> >> 3. r.series input=`g.list rast pat=yearly_min_ind* sep=,` method=mode >> >> 4. r.reclass with >> >> 0 = 1 >> 1 = 2 >> 2 = 3 >> 3 = 4 >> 4 = 5 >> 5 = 6 >> 6 = 7 >> 7 = 8 >> 8 = 9 >> 9 = 10 >> 10 = 11 >> 11 = 12 >> >> Meanwhile, I still think t.rast.algebra should do the job in one >> command... I just cannot >> figure it out (yet) from the manual page: >> https://grass.osgeo.org/grass71/manuals/t.rast.algebra.html >> >> I keep studying it, though >> >> Thanks a lot! >> Vero >> >> >> 2015-09-24 3:58 GMT-03:00 Moritz Lennert : >> >>> On 18/09/15 17:38, Veronica Andreo wrote: >>> Hi Soeren, list I need some help with t.rast.algebra. Well, if it is that my problem is really a t.rast.algebra problem... I have 2 strds with different granularities. A is an annual time series that contains the min annual temperature, B is a monthly time series containing the min monthly temperature. I want to compare the two of them, and when a pixel of B equals that of A, I need to get the start_month(B) but with the temporal resolution of A. So, what I want as output is a yearly time series containing the month in which the minimum temperature of each year occurs. Does that make any sense?? I been studying t.rast.algebra all morning now and trying different kind of relationships (with no success), and I got lost in the different relationships and the different ways to express them. Can someone point me to the right way of using t.rast.algebra for this problem? >>> >>> No help for t.rast.algebra, but wouldn't looping over the years and >>> applying t.rast.series with method=min_raster get you what you want ? >>> >>> Moritz >>> >> >> ___ grass-user mailing list grass-user@lists.osgeo.org http://lists.osgeo.org/mailman/listinfo/grass-user
Re: [GRASS-user] help t.rast.algebra
Hi, Sorry, i am unable to help here, since the algebra is a deep mistery for me as well. I think that after i have finished a paper about it, the algebra will be much better documented. Ciao Sören Am 25.09.2015 16:40 schrieb "Veronica Andreo" : > Hi Moritz, > > I eventually solved it like this: > > t.rast.aggregate -s input=cla granularity="1 years" method=minimum > output=yearly_min basename=yearly_min > t.rast.aggregate -s input=cla granularity="1 months" method=minimum > output=monthly_min basename=monthly_min > > YEAR_I=2003 ; YEAR_F=2013 > MONTH_I=1 ;MONTH_F=12 > > for YEAR in `seq $YEAR_I $YEAR_F` ; do > for MONTH in `seq -w $MONTH_I $MONTH_F` ; do > r.mapcalc expression="month_min_${YEAR}_${MONTH} = > if(monthly_min_${YEAR}_${MONTH} == yearly_min_${YEAR}, ${MONTH}, null())" > --o > done > done > > r.series input=`g.list type=raster pattern=*_ag sep=,` > output=month_of_min_mode method=mode > > Alternatively, > > 1. t.rast.aggregate -s input=cla granularity="1 months" method=minimum > output=monthly_min basename=monthly_min > > 2. t.rast.aggregate -s input=monthly_min granularity="1 years" > method=min_rast output=yearly_min_index > > 3. r.series input=`g.list rast pat=yearly_min_ind* sep=,` method=mode > > 4. r.reclass with > > 0 = 1 > 1 = 2 > 2 = 3 > 3 = 4 > 4 = 5 > 5 = 6 > 6 = 7 > 7 = 8 > 8 = 9 > 9 = 10 > 10 = 11 > 11 = 12 > > Meanwhile, I still think t.rast.algebra should do the job in one > command... I just cannot > figure it out (yet) from the manual page: > https://grass.osgeo.org/grass71/manuals/t.rast.algebra.html > > I keep studying it, though > > Thanks a lot! > Vero > > > 2015-09-24 3:58 GMT-03:00 Moritz Lennert : > >> On 18/09/15 17:38, Veronica Andreo wrote: >> >>> Hi Soeren, list >>> >>> I need some help with t.rast.algebra. Well, if it is that my problem is >>> really a t.rast.algebra problem... >>> >>> I have 2 strds with different granularities. A is an annual time series >>> that contains the min annual temperature, B is a monthly time series >>> containing the min monthly temperature. I want to compare the two of >>> them, and when a pixel of B equals that of A, I need to get the >>> start_month(B) but with the temporal resolution of A. So, what I want as >>> output is a yearly time series containing the month in which the minimum >>> temperature of each year occurs. Does that make any sense?? >>> >>> I been studying t.rast.algebra all morning now and trying different kind >>> of relationships (with no success), and I got lost in the different >>> relationships and the different ways to express them. >>> >>> Can someone point me to the right way of using t.rast.algebra for this >>> problem? >>> >> >> No help for t.rast.algebra, but wouldn't looping over the years and >> applying t.rast.series with method=min_raster get you what you want ? >> >> Moritz >> > > ___ grass-user mailing list grass-user@lists.osgeo.org http://lists.osgeo.org/mailman/listinfo/grass-user
Re: [GRASS-user] help t.rast.algebra
Hi Moritz, I eventually solved it like this: t.rast.aggregate -s input=cla granularity="1 years" method=minimum output=yearly_min basename=yearly_min t.rast.aggregate -s input=cla granularity="1 months" method=minimum output=monthly_min basename=monthly_min YEAR_I=2003 ; YEAR_F=2013 MONTH_I=1 ;MONTH_F=12 for YEAR in `seq $YEAR_I $YEAR_F` ; do for MONTH in `seq -w $MONTH_I $MONTH_F` ; do r.mapcalc expression="month_min_${YEAR}_${MONTH} = if(monthly_min_${YEAR}_${MONTH} == yearly_min_${YEAR}, ${MONTH}, null())" --o done done r.series input=`g.list type=raster pattern=*_ag sep=,` output=month_of_min_mode method=mode Alternatively, 1. t.rast.aggregate -s input=cla granularity="1 months" method=minimum output=monthly_min basename=monthly_min 2. t.rast.aggregate -s input=monthly_min granularity="1 years" method=min_rast output=yearly_min_index 3. r.series input=`g.list rast pat=yearly_min_ind* sep=,` method=mode 4. r.reclass with 0 = 1 1 = 2 2 = 3 3 = 4 4 = 5 5 = 6 6 = 7 7 = 8 8 = 9 9 = 10 10 = 11 11 = 12 Meanwhile, I still think t.rast.algebra should do the job in one command... I just cannot figure it out (yet) from the manual page: https://grass.osgeo.org/grass71/manuals/t.rast.algebra.html I keep studying it, though Thanks a lot! Vero 2015-09-24 3:58 GMT-03:00 Moritz Lennert : > On 18/09/15 17:38, Veronica Andreo wrote: > >> Hi Soeren, list >> >> I need some help with t.rast.algebra. Well, if it is that my problem is >> really a t.rast.algebra problem... >> >> I have 2 strds with different granularities. A is an annual time series >> that contains the min annual temperature, B is a monthly time series >> containing the min monthly temperature. I want to compare the two of >> them, and when a pixel of B equals that of A, I need to get the >> start_month(B) but with the temporal resolution of A. So, what I want as >> output is a yearly time series containing the month in which the minimum >> temperature of each year occurs. Does that make any sense?? >> >> I been studying t.rast.algebra all morning now and trying different kind >> of relationships (with no success), and I got lost in the different >> relationships and the different ways to express them. >> >> Can someone point me to the right way of using t.rast.algebra for this >> problem? >> > > No help for t.rast.algebra, but wouldn't looping over the years and > applying t.rast.series with method=min_raster get you what you want ? > > Moritz > ___ grass-user mailing list grass-user@lists.osgeo.org http://lists.osgeo.org/mailman/listinfo/grass-user
Re: [GRASS-user] Speed optimization of shadow computation with grass gis r.sun and r.horizon
simogeo wrote > I'll try to make test on different environment (ubuntu) and let you know > ... Thank you Simon. I should be able to run it shortly on a 16 cores linux supercomputer, likely with the add-on r.sun.hourly Best regards, Pierre -- View this message in context: http://osgeo-org.1560.x6.nabble.com/Speed-optimization-of-shadow-computation-with-grass-gis-r-sun-and-r-horizon-tp5225165p5226074.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