Download source and data
Geocircle on Map_TEST
#Metview Macro # **************************** LICENSE START *********************************** # # Copyright 2019 ECMWF. This software is distributed under the terms # of the Apache License version 2.0. In applying this license, ECMWF does not # waive the privileges and immunities granted to it by virtue of its status as # an Intergovernmental Organization or submit itself to any jurisdiction. # # ***************************** LICENSE END ************************************ # --------------------------------------------------------------- # Demonstrates how to plot a circle on any map projection using # mvl_geocircle(). # --------------------------------------------------------------- # set up the shaded coastlines land_sea_shade = mcoast( map_coastline_land_shade : "on", map_coastline_land_shade_colour : "RGB(0.98,0.95,0.82)", map_coastline_sea_shade : "on", map_coastline_sea_shade_colour : "RGB(0.85,0.93,1)" ) # define the geographic view view = geoview( map_projection : "polar_stereographic", map_area_definition : "corners", area : [-5,-30,10,84], # S,W,N,E coastlines : land_sea_shade ) # define the radius of the circles (in km) circle_radius = 200 # the circle will be made up of this many segments circle_resolution = 80 # define the centres of the circles latPos = [58,48,38,28,18,8] lonPos = [-20,-8,4,16,28,40] # build the plot the finition of the circles pltLst=nil for i=1 to count(latPos) do # define the cirle around the specifed coordinates iv_circle = mvl_geocircle(latPos[i],lonPos[i],circle_radius,circle_resolution) # define the plotting attributes for the circle graph_circle = mgraph ( graph_line_colour : "red", graph_line_thickness : "4", graph_line_style : 'solid' ) # collect the plot definitions into a list pltLst=pltLst & [iv_circle,graph_circle] end for # define the output plot file setoutput(pdf_output(output_name : 'geocircle_on_map')) # plot the circles on the map plot(view, pltLst)
Geocircle on Map_TEST
import metview as mv # **************************** LICENSE START *********************************** # # Copyright 2019 ECMWF. This software is distributed under the terms # of the Apache License version 2.0. In applying this license, ECMWF does not # waive the privileges and immunities granted to it by virtue of its status as # an Intergovernmental Organization or submit itself to any jurisdiction. # # ***************************** LICENSE END ************************************ # --------------------------------------------------------------- # Demonstrates how to plot a circle on any map projection using # mvl_geocircle(). # --------------------------------------------------------------- # set up the shaded coastlines land_sea_shade = mv.mcoast( map_coastline_land_shade = "on", map_coastline_land_shade_colour = "RGB(0.98,0.95,0.82)", map_coastline_sea_shade = "on", map_coastline_sea_shade_colour = "RGB(0.85,0.93,1)" ) # define the geographic view view = mv.geoview( map_projection = "polar_stereographic", map_area_definition = "corners", area = [-5,-30,10,84], # S,W,N,E coastlines = land_sea_shade ) # define the radius of the circles (in km) circle_radius = 200 # the circle will be made up of this many segments circle_resolution = 80 # define the centres of the circles latPos = [58,48,38,28,18,8] lonPos = [-20,-8,4,16,28,40] # build the plot the finition of the circles plt_lst = [] for i in range(0,len(latPos)): # define the cirle around the specifed coordinates iv_circle = mv.mvl_geocircle(latPos[i], lonPos[i], circle_radius, circle_resolution) # define the plotting attributes for the circle graph_circle = mv.mgraph( graph_line_colour = "red", graph_line_thickness = "4", graph_line_style = 'solid' ) # collect the plot definitions into a list plt_lst.append([iv_circle, graph_circle]) # define the output plot file mv.setoutput(mv.pdf_output(output_name = 'geocircle_on_map')) # plot the circles on the map mv.plot(view, plt_lst)