Transform an image of a geographic area to a Matlab map

조회 수: 7 (최근 30일)
Marius Marinescu
Marius Marinescu 2020년 7월 20일
댓글: Marius Marinescu 2020년 7월 27일
Hello,
I have the following map (is an image in format .jpg):
that represents an area around the airport Madrid Barajas. I have flying aircrafts data and position of them in latitude and longitude. I would like to plot that geographic data over this image. For that I need to transform this image into a map object. How can I do that? I know the latitude and longitude limits of the map, so I think must be a way.

채택된 답변

Kiran Felix Robert
Kiran Felix Robert 2020년 7월 23일
Hi Marius,
It is my understanding that you have an image file of a region with corresponding Latitude and Longitude limits, and you wish to convert it to a GeoTIFF file. This can be done using the Mapping Toolbox.
There are specific functions for this such as georefcells, as you know the latitude and longitude limits. The Reference object can be created using the georefcells, and the reference object can be used to write the image into a GeoTIFF file as illustrated in the article here.
Assuming you have the Latitude limit as (-20,20) and longitude limit as (-30,30), a simple example is as follows,
img = imread('map.jpeg');
lat_limits = [-20 20];
lon_limits = [-30 30];
[x,y,~] = size(A2);
r_size = [x y];
R = georefcells(lat_limits,lon_limits,r_size);
geotiffwrite('MapOut.tif',img,R);
Kiran
  댓글 수: 1
Marius Marinescu
Marius Marinescu 2020년 7월 27일
Yes tha's what I need! I had a problem and is that I had to add the next comand to your code:
R.ColumnsStartFrom='north';
I don't know why the image was loaded upturned, as shown in this figure:

댓글을 달려면 로그인하십시오.

추가 답변 (0개)

카테고리

Help CenterFile Exchange에서 Point Cloud Processing에 대해 자세히 알아보기

태그

Community Treasure Hunt

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

Start Hunting!

Translated by