當前位置: 首頁>>代碼示例>>Python>>正文


Python Kml.newgxtrack方法代碼示例

本文整理匯總了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'
開發者ID:balzer82,項目名稱:Kalman,代碼行數:33,代碼來源:Extended-Kalman-Filter-CTRA.py

示例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])
開發者ID:mahowik,項目名稱:Kalman,代碼行數:34,代碼來源:Extended-Kalman-Filter-CTRV-Attitude-LatLon.py

示例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])
開發者ID:PseudoAj,項目名稱:simplekml,代碼行數:32,代碼來源:T05_ExtendedData.py


注:本文中的simplekml.Kml.newgxtrack方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。