首页 > 解决方案 > 如何在 pyqt5 中显示 geemap.link_map

问题描述

基于以下代码,我想在pyqt5中显示一个geemap

class NewMap(QWidget):
    def __init__(self):
        super().__init__()
        self.setMinimumSize(QSize(600, 650))
        self.setWindowTitle("open image")
        self.setGeometry(350, 60, 500, 470)
        ee.Initialize()
        image = ee.ImageCollection('COPERNICUS/S2') \
            .filterDate('2018-09-01', '2018-09-30') \
            .map(lambda img: img.divide(10000)) \
            .median()

        vis_params = [
            {'bands': ['B4', 'B3', 'B2'], 'min': 0, 'max': 0.3, 'gamma': 1.3},
            {'bands': ['B8', 'B11', 'B4'], 'min': 0, 'max': 0.3, 'gamma': 1.3},
            {'bands': ['B8', 'B4', 'B3'], 'min': 0, 'max': 0.3, 'gamma': 1.3},
            {'bands': ['B12', 'B12', 'B4'], 'min': 0, 'max': 0.3, 'gamma': 1.3}
        ]

        labels = [
            'Natural Color (B4/B3/B2)',
            'Land/Water (B8/B11/B4)',
            'Color Infrared (B8/B4/B3)',
            'Vegetation (B12/B11/B4)'
        ]

        geemap.linked_maps(rows=2, cols=2, height="400px", center=[38.4151, 21.2712], 
                           zoom=12,
                           ee_objects=[image], vis_params=vis_params, labels=labels, 
                           label_position="topright")

它也不能添加到 geemap.Map() 我如何在 pyqt5 中显示 geemap.liked_maps?

标签: pythonpyqt5geemap

解决方案


推荐阅读