Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add terrain contours to map #1508

Open
wants to merge 2 commits into
base: master
Choose a base branch
from

Conversation

srmainwaring
Copy link
Contributor

@srmainwaring srmainwaring commented Feb 19, 2025

Use data available in the terrain module to overlay terrain contours on the map.

mavproxy_contour_ardnamurchan

Motivation

Use

Select the number of contour levels, grid resolution and grid extent using the map settings:

STABILIZE> map set
STABILIZE>           
          brightness 1
    circle_linewidth 1
 contour_grid_extent 20000.0
contour_grid_spacing 30.0
      contour_levels 20
           font_size 0.5
        loitercircle False
         rallycircle False
     setpos_accuracy 50
        showahrs2pos 0
        showahrs3pos 0
         showahrspos 1
       showclicktime 2
       showdirection False
         showgps2pos 1
          showgpspos 1
          showsimpos 0
           showwpnum True

The terrain resolution is determined by the source used. The default is SRTM3 which may be switched before loading the contours using:

STABILIZE> terrain set source SRTM1

To show the contours use the context menu:

terrain_contours_show

Hide the contours (but do not remove - saves recalculating when showing again):

terrain_contours_hide

To select a different region, remove then show again:

terrain_contours_move

Tasks

  • add menu item to toggle contour visibility
  • add settings to control number of levels (and/or spacing)

Follow up / optional

  • add settings to control the contour colour map
  • add contour labels
  • replace dependency on matplotlib.pyplot.contour with ContourPy
  • automatically update / calculate contours as the map is moved / zoomed as it's currently fixed

@srmainwaring srmainwaring marked this pull request as draft February 19, 2025 20:21
- Add terrain contours using matplotlib.
- Hide circles on contour polygons.
- Add variables for number of contour levels and tiles.
- Remove blank lines.
- Add menu to show and hide terrain contours.
- Add options for terrain contours.

Signed-off-by: Rhys Mainwaring <[email protected]>
@srmainwaring srmainwaring force-pushed the prs/pr-map-terrain-contours branch from 321abc7 to 349006d Compare February 21, 2025 09:54
@srmainwaring srmainwaring marked this pull request as ready for review February 21, 2025 10:17
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant