To interactively draw shapes and compute areas on a geographic map, you might need to use a combination of callbacks and custom functions.:
- Display a geographic map using functions like geobasemap.
- Use interactive functions to capture mouse clicks and draw polygons on the map.
- Calculate the area and perimeter of the drawn polygons using spatial or geographic functions that can handle the calculations on a curved surface like the Earth.
A rough example using pseudo-code would be:
lon = [-114.0641 114.0704];
set(gcf, 'WindowButtonDownFcn', @clickCallback);
function clickCallback(src, event)
Keep in mind that to calculate the area and perimeter accurately on a geographic map, considering the Earth's curvature, you might need to use specific geospatial functions or convert latitude and longitude to a planar coordinate system before performing the calculations.
------------------------------------------------------------------------------------------------------------------------------------------------
If you find the solution helpful and it resolves your issue, it would be greatly appreciated if you could accept the answer. Also, leaving an upvote and a comment are also wonderful ways to provide feedback.
Professional Interests
- Technical Services and Consulting
- Embedded Systems
- Electrical and Electronics Engineering