How to draw range rings around a txsite in siteviewer?

조회 수: 7 (최근 30일)
Ivan
Ivan 2025년 6월 9일
댓글: Ivan 2025년 6월 11일
Hello,
I am working with MATLAB’s siteviewer and a txsite object to visualize a transmitter location. I want to display range rings every 10 km, 20 km, 30 km etc., around the transmitter using the siteviewer function.
I’ve tried using plot3 and geoplot3, but they booth cause errors in siteviewer .
Here is what I tried so far:
Ranges = nm2km([10, 20, 30]);
Thet = 0:1:360-1;
tx_lats = dms2degrees([58 12 37]);
tx_lons = dms2degrees([-6 21 28]);
tx_site = txsite('Latitude',tx_lats,'Longitude',tx_lons);
viewer = siteviewer("Terrain","none");
show(tx_site)
for i = Ranges
[lat_ring, lon_ring] = reckon(tx_lats, tx_lons, i ,Thet, referenceEllipsoid('wgs84'),'degrees');
geoplot3(viewer, lat_ring, lon_ring, zeros(size(lat_ring)), '-r', 'LineWidth', 2)
end
Error message:
Error using Terrain_Range_markers
Expected gl to be one of these types:
globe.graphics.GeographicGlobe
Instead its type was siteviewer.
Could you please provide the recommended method or example code to draw multiple range circles at specified distances around a txsite on the siteviewer?
Thank you!

답변 (1개)

Nithin
Nithin 2025년 6월 11일
Hi @Ivan,
The error occurs because "geoplot3" is specifically designed to work with "geoglobe" objects, not "siteviewer objects". The "siteviewer" is intended for use with the "RF Toolbox" and "Antenna Toolbox", and therefore does not support functions like "geoplot3" or "plot3".
To display range rings around a transmitter in "siteviewer", simulate the rings manually by calculating latitude and longitude points that form a circle at each desired radius. Then, create dummy receiver sites, "rxsite", at those points and display them as dots using the "show" function. Here’s a brief example:
% Reference ellipsoid for accurate geodesic distances
ellipsoid = referenceEllipsoid('wgs84');
for r = Ranges
[lat_ring, lon_ring] = reckon(tx_lat, tx_lon, r, angles, ellipsoid, 'degrees');
ringSites = rxsite("Latitude", lat_ring, "Longitude", lon_ring);
show(ringSites);
end
Refer to the following MALTAB documentation for more information:
  댓글 수: 1
Ivan
Ivan 2025년 6월 11일
Thank you for the quick response!
This is actually one of the solutions I had in mind. It works, but it's definitely not the most elegant one. In the final version, I’d like to overlay the coverage map with the polar plot so I can read both distance and azimuth.
However, I’m guessing that’s probably not possible with the current version of siteviewer.

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

카테고리

Help CenterFile Exchange에서 Propagation and Channel Models에 대해 자세히 알아보기

Community Treasure Hunt

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

Start Hunting!

Translated by