コード例 #1
0
#---- Set layout map
print 'Set layout map...'
layoutMap.setDrawGridLine(False)
layoutMap.setDrawNeatLine(False)
layoutMap.setDrawGridLabel(False)
layoutMap.setDrawGridTickLine(False)
layoutMap.setLeft(10)
layoutMap.setTop(10)
layoutMap.setWidth(620)
layoutMap.setHeight(450)

#---- Set maskout
mapView.getMaskOut().setMask(True)
mapView.getMaskOut().setMaskLayer(chinaLayer.getLayerName())

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

#---- Add legend
legend = mapLayout.addLegend(575, 250)
legend.setLegendStyle(LegendStyles.Normal)
legend.setLegendLayer(layer)
legend.setFont(Font('Arial', Font.PLAIN, 12))
legend.setTitle('Precipitation (mm)')

frame = JFrame('MeteoInfo Script Sample', size = (750, 530))
frame.add(mapLayout)
frame.visible = True
print 'Finished!'
コード例 #2
0
lbs.add(lb)

layer = DrawMeteoData.createSTInfoLayer(sidata, ls, 'StationInfo')
layer.setAvoidCollision(True)

#---- Add layer
mapFrame.addLayer(layer)
mapFrame.moveLayer(layer, 0)

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

#---- Set layout map
print 'Set layout map...'
mapLayout.getActiveLayoutMap().setWidth(580)
mapLayout.getActiveLayoutMap().zoomToExtentLonLatEx(Extent(70, 140, 15, 55))

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

#---- Add legend
legend = mapLayout.addLegend(620, 150)
legend.setLegendStyle(LegendStyles.Normal)
legend.setLegendLayer(layer)
legend.setTitle('Station')

frame = JFrame('MeteoInfo Script Sample', size = (800, 600))
frame.add(mapLayout)
frame.visible = True
print 'Finished!'
コード例 #3
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!'
コード例 #4
0
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(70, 140, 15, 55))

#---- Set maskout
mapView.getMaskOut().setMask(True)
mapView.getMaskOut().setMaskLayer(chinaLayer.getLayerName())

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

#---- Add legend
legend = mapLayout.addLegend(660, 120)
legend.setLegendStyle(LegendStyles.Bar_Vertical)
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 = (800, 600))
frame.add(mapLayout)
frame.visible = True
print 'Finished!'
コード例 #5
0
#layer = DrawMeteoData.createWeatherSymbolLayer(sdata, weathers, 'WeatherSymbole')

#---- Add layer
mapFrame.addLayer(layer)

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

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

#---- Set layout map
print 'Set layout map...'
mapLayout.getActiveLayoutMap().setWidth(580)
mapLayout.getActiveLayoutMap().zoomToExtentLonLatEx(Extent(70, 140, 15, 55))

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

#---- Add legend
legend = mapLayout.addLegend(628, 10)
legend.setLegendStyle(LegendStyles.Normal)
legend.setLegendLayer(layer)
legend.setColumnNumber(4)
legend.setTitle('Weather')

frame = JFrame('MeteoInfo Script Sample', size = (990, 530))
frame.add(mapLayout)
frame.visible = True
print 'Finished!'
コード例 #6
0
uv = DataMath.magnitude(uwnd, vwnd)
#uv = DataMath.Magnitude(uwnd, vwnd)
uvq = uv.mul(qv).div(9.8*1000)
#uvq = uv*qv/(9.8*1000)

#---- Create data layer
print 'Create data layer...'
dataLayer = DrawMeteoData.createShadedLayer(qhdivg, "WaterVaporFlux", "Flux", False)

#---- Add layer
print 'Add layers...'
mapFrame.addLayer(dataLayer)
mapFrame.moveLayer(dataLayer, 0)
#---- Zoom data
mapLayout.getActiveLayoutMap().zoomToExtentLonLatEx(Extent(0,360,-90.1,90.1))
#---- Set MapLayout
format = SimpleDateFormat('yyyy-MM-dd')
aTime = dataAir.getDataInfo().getTimes().get(tIdx)
mapLayout.addText('Water Vapor Flux Divergence - ' + format.format(aTime), 320, 30, 'Arial', 16)
aLegend = mapLayout.addLegend(650, 100)
aLegend.setLegendStyle(LegendStyles.Bar_Vertical)
aLegend.setLegendLayer(dataLayer)
layoutMap.setGridXDelt(60)
layoutMap.setGridYDelt(30)
layoutMap.setDrawGridLine(False)
mapLayout.paintGraphics()

frame = JFrame('MeteoInfo Script Sample', size = (750, 530))
frame.add(mapLayout)
frame.visible = True
print 'Finished!'