Azzera filtri
Azzera filtri

How to extract values from a georeferenced image using point shape file??

6 visualizzazioni (ultimi 30 giorni)
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!!!

Risposta accettata

Kelly Kearney
Kelly Kearney il 6 Ago 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 Commenti
VIJENDRA
VIJENDRA il 6 Ago 2015
I have converted the values from the shapefile back to longitude and latitude but my referenced image is also in projected coordinate system. Do I have to convert my image also to geographic coordinate system???
Kelly Kearney
Kelly Kearney il 6 Ago 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?

Accedi per commentare.

Più risposte (0)

Community Treasure Hunt

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

Start Hunting!

Translated by