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


Python KML_ElementMaker.tesselate方法代码示例

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


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

示例1: to_kml

# 需要导入模块: from pykml.factory import KML_ElementMaker [as 别名]
# 或者: from pykml.factory.KML_ElementMaker import tesselate [as 别名]
    def to_kml(self, round=None):
        from pykml.factory import KML_ElementMaker as KML
        poly = KML.Polygon(
            KML.tesselate("1")
        )
        outer = KML.outerBoundaryIs()
        inner = KML.innerBoundaryIs()
        has_inner = False
        for i in range(len(self.poly)):
            cnt = self.poly[i]
            coords = ''
            for p in cnt:
                coords += ','.join(map(str, p)) + ' '
            ring = KML.LinearRing(
                KML.coordinates(coords)
            )
            #hole = self.poly.isHole(i)
            #if hole == False:
            outer.append(ring)
            #else:
            #    inner.append(ring)
            #    has_inner = True

        poly.append(outer)
        if has_inner:
            poly.append(inner)

        return poly
开发者ID:Eugene-msc,项目名称:kartograph.py,代码行数:30,代码来源:polygon.py

示例2: addLine

# 需要导入模块: from pykml.factory import KML_ElementMaker [as 别名]
# 或者: from pykml.factory.KML_ElementMaker import tesselate [as 别名]
def addLine(doc,line):
	coordinates = "";
	for p in line:
		coordinates += ("\n" + p.toKMLstr())
	pm1 = KML.Placemark(
		KML.name("GridLine"),
		KML.visibility(1),
		KML.LineString(
			KML.extrude(1),
			#KML.altitudeMode("relativeToGround"),
			KML.tesselate(0),
			KML.coordinates(coordinates)
		)
	)
	doc.Document.append(pm1)
开发者ID:will421,项目名称:PROJET_VM,代码行数:17,代码来源:kmlwriter.py

示例3: addSegment

# 需要导入模块: from pykml.factory import KML_ElementMaker [as 别名]
# 或者: from pykml.factory.KML_ElementMaker import tesselate [as 别名]
def addSegment(doc,seg,colorStr):
	pm1 = KML.Placemark(
		KML.name("OneSegment"),
		KML.visibility(1),
		#KML.styleUrl("#redLineBluePoly"),
		KML.Style(
			KML.LineStyle(
				KML.color(colorStr),
				KML.width(3)
			)
		),
		KML.LineString(
			KML.extrude(1),
			KML.tesselate(0),
			#KML.altitudeMode("relativeToGround"),
			KML.coordinates("{}\n{}".format(seg[0].toKMLstr(),seg[1].toKMLstr())
			)
		)
	)
	doc.Document.append(pm1)
开发者ID:will421,项目名称:PROJET_VM,代码行数:22,代码来源:kmlwriter.py


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