Overlays¶
GroundOverlay¶
-
class
simplekml.
GroundOverlay
(altitude=None, altitudemode=None, gxaltitudemode=None, latlonbox=None, gxlatlonquad=None, **kwargs)¶ Draws an image overlay draped onto the terrain.
Arguments are the same as the properties.
Usage:
import simplekml kml = simplekml.Kml() ground = kml.newgroundoverlay(name='GroundOverlay') ground.icon.href = 'http://simplekml.googlecode.com/hg/samples/resources/smile.png' ground.gxlatlonquad.coords = [(18.410524,-33.903972),(18.411429,-33.904171), (18.411757,-33.902944),(18.410850,-33.902767)] # or #ground.latlonbox.north = -33.902828 #ground.latlonbox.south = -33.904104 #ground.latlonbox.east = 18.410684 #ground.latlonbox.west = 18.411633 #ground.latlonbox.rotation = -14 kml.save("GroundOverlay.kml")
-
address
¶ Standard address, accepts string.
-
altitude
¶ Distance above earth surface, accepts float.
-
altitudemode
¶ Specifies how the altitude for the Camera is interpreted.
Accepts
simplekml.AltitudeMode
constants.
Author of the feature, accepts string.
-
atomlink
¶ URL containing this KML, accepts string.
-
balloonstyle
¶ BalloonStyle of the feature, accepts
simplekml.BalloonStyle
-
camera
¶ Camera that views the scene, accepts
simplekml.Camera
-
color
¶ The color of the overlay, accepts hex string.
-
description
¶ Description shown in the information balloon, accepts string.
-
draworder
¶ The order to draw the overlay, accepts int.
-
extendeddata
¶ Extra data for the feature.
-
gxaltitudemode
¶ Specifies how the altitude for the Camera is interpreted.
With the addition of being relative to the sea floor. Accepts
simplekml.GxAltitudeMode
constants.
-
gxballoonvisibility
¶ Toggles visibility of a description balloon, accepts int 0 or 1
New in version 1.1.1
-
gxlatlonquad
¶ Specifies the coordinates of the four corner points of a quadrilateral defining the overlay area. Accepts
simplekml.GxLatLonQuad
-
icon
¶ The icon to use for the overlay, accepts
simplekml.Icon
-
iconstyle
¶ IconStyle of the feature, accepts
simplekml.IconStyle
-
id
¶ Id number of feature, read-only.
-
labelstyle
¶ LabelStyle of the feature, accepts
simplekml.LabelStyle
-
latlonbox
¶ Specifies where the top, bottom, right, and left sides are.
Accepts
simplekml.LatLonBox
.
-
linestyle
¶ LineStyle of the feature, accepts
simplekml.LineStyle
-
liststyle
¶ ListStyle of the feature, accepts
simplekml.ListStyle
-
lookat
¶ Camera relative to the feature, accepts
simplekml.LookAt
-
name
¶ Name of placemark, accepts string.
-
open
¶ Whether open or closed in Places panel, accepts int 0 or 1.
-
phonenumber
¶ Phone number used by Google Maps mobile, accepts string.
-
polystyle
¶ PolyStyle of the feature, accepts
simplekml.PolyStyle
-
region
¶ Bounding box of feature, accepts
simplekml.Region
-
snippet
¶ Short description of the feature, accepts
simplekml.Snippet
-
style
¶ The current style of the feature, accepts
simplekml.Style
-
stylemap
¶ The current StyleMap of the feature, accepts
simplekml.StyleMap
-
styleurl
¶ Reference to the current styleurl or the feature, accepts string.
-
timespan
¶ Period of time, accepts
simplekml.TimeSpan
-
timestamp
¶ Single moment in time, accepts
simplekml.TimeStamp
-
visibility
¶ Whether the feature is shown, accepts int 0 or 1.
-
xaladdressdetails
¶ Address in xAL format, accepts string.
Note
There seems to be a bug in Google Earth where the inclusion of the namespace xmlns:xal=”urn:oasis:names:tc:ciq:xsdschema:xAL:2.0” seems to break some other elements of the KML such as touring (a tour will not play). If xaladdressdetails is used the above namespace will be added to the KML and will possibly break other elements. Use with caution.
-
ScreenOverlay¶
-
class
simplekml.
ScreenOverlay
(overlayxy=None, screenxy=None, rotationxy=None, size=None, rotation=None, **kwargs)¶ Draws an image overlay fixed to the screen.
Arguments are the same as the properties.
Usage:
import simplekml kml = simplekml.Kml() screen = kml.newscreenoverlay(name='ScreenOverlay') screen.icon.href = 'http://simplekml.googlecode.com/hg/samples/resources/simplekml-logo.png' screen.overlayxy = simplekml.OverlayXY(x=0,y=1,xunits=simplekml.Units.fraction, yunits=simplekml.Units.fraction) screen.screenxy = simplekml.ScreenXY(x=15,y=15,xunits=simplekml.Units.pixels, yunits=simplekml.Units.insetpixels) screen.size.x = -1 screen.size.y = -1 screen.size.xunits = simplekml.Units.fraction screen.size.yunits = simplekml.Units.fraction kml.save("ScreenOverlay.kml")
-
address
¶ Standard address, accepts string.
Author of the feature, accepts string.
-
atomlink
¶ URL containing this KML, accepts string.
-
balloonstyle
¶ BalloonStyle of the feature, accepts
simplekml.BalloonStyle
-
camera
¶ Camera that views the scene, accepts
simplekml.Camera
-
color
¶ The color of the overlay, accepts hex string.
-
description
¶ Description shown in the information balloon, accepts string.
-
draworder
¶ The order to draw the overlay, accepts int.
-
extendeddata
¶ Extra data for the feature.
-
gxballoonvisibility
¶ Toggles visibility of a description balloon, accepts int 0 or 1
New in version 1.1.1
-
icon
¶ The icon to use for the overlay, accepts
simplekml.Icon
-
iconstyle
¶ IconStyle of the feature, accepts
simplekml.IconStyle
-
id
¶ Id number of feature, read-only.
-
labelstyle
¶ LabelStyle of the feature, accepts
simplekml.LabelStyle
-
linestyle
¶ LineStyle of the feature, accepts
simplekml.LineStyle
-
liststyle
¶ ListStyle of the feature, accepts
simplekml.ListStyle
-
lookat
¶ Camera relative to the feature, accepts
simplekml.LookAt
-
name
¶ Name of placemark, accepts string.
-
open
¶ Whether open or closed in Places panel, accepts int 0 or 1.
-
overlayxy
¶ Point on the overlay image that is mapped to a screen coordinate.
Specifies a point on (or outside of) the overlay image that is mapped to the screen coordinate
simplekml.ScreenXY
, acceptssimplekml.OverlayXY
-
phonenumber
¶ Phone number used by Google Maps mobile, accepts string.
-
polystyle
¶ PolyStyle of the feature, accepts
simplekml.PolyStyle
-
region
¶ Bounding box of feature, accepts
simplekml.Region
-
rotation
¶ Rotation of the overlay, accepts float.
-
rotationxy
¶ Point relative to the screen about which the overlay is rotated.
Accepts
simplekml.RotationXY
-
screenxy
¶ Point relative to screen origin that the image is mapped to.
Specifies a point relative to the screen origin that the overlay image is mapped to, accepts
simplekml.ScreenXY
-
size
¶ The size of the image for the screen overlay, accepts
simplekml.Size
-
snippet
¶ Short description of the feature, accepts
simplekml.Snippet
-
style
¶ The current style of the feature, accepts
simplekml.Style
-
stylemap
¶ The current StyleMap of the feature, accepts
simplekml.StyleMap
-
styleurl
¶ Reference to the current styleurl or the feature, accepts string.
-
timespan
¶ Period of time, accepts
simplekml.TimeSpan
-
timestamp
¶ Single moment in time, accepts
simplekml.TimeStamp
-
visibility
¶ Whether the feature is shown, accepts int 0 or 1.
-
xaladdressdetails
¶ Address in xAL format, accepts string.
Note
There seems to be a bug in Google Earth where the inclusion of the namespace xmlns:xal=”urn:oasis:names:tc:ciq:xsdschema:xAL:2.0” seems to break some other elements of the KML such as touring (a tour will not play). If xaladdressdetails is used the above namespace will be added to the KML and will possibly break other elements. Use with caution.
-
PhotoOverlay¶
-
class
simplekml.
PhotoOverlay
(rotation=None, viewvolume=None, imagepyramid=None, point=None, shape=None, **kwargs)¶ Geographically locate a photograph in Google Earth.
Arguments are the same as the properties.
Usage:
import simplekml kml = simplekml.Kml() photo = kml.newphotooverlay(name='PhotoOverlay Test') photo.camera = simplekml.Camera(longitude=18.410858, latitude=-33.904446, altitude=50, altitudemode=simplekml.AltitudeMode.clamptoground) photo.point.coords = [(18.410858,-33.90444)] photo.style.iconstyle.icon.href = 'http://maps.google.com/mapfiles/kml/shapes/camera.png' photo.icon.href = 'http://simplekml.googlecode.com/hg/samples/resources/stadium.jpg' photo.viewvolume = simplekml.ViewVolume(-25,25,-15,15,1) kml.save("PhotoOverlay.kml")
-
address
¶ Standard address, accepts string.
Author of the feature, accepts string.
-
atomlink
¶ URL containing this KML, accepts string.
-
balloonstyle
¶ BalloonStyle of the feature, accepts
simplekml.BalloonStyle
-
camera
¶ Camera that views the scene, accepts
simplekml.Camera
-
color
¶ The color of the overlay, accepts hex string.
-
description
¶ Description shown in the information balloon, accepts string.
-
draworder
¶ The order to draw the overlay, accepts int.
-
extendeddata
¶ Extra data for the feature.
-
gxballoonvisibility
¶ Toggles visibility of a description balloon, accepts int 0 or 1
New in version 1.1.1
-
icon
¶ The icon to use for the overlay, accepts
simplekml.Icon
-
iconstyle
¶ IconStyle of the feature, accepts
simplekml.IconStyle
-
id
¶ Id number of feature, read-only.
-
imagepyramid
¶ Hierarchical set of images, accepts
simplekml.ImagePyramid
-
labelstyle
¶ LabelStyle of the feature, accepts
simplekml.LabelStyle
-
linestyle
¶ LineStyle of the feature, accepts
simplekml.LineStyle
-
liststyle
¶ ListStyle of the feature, accepts
simplekml.ListStyle
-
lookat
¶ Camera relative to the feature, accepts
simplekml.LookAt
-
name
¶ Name of placemark, accepts string.
-
open
¶ Whether open or closed in Places panel, accepts int 0 or 1.
-
phonenumber
¶ Phone number used by Google Maps mobile, accepts string.
-
point
¶ Draws an icon to mark the position of the overlay,accepts
simplekml.Point
-
polystyle
¶ PolyStyle of the feature, accepts
simplekml.PolyStyle
-
region
¶ Bounding box of feature, accepts
simplekml.Region
-
rotation
¶ Rotation of the overlay, accepts float.
-
shape
¶ Shape the photo is drawn, accepts string from
simplekml.Shape
constants.
-
snippet
¶ Short description of the feature, accepts
simplekml.Snippet
-
style
¶ The current style of the feature, accepts
simplekml.Style
-
stylemap
¶ The current StyleMap of the feature, accepts
simplekml.StyleMap
-
styleurl
¶ Reference to the current styleurl or the feature, accepts string.
-
timespan
¶ Period of time, accepts
simplekml.TimeSpan
-
timestamp
¶ Single moment in time, accepts
simplekml.TimeStamp
-
viewvolume
¶ How much of the current scene is visible, accepts
simplekml.ViewVolume
-
visibility
¶ Whether the feature is shown, accepts int 0 or 1.
-
xaladdressdetails
¶ Address in xAL format, accepts string.
Note
There seems to be a bug in Google Earth where the inclusion of the namespace xmlns:xal=”urn:oasis:names:tc:ciq:xsdschema:xAL:2.0” seems to break some other elements of the KML such as touring (a tour will not play). If xaladdressdetails is used the above namespace will be added to the KML and will possibly break other elements. Use with caution.
-