Lat/Lon to Row/Colmn
12 visualizaciones (últimos 30 días)
Mostrar comentarios más antiguos
HI everyone,
I have a geotiff image, and I want to convert lat and long coordinates of several point into pixel coordinate. How can i do it?
0 comentarios
Respuestas (1)
Sourav Bairagya
el 9 de Dic. de 2019
There are two functions which you can use.
If you have the GeoTIFF file, then “geotiffread”helps to read a georeferenced grayscale, RGB, or multispectral image or data grid from the GeoTIFF file specified by filename into A and creates a spatial referencing object, R.
[A, R] = geotiffread(filename);
If you already have the reference object and corresponding latitudes and longitudes, then you can use “latlon2pix” function.
[row, col] = latlon2pix(R,lat,lon);
It calculates pixel coordinates row, col from latitude-longitude coordinates ‘lat’, ‘lon’. ‘R’ is either a 3-by-2 referencing matrix that transforms intrinsic pixel coordinates to geographic coordinates, or a geographic raster reference object. ‘lat’ and ‘lon’ are vectors or arrays of matching size. The outputs row and col have the same size as ‘lat’ and ‘lon’. ‘lat’ and ‘lon’must be in degrees.
For more information you can follow these links:
0 comentarios
Ver también
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!