当前位置: 首页>>代码示例>>Python>>正文


Python LayerGroup.metadataURL方法代码示例

本文整理汇总了Python中c2cgeoportal.models.LayerGroup.metadataURL方法的典型用法代码示例。如果您正苦于以下问题:Python LayerGroup.metadataURL方法的具体用法?Python LayerGroup.metadataURL怎么用?Python LayerGroup.metadataURL使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在c2cgeoportal.models.LayerGroup的用法示例。


在下文中一共展示了LayerGroup.metadataURL方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。

示例1: test_layer

# 需要导入模块: from c2cgeoportal.models import LayerGroup [as 别名]
# 或者: from c2cgeoportal.models.LayerGroup import metadataURL [as 别名]
    def test_layer(self):
        import httplib2
        from c2cgeoportal.views.entry import Entry
        from c2cgeoportal.models import Layer, LayerGroup, Theme

        request = testing.DummyRequest()
        request.headers['Host'] = host
        request.static_url = lambda url: '/dummy/static/' + url
        request.route_url = lambda url: '/dummy/route/' + url
        request.registry.settings = {
            'project': 'test_layer',
        }
        entry = Entry(request)

        self.assertEqual(entry._group(LayerGroup(), [], [], None), (None, [], False))

        layer = Layer()
        layer.id = 20
        layer.name = 'test internal WMS'
        layer.metadataURL = "http://example.com/tiwms"
        layer.isChecked = True
        layer.layerType = "internal WMS"
        layer.imageType = "image/png"
        layer.style = "my-style"
        layer.kml = "tiwms.kml"
        layer.legend = True
        layer.legendRule = "rule"
        layer.legendImage = "legend:static/tiwms-legend.png"
        layer.minResolution = 10
        layer.maxResolution = 1000
        layer.disclaimer = "Camptocamp"
        layer.identifierAttributeField = "name"
        layer.geoTable = "tiwms"
        layer.public = True
        self.assertEqual(entry._layer(layer, [], None), ({
            'id': 20,
            'name': 'test internal WMS',
            'metadataURL': 'http://example.com/tiwms',
            'isChecked': True,
            'icon': '/dummy/route/mapserverproxy?SERVICE=WMS&VERSION=1.1.1&REQUEST=GetLegendGraphic&LAYER=test internal WMS&FORMAT=image/png&TRANSPARENT=TRUE&RULE=rule',
            'type': u'internal WMS',
            'imageType': 'image/png',
            'style': 'my-style',
            'kml': '/dummy/static/test_layer:static/tiwms.kml',
            'legend': True,
            'legendImage': '/dummy/static/legend:static/tiwms-legend.png',
            'minResolutionHint': 10,
            'maxResolutionHint': 1000,
            'disclaimer': 'Camptocamp',
            'identifierAttribute': 'name',
            'editable': True,
            'public': True,
        }, []))

        layer = Layer()
        layer.id = 20
        layer.name = 'test external WMS'
        layer.isChecked = False
        layer.icon = "tewms.png"
        layer.layerType = "external WMS"
        layer.url = "http://example.com"
        layer.imageType = "image/jpeg"
        layer.isSingleTile = True
        layer.legend = False
        layer.minResolution = 10
        layer.maxResolution = 1000
        layer.public = True
        self.assertEqual(entry._layer(layer, [], None), ({
            'id': 20,
            'name': 'test external WMS',
            'icon': '/dummy/static/test_layer:static/tewms.png',
            'isChecked': False,
            'type': u'external WMS',
            'url': 'http://example.com',
            'imageType': 'image/jpeg',
            'isSingleTile': True,
            'legend': False,
            'minResolutionHint': 10,
            'maxResolutionHint': 1000,
            'public': True,
        }, []))

        layer = Layer()
        layer.id = 20
        layer.name = 'test WMTS'
        layer.isChecked = False
        layer.layerType = "WMTS"
        layer.url = "http://example.com/WMTS-Capabilities.xml"
        layer.style = 'wmts-style'
        layer.dimensions = '{"DATE": "1012"}'
        layer.matrixSet = "swissgrid"
        layer.wmsUrl = 'http://example.com/'
        layer.wmsLayers = 'test'
        layer.legend = False
        layer.minResolution = 10
        layer.maxResolution = 1000
        layer.public = True
        self.assertEqual(entry._layer(layer, [], None), ({
            'id': 20,
            'name': 'test WMTS',
#.........这里部分代码省略.........
开发者ID:tonio,项目名称:c2cgeoportal,代码行数:103,代码来源:test_entry.py

示例2: test_layer

# 需要导入模块: from c2cgeoportal.models import LayerGroup [as 别名]
# 或者: from c2cgeoportal.models.LayerGroup import metadataURL [as 别名]
    def test_layer(self):
        import httplib2
        from c2cgeoportal.views.entry import Entry
        from c2cgeoportal.models import Layer, LayerGroup, Theme

        request = testing.DummyRequest()
        request.headers["Host"] = host
        request.static_url = lambda url: "/dummy/static/" + url
        request.route_url = lambda url: "/dummy/route/" + url
        request.registry.settings = {"project": "test_layer"}
        entry = Entry(request)

        self.assertEqual(entry._group(LayerGroup(), [], [], None), (None, [], False))

        layer = Layer()
        layer.id = 20
        layer.name = "test internal WMS"
        layer.metadataURL = "http://example.com/tiwms"
        layer.isChecked = True
        layer.layerType = "internal WMS"
        layer.imageType = "image/png"
        layer.style = "my-style"
        layer.kml = "tiwms.kml"
        layer.legend = True
        layer.legendRule = "rule"
        layer.legendImage = "legend:static/tiwms-legend.png"
        layer.minResolution = 10
        layer.maxResolution = 1000
        layer.disclaimer = "Camptocamp"
        layer.identifierAttributeField = "name"
        layer.geoTable = "tiwms"
        layer.public = True
        self.assertEqual(
            entry._layer(layer, [], None),
            (
                {
                    "id": 20,
                    "name": "test internal WMS",
                    "metadataURL": "http://example.com/tiwms",
                    "isChecked": True,
                    "icon": "/dummy/route/mapserverproxy?SERVICE=WMS&VERSION=1.1.1&REQUEST=GetLegendGraphic&LAYER=test internal WMS&FORMAT=image/png&TRANSPARENT=TRUE&RULE=rule",
                    "type": u"internal WMS",
                    "imageType": "image/png",
                    "style": "my-style",
                    "kml": "/dummy/static/test_layer:static/tiwms.kml",
                    "legend": True,
                    "legendImage": "/dummy/static/legend:static/tiwms-legend.png",
                    "minResolutionHint": 10,
                    "maxResolutionHint": 1000,
                    "disclaimer": "Camptocamp",
                    "identifierAttribute": "name",
                    "editable": True,
                    "public": True,
                },
                [],
            ),
        )

        layer = Layer()
        layer.id = 20
        layer.name = "test external WMS"
        layer.isChecked = False
        layer.icon = "tewms.png"
        layer.layerType = "external WMS"
        layer.url = "http://example.com"
        layer.imageType = "image/jpeg"
        layer.isSingleTile = True
        layer.legend = False
        layer.minResolution = 10
        layer.maxResolution = 1000
        layer.public = True
        self.assertEqual(
            entry._layer(layer, [], None),
            (
                {
                    "id": 20,
                    "name": "test external WMS",
                    "icon": "/dummy/static/test_layer:static/tewms.png",
                    "isChecked": False,
                    "type": u"external WMS",
                    "url": "http://example.com",
                    "imageType": "image/jpeg",
                    "isSingleTile": True,
                    "legend": False,
                    "minResolutionHint": 10,
                    "maxResolutionHint": 1000,
                    "public": True,
                },
                [],
            ),
        )

        layer = Layer()
        layer.id = 20
        layer.name = "test WMTS"
        layer.isChecked = False
        layer.layerType = "WMTS"
        layer.url = "http://example.com/WMTS-Capabilities.xml"
        layer.style = "wmts-style"
        layer.dimensions = '{"DATE": "1012"}'
#.........这里部分代码省略.........
开发者ID:bbinet,项目名称:c2cgeoportal,代码行数:103,代码来源:test_entry.py


注:本文中的c2cgeoportal.models.LayerGroup.metadataURL方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。