Hi Carlos,
If you have an image for the area of interest which is already within the projection etc. that you want then you can use:
rsgislib.imageutils.resampleImage2Match(inRefImg, inProcessImg, outImg, gdalFormat, interpMethod, datatype=None)
Otherwise, there is the function (which is the same as gdalwarp):
rsgislib.imageutils.reprojectImage(inputImage, outputImage, outWKT, gdalFormat='KEA', interp='cubic', inWKT=None, noData=0.0, outPxlRes='image', snap2Grid=True)
Best wishes,
Pete
****************************************************
* Dr Pete Bunting
* Reader in Remote Sensing
* Earth Observation and Ecosystem Dynamics Group
* Department of Geography and Earth Sciences
* Aberystwyth University
* Aberystwyth
* Ceredigion
* SY23 3DB
* UK
*
* Ph:
+44 (0) 1970 622615
* Mob:
+44 (0) 7917 842743
* Email:
p...@aber.ac.uk
* ORCID:
http://orcid.org/0000-0002-7435-0148
****************************************************
"Please consider the environment before printing this email or any documents attached”
> On 26 Apr 2017, at 15:05, Nathan Thomas <
nmtho...@gmail.com> wrote:
>
> correction, -tr 90 90 instead of -tr 200 200
>
> Nathan
>
> On Wednesday, 26 April 2017 07:01:38 UTC-7, Nathan Thomas wrote:
> Hi Carlos,
>
> I usually do this as follows:
>
> import subprocess
> import os
>
> inDir = ‘input filepath’
> outDir = ‘output filepath’
>
> files = [file for file in os.listdir(inDir) if file.endswith(‘.tif’)]
>
> for file in files:
> subprocess.call(‘gdalwarp -of GTiff -tr 200 200 -r near ’ + os.path.join(inDir, file) + ‘ ‘ + os.path.join(outDir, file.replace(‘.tif’,’_200m.tif')),shell=True)
>
> Note that the -r parameter (resampling method) should be the one most applicable to you.
>
> If you have further issues, could you post your code?
>
> Cheers, Nathan
>
>> On 26 Apr 2017, at 06:54, Carlos Leandro Cordeiro <
carlosl...@gmail.com> wrote:
>>
>> Hello everyone, I need some help. I would like to do a pixel resampling on a set of 200 images. I need to resample for 90 m. I would do this together using only one script and not one image by one. can anybody help me? I tried to use a script, but it did not work. Thank you
>>
>> --
>> You received this message because you are subscribed to the Google Groups "RSGISLib Support" group.
>> To unsubscribe from this group and stop receiving emails from it, send an email to
rsgislib-suppo...@googlegroups.com.
>> To post to this group, send email to
rsgislib...@googlegroups.com.
> --
> You received this message because you are subscribed to the Google Groups "RSGISLib Support" group.
> To unsubscribe from this group and stop receiving emails from it, send an email to
rsgislib-suppo...@googlegroups.com.
> To post to this group, send email to
rsgislib...@googlegroups.com.
--------------------------------------------------------------------
Un o’r 4 prifysgol uchaf yn y DU a’r orau yng Nghymru am fodlonrwydd myfyrwyr.
(Arolwg Cenedlaethol y Myfyrwyr 2016)
www.aber.ac.uk
Top 4 UK university and best in Wales for student satisfaction
(National Student Survey 2016)
www.aber.ac.uk