How to extract values from a georeferenced image using point shape file??
4 views (last 30 days)
Show older comments
I want to extract the values form a grayscale image only on the locations of known points. I have a point shape file of that locations.I have imported and extracted its coordinates as:
S1 = shaperead('shapefile');
X = extractfield(S1,'X');
Y = extractfield(S1,'Y');
How can I use these coordinate values of each point to extract the value from the georeferenced image.
Need help!!!
0 Comments
Accepted Answer
Kelly Kearney
on 6 Aug 2015
The ltln2val function is probably your best bet. Are the X/Y values in your shapefile actually Longitude and Latitude? Or is the shapefile in projected coordinates? If the latter, you'll have to get reverse project the coordinates. My shapeprjread.m function may help with that (though the list of projections is incomplete due to my lack of access to ArcGIS; if you get an error about an unrecognized projection, email me!).
2 Comments
Kelly Kearney
on 6 Aug 2015
Yes, unless your shapefile and image use the exact same projected coordinate system, you'll need to get the data in both of them relative to lat/lon. When you said you had a georeferenced image, I assumed you already had that data read into Matlab with the appropriate lat/lon matrices or referencing vector/matrix. What format is your image? How are you reading it into Matlab?
More Answers (0)
See Also
Categories
Find more on Import, Export, and Conversion in Help Center and File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!