how to clip geotiff image ?

13 views (last 30 days)
Reema Alhassan
Reema Alhassan on 28 Jun 2018
hello everyone
I have a geotiff image and 4 coordinates xmin, xmax, ymin,ymax (the boundingBox of a shape file) I need to clip it with these coordinates and make a new geotiff image does anyone now how to do this pleas? I have tried a lot of ways and nothing works..
Thank you
  1 Comment
Hasan Hasanuzzaman
Hasan Hasanuzzaman on 22 Jul 2020
How have you got bounding box of the shapefile

Sign in to comment.

Answers (1)

Sean Turner
Sean Turner on 23 Oct 2018
Did you ever figure this out? I am having the same problem.
  1 Comment
Reema Alhassan
Reema Alhassan on 23 Oct 2018
Yes i have done this to clip the image based on the shape file coordinates
the steps to that are:
1-try to the geoimread() function you can find it below enter the x and y coordinates as inputs( the x and y of the shapefile for example if you have it) geoimread(x1,y1) the output of this function is [xe,ye,values,..] so it will clip the image based on the bounding box of the shape file
2-after that try to use inpolygon(xe,ye,x1,y1) to clip the image based on the shape coordinates if it takes to much time try to search for another function which do the same job in the file exchange
inpolygon :

Sign in to comment.

Community Treasure Hunt

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

Start Hunting!