Terrain Elevation Data (Contour - Level Curve)

조회 수: 21 (최근 30일)
Guilherme Franklin
Guilherme Franklin 2022년 8월 10일
댓글: Guilherme Franklin 2022년 8월 30일
Hi, I'm new to the mapping toolbox and I would like to get the contour data for a given locale.
Here's an example image:
I would like to export the curves to kml, so that I can open them in google earth.
I'm using a GeoTIFF file that contains the terrain data and a kml file containing the boundary of the area of interest.
Below is an image of the GeoTIFF file loaded on the desktop and an image of the boundary in the kml file, respectively.
GeoTIFF:
KML:
Below is the code used to load the files:
clc, clear, close all;
kml = kml2struct("Marcador sem título.kml");
Long = kml.Lon;
Lati = kml.Lat;
%geoplot(Lati,Long)
%geobasemap streets
[A,R]=readgeoraster("s17_w048_1arc_v3.tif",'OutputType','double');
latlim = R.LatitudeLimits;
lonlim = R.LongitudeLimits;
usamap(latlim,lonlim)
geoshow(A,R,'DisplayType','surface')
demcmap(A)
It is worth noting that the KML boundary is within the geographic location to which the GeoTIFF file belongs.

답변 (1개)

KSSV
KSSV 2022년 8월 10일
  1. Load the kml file. This will be your boundary.
  2. Load the geotiff file. Make the necessary spatial coordinates using meshgrid
  3. Using the boundary and data/ raster from geotiff; use inpolygon to get the coordinates inside your boundary.
  4. From the extracted indices using inpolygon, make your required raster.
  5. Use contour to plot the contour lines.
  6. Convert contour to kml using: https://in.mathworks.com/matlabcentral/fileexchange/33800-kml-contour-plot
  댓글 수: 2
Guilherme Franklin
Guilherme Franklin 2022년 8월 30일
I was able to understand the procedure you explained, however, as the GeoTIIF file is very large, it takes a long time to process the meshgrid.
I'd like to trim the GeoTIFF within the kml boundary before doing this processing so it doesn't take too long.
Guilherme Franklin
Guilherme Franklin 2022년 8월 30일
How can I make this cut?

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

제품


릴리스

R2021a

Community Treasure Hunt

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

Start Hunting!

Translated by