Ejemplo n.º 1
0
#---- Add layer
mapFrame.addLayer(pressLayer)

#--- Move pressure layer to bottom
mapFrame.moveLayer(pressLayer, 0)

#---- Add title
title = mapLayout.addText('MeteoInfo script demo', 350, 30, 'Arial', 16)

#---- Zoom layout map
print 'Zoom layout map...'
mapLayout.getActiveLayoutMap().zoomToExtentLonLatEx(Extent(0, 360, -90, 90))

#---- Set mapframe
mapFrame.setGridXDelt(30)
mapFrame.setGridYDelt(30)

#---- Add legend
legend = mapLayout.addLegend(150, 440)
legend.setLegendStyle(LegendStyles.Bar_Horizontal)
legend.setLegendLayer(pressLayer)

#---- Output figure
print 'Output figure...'
mapLayout.paintGraphics()
mapLayout.exportToPicture(os.path.join(figDir, 'pressure_test.ps'))

frame = JFrame('MeteoInfo Script Sample', size = (750, 540))
frame.add(mapLayout)
frame.visible = True
print 'Finished!'
Ejemplo n.º 2
0
	plot.setLegendBreak(i, ls.getLegendBreaks().get(i))
chart = Chart(None, plot)
chart.setDrawLegend(False)
layoutChart = mapLayout.addChart(5, 410)
layoutChart.setWidth(600)
layoutChart.setHeight(200)
layoutChart.setChart(chart)

#---- Add title
title = mapLayout.addText('MeteoInfo script demo - Trajectory', 300, 30, 'Arial', 16)

#---- Zoom map
print 'Zoom map...'
mapLayout.getActiveLayoutMap().setWidth(550)
mapLayout.getActiveLayoutMap().setHeight(350)
mapFrame.getMapView().zoomToExtent(trajLayer.getExtent().extend(2, 2))

#---- Output figure
print 'Output figure...'
mapLayout.exportToPicture(os.path.join(figDir, 'traj_test.png'))

#---- Set mapframe
mapFrame.setGridXDelt(5)
mapFrame.setGridYDelt(5)

#---- Show result from (just for check and not needed for batch run)
frame = JFrame('MeteoInfo Script Sample', size = (650, 680))
frame.add(mapLayout)
frame.visible = True

print 'Finish...'