Creating a georeferenced polygon

조회 수: 3 (최근 30일)
Darragh Kenny
Darragh Kenny 2018년 11월 13일
편집: Bruno Luong 2018년 11월 13일
Hi all,
I'm trying to map out a certain area over southern Africa, which is meant to look like the one in the image. The image was created with the matrix dro_dom_fill containing 1's for the regions of interest and NaN's otherwise. From this matrix, I am trying to create a georeferenced polygon or something similiar, so that I can find gridpoints in another dataset with a different resolution that lie within the domain. However, if I run this code my polygon looks like in droughtdomain_geoshape.jpg attached
[LAT,LON]=meshgrid(lat,lon);
a=dro_dom_fill.*LAT
b=dro_dom_fill.*LON
a(isnan(a))=[]
b(isnan(b))=[]
g=geoshape(a,b,'Geometry','polygon')
worldmap([-35 0],[9 50]), bordersm
geoshow(g)

답변 (2개)

KSSV
KSSV 2018년 11월 13일
편집: KSSV 2018년 11월 13일
Read about inpolygon. As you have the boundary points, you can get all the points lying inside the polygon.
Or, you can arrange your boundary points..in a order using this link and plot the boundary.
  댓글 수: 2
Darragh Kenny
Darragh Kenny 2018년 11월 13일
편집: Darragh Kenny 2018년 11월 13일
I have problems creating the polygon itself as a first step...
meaning how do I create a polygon on a map, given the longitudes and latitudes of all the gridpoints that are meant to be in the polygon?
KSSV
KSSV 2018년 11월 13일
Have a look on boundary. If you are looking for a boundary of country/ state, you can download shape files.

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


Bruno Luong
Bruno Luong 2018년 11월 13일
편집: Bruno Luong 2018년 11월 13일
You can get a linear connected contour (polygon) by
C = contourc(lat,lon,double(isfinite(dro_dom_fill)),0.5*[1 1]);
C = C(:,2:C(2,1)+1) % Assuming it returns 1 polygon

카테고리

Help CenterFile Exchange에서 Data Import and Export에 대해 자세히 알아보기

제품


릴리스

R2018b

Community Treasure Hunt

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

Start Hunting!

Translated by