How to draw range rings around a txsite in siteviewer?
8 views (last 30 days)
Show older comments
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!
0 Comments
Answers (1)
Nithin
on 11 Jun 2025
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:
See Also
Categories
Find more on Propagation and Channel Models in Help Center and File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!