Extract spatial data using shp file as a mask

I'm new in matlab
So I tried to extract pixel data from a modis bands image with point as a central for 5x5 box.
So the 5x5 box will be filled with modis image's pixel.
I already did it in qgis, but it failed.
The yellow dot contains lattitude, longitude and target data.
Is there any refrence to do this? I already read some examples, but they are only using the box (shp file) to fill it.
For future works, I want to generate 4D data [n,x,y,t]
n = for band's modis image
x,y = box
t = data target

6 Comments

yes,sir,which is the image process target? get the yellow point location?
What is qgis, and did you do it there? Or did it fail there?
What/where exactly is "the box"? Is it the rectangular region where the 4 yellow dots define the corners?
I'm not sure what n is. Is this image not gray scale but maybe multispectral with several wavelength bands?
I don't know what t (the "data target") is. Is it the gray level?
I don't know what the 4-D data would be. So, let's say n=1, x=2, y=55, and t = 163. What would the value at your output array output(1, 2, 55, 163) represent? What goes into that location of the 4-D array?
  1. so modis has 7 bands. so the 'n' will be filled n=1,2,3...7.
i want to extract pixel data on image with 5x5 box with yellow dot as a refrence. so x,y will be filled x=5 y=5
the 't' data comes from yellow dot, let's just say t=163.
so the output array will be (1,5,5,163), with 5x5 has a pixel data in it.
2. this image is a wavelenght bands.
3. "the box" in this image is just an illustration for 5x5 box that i want to do it in matlab.
4. qgis is a software for geospatial analysis. just like arcgis but its a free version. i already tried in qgis but it fails
thank you so much @Walter Roberson i'll be sure to try it out
@yanqi liu so the yellow dot is the point where i want to put 3x3 box to extract pixel modis data

Sign in to comment.

Answers (0)

Products

Release

R2020a

Asked:

on 17 Dec 2021

Commented:

on 23 Dec 2021

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!