本文整理汇总了Python中simplekml.Kml.newgxtrack方法的典型用法代码示例。如果您正苦于以下问题:Python Kml.newgxtrack方法的具体用法?Python Kml.newgxtrack怎么用?Python Kml.newgxtrack使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类simplekml.Kml
的用法示例。
在下文中一共展示了Kml.newgxtrack方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: Kml
# 需要导入模块: from simplekml import Kml [as 别名]
# 或者: from simplekml.Kml import newgxtrack [as 别名]
# In[32]:
# The model path and scale variables
car_dae = r'https://raw.githubusercontent.com/balzer82/Kalman/master/car-model.dae'
car_scale = 1.0
# Create the KML document
kml = Kml(name=d.strftime("%Y-%m-%d %H:%M"), open=1)
# Create the model
model_car = Model(altitudemode=AltitudeMode.clamptoground,
orientation=Orientation(heading=75.0),
scale=Scale(x=car_scale, y=car_scale, z=car_scale))
# Create the track
trk = kml.newgxtrack(name="EKF", altitudemode=AltitudeMode.clamptoground,
description="State Estimation from Extended Kalman Filter with CTRA Model")
# Attach the model to the track
trk.model = model_car
trk.model.link.href = car_dae
# Add all the information to the track
trk.newwhen(car["when"])
trk.newgxcoord(car["coord"])
# Style of the Track
trk.iconstyle.icon.href = ""
trk.labelstyle.scale = 1
trk.linestyle.width = 4
trk.linestyle.color = '7fff0000'
示例2: Kml
# 需要导入模块: from simplekml import Kml [as 别名]
# 或者: from simplekml.Kml import newgxtrack [as 别名]
# <codecell>
# The model path and scale variables
car_dae = r'http://simplekml.googlecode.com/hg/samples/resources/car-model.dae'
car_scale = 1.0
# Create the KML document
kml = Kml(name=d.strftime("%Y-%m-%d %H:%M"), open=1)
# Create the model
model_car = Model(altitudemode=AltitudeMode.clamptoground,
orientation=Orientation(heading=75.0),
scale=Scale(x=car_scale, y=car_scale, z=car_scale))
# Create the track
trk = kml.newgxtrack(name="EKF", altitudemode=AltitudeMode.clamptoground,
description="State Estimation from Extended Kalman Filter with CTRV Model")
gps = kml.newgxtrack(name="GPS", altitudemode=AltitudeMode.clamptoground,
description="Original GPS Measurements")
# Attach the model to the track
trk.model = model_car
gps.model = model_car
trk.model.link.href = car_dae
gps.model.link.href = car_dae
# Add all the information to the track
trk.newwhen(car["when"])
trk.newgxcoord(car["coord"])
gps.newwhen(car["when"][::5])
示例3: Birds
# 需要导入模块: from simplekml import Kml [as 别名]
# 或者: from simplekml.Kml import newgxtrack [as 别名]
# Create and style a point
coords = [(18.36271305597591,-34.01792707074279,0),
(18.36249939144205,-34.01762728515967,0),
(18.36247681257987,-34.01736644626698,0),
(18.36237928017156,-34.01723665897296,0),
(18.36223391902398,-34.0172544563783,0),
(18.36203086107577,-34.01693989513787,0)]
when = ["2010-05-28T02:00:00Z",
"2010-05-28T02:10:00Z",
"2010-05-28T02:20:00Z",
"2010-05-28T02:30:00Z",
"2010-05-28T02:40:00Z",
"2010-05-28T02:50:00Z"]
# Create the gx:Track and style it
trk = kml.newgxtrack(name='3. World of Birds (Simple Array Data)')
trk.snippet = Snippet('Click anywhere on the line or open the elevation profile to view the extended data.', 4)
trk.iconstyle.icon.href = 'http://maps.google.com/mapfiles/kml/paddle/3.png'
trk.liststyle.itemicon.href = 'http://maps.google.com/mapfiles/kml/paddle/3.png'
trk.linestyle.width = 3
trk.linestyle.color = Color.red
# Add the coordinates
trk.newgxcoord(coords)
# Add the time
trk.newwhen(when)
# Add extended data to the point (view the elevation profile in Google Earth to see the data)
trk.extendeddata.schemadata.schemaurl = schema.id
trk.extendeddata.schemadata.newgxsimplearraydata('birdseen', [5,8,10,15,20,30])