本文整理汇总了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
示例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)
示例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)