Jump to content

Spatial analysis, regression and correlation between 2 rasters


Arhanghelul

Recommended Posts

Hello !

I would like to make some spatial analysis regarding regressions and correlation coeficients between 2 rasters.

I have 2 rasters:

  1. Land use/ Land cover extracted from aerial images
  2. Land Surface Temperature (LST) derived from LANDSAT thermal band.

Both raster images are co-registered, in the same projection, having a RMSE error <=0.5 m.

Now I would like to see if there are some spatial correlations between these 2 images.

What software can I use for this task ?

I know that there are some specialised softwares like R and SPSS. But how to import and use rasters ?

Where can I find some tutorials, lab exercises or web-links about this ?

Thank you, my friends.

Arhanghelul

  • Like 1
Link to comment
Share on other sites

here is the the code for spatial cross-correlation (Matlab)

there are 2 surfaces we are going to compare or find correlations

maybe you should convert them to raster first

A = imread ('...'/firstraster.jpg');

B = imread ('.../secondraster.jpg');

Result = normxcorr2(B,A);

size if B should be equal or lesser than size of A

the result is an arrey of correlation as kernel ( B moves across the Image A )

max(max(Result)) % the max xross corr found by kernel

imshow (Result) % xross surface

using ArcGIS can be very easy and helpful :)

ArcToolbox > Spatial Analyst > Multivariate > Band Collection Statistics ;)

  • Like 1
Link to comment
Share on other sites

here is the the code for spatial cross-correlation (Matlab)

there are 2 surfaces we are going to compare or find correlations

maybe you should convert them to raster first

A = imread ('...'/firstraster.jpg');

B = imread ('.../secondraster.jpg');

Result = normxcorr2(B,A);

size if B should be equal or lesser than size of A

the result is an arrey of correlation as kernel ( B moves across the Image A )

max(max(Result)) % the max xross corr found by kernel

imshow (Result) % xross surface

using ArcGIS can be very easy and helpful :)

ArcToolbox > Spatial Analyst > Multivariate > Band Collection Statistics ;)

Thank you !

Link to comment
Share on other sites

  • 1 month later...

Hi guys .. it might be late to answer this but I will explain the best way (as I can see)

first, u should use (extract by mask) which is one of the tool in ArcGIS where u can mask the first layer (i.e.LULC) using (LST) or vise versa

After finishing the masking, u can check in the properties that both layers have the same number of row and columns.

Second, use (raster to ASCII) tool which also available in ArcGIS to convert both layers into text format then open both of them using notepad or any other alternative program (I prefer Editpad Lite) and delete the header of them

Note: the header file can also show u the number of rows and columns of the resulted image.

Third, from file menu in SPSS, click on read text file and just click next until the part where u should define the number of columns where u should choose 1

do this process to the both layers then apply LR or any other algorithm u like to use.

  • Like 1
Link to comment
Share on other sites

Hi guys .. it might be late to answer this but I will explain the best way (as I can see)

first, u should use (extract by mask) which is one of the tool in ArcGIS where u can mask the first layer (i.e.LULC) using (LST) or vise versa

After finishing the masking, u can check in the properties that both layers have the same number of row and columns.

Second, use (raster to ASCII) tool which also available in ArcGIS to convert both layers into text format then open both of them using notepad or any other alternative program (I prefer Editpad Lite) and delete the header of them

Note: the header file can also show u the number of rows and columns of the resulted image.

Third, from file menu in SPSS, click on read text file and just click next until the part where u should define the number of columns where u should choose 1

do this process to the both layers then apply LR or any other algorithm u like to use.

Thank you for your reply !

Where can I find some tutorials, lab exercises for using SPSS ? (about importing and creating new projects, how to create regressions and graphics ? )

Link to comment
Share on other sites

Regressions in SPSS is Normal. We can choose: Linear, Logistics, Curbic (Non - Linear) for simulating correlation between 2 raster.

step1: You make sample (than 30 sample) from Land use and Land Surface Temperature.

step2: You extract value of point from sample.

Step3: You use: SPSS or Statistic software (R software, statgraphics, spss....) to make correlation.

Step4: You use Gis software for compute raster (Multiply, split, add, subtract follow equation in step3).

Good luck!

  • Like 1
Link to comment
Share on other sites

SPSS Statistics Essential Training

http://s6.p30download.com/users/606/tutorial/office/spss-statistics/Lynda.SPSS.Statistics.Essential.Training.Full_p30download.com.part1.rar
http://s6.p30download.com/users/606/tutorial/office/spss-statistics/Lynda.SPSS.Statistics.Essential.Training.Full_p30download.com.part2.rar

pass = www.p30download.com

disable your antivirus, there are nothing wrong with the files.

  • Like 1
Link to comment
Share on other sites

  • 1 year later...

thanks for your guide. I have apply the same procedure but i have some problem with my ascii file. I exported my LST raster to ascii file but i contain -9999 values. i wonder if you could guide me to fix my file and second this does it matter if this file contain multiple rows and multiple columns please comment.

Link to comment
Share on other sites

  • 1 year later...
  • 2 weeks later...

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

By using this site, you agree to our Terms of Use.

Disable-Adblock.png

 

If you enjoy our contents, support us by Disable ads Blocker or add GIS-area to your ads blocker whitelist