Containers¶
Document¶
-
class
simplekml.
Document
(**kwargs)¶ A container for features and styles.
Arguments are the same as the properties.
Usage:
import simplekml kml = simplekml.Kml() doc = kml.newdocument(name='A Document') pnt = doc.newpoint() kml.save("Document.kml")
-
address
¶ Standard address, accepts string.
-
allcontainers
¶ Returns a list of all the containers that have been attached to this container, and all sub containers.
New in version 1.1.0
-
allfeatures
¶ Returns a list of all the features that have been attached to this container, and all sub features.
New in version 1.1.0
-
allgeometries
¶ Returns a list of all the geometries that have been attached to this container, and all sub geometries.
New in version 1.1.0
-
allstylemaps
¶ Returns a list of all the stylemaps that have been attached to this container, and all sub stylemaps.
New in version 1.1.0
-
allstyles
¶ Returns a list of all the styles that have been attached to this container, and all sub styles.
New in version 1.1.0
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
-
containers
¶ Returns a list of all the containers that have been attached to this container.
New in version 1.1.0
-
description
¶ Description shown in the information balloon, accepts string.
-
extendeddata
¶ Extra data for the feature.
-
features
¶ Returns a list of all the features that have been attached to this container.
New in version 1.1.0
-
geometries
¶ Returns a list of all the geometries that have been attached to this container.
New in version 1.1.0
-
gxballoonvisibility
¶ Toggles visibility of a description balloon, accepts int 0 or 1
New in version 1.1.1
-
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.
-
newdocument
(**kwargs)¶ Creates a new
simplekml.Folder
and attaches it to this KML document.Arguments are the same as
simplekml.Folder
- Returns:
- an instance of
simplekml.Folder
class.
- an instance of
-
newfolder
(**kwargs)¶ Creates a new
simplekml.Folder
and attaches it to this KML document.Arguments are the same as
simplekml.Folder
- Returns:
- an instance of
simplekml.Folder
class.
- an instance of
-
newgroundoverlay
(**kwargs)¶ Creates a new
simplekml.GroundOverlay
and attaches it to this KML document.Arguments are the same as
simplekml.GroundOverlay
- Returns:
- an instance of
simplekml.GroundOverlay
class.
- an instance of
-
newgxmultitrack
(**kwargs)¶ Creates a new
simplekml.GxMultiTrack
and attaches it to this KML document.Arguments are the same as
simplekml.GxMultiTrack
- Returns:
- an instance of
simplekml.GxMultiTrack
class.
- an instance of
-
newgxtour
(**kwargs)¶ Creates a new
simplekml.GxTour
and attaches it to this KML document.Arguments are the same as
simplekml.GxTour
- Returns:
- an instance of
simplekml.NetworkLink
class.
- an instance of
-
newgxtrack
(**kwargs)¶ Creates a new
simplekml.GxTrack
and attaches it to this KML document.Arguments are the same as
simplekml.GxTrack
- Returns:
- an instance of
simplekml.GxTrack
class.
- an instance of
-
newlinestring
(**kwargs)¶ Creates a new
simplekml.LineString
and attaches it to this KML document.Arguments are the same as
simplekml.LineString
- Returns:
- an instance of
simplekml.LineString
class.
- an instance of
-
newmodel
(**kwargs)¶ Creates a new
simplekml.Model
and attaches it to this KML document.Arguments are the same as
simplekml.Model
- Returns:
- an instance of
simplekml.Model
class.
- an instance of
-
newmultigeometry
(**kwargs)¶ Creates a new
simplekml.MultiGeometry
and attaches it to this KML document.Arguments are the same as
simplekml.MultiGeometry
- Returns:
- an instance of
simplekml.MultiGeometry
class.
- an instance of
-
newnetworklink
(**kwargs)¶ Creates a new
simplekml.NetworkLink
and attaches it to this KML document.Arguments are the same as
simplekml.NetworkLink
- Returns:
- an instance of
simplekml.NetworkLink
class.
- an instance of
-
newphotooverlay
(**kwargs)¶ Creates a new
simplekml.PhotoOverlay
and attaches it to this KML document.Arguments are the same as
simplekml.PhotoOverlay
- Returns:
- an instance of
simplekml.PhotoOverlay
class.
- an instance of
-
newplacemark
(**kwargs)¶ Creates a new
simplekml.Placemark
and attaches it to this KML document.Arguments are the same as
simplekml.Placemark
- Returns:
- an instance of
simplekml.Placemark
class.
- an instance of
-
newpoint
(**kwargs)¶ Creates a new
simplekml.Point
and attaches it to this KML document.Arguments are the same as
simplekml.Point
- Returns:
- an instance of
simplekml.Point
class.
- an instance of
-
newpolygon
(**kwargs)¶ Creates a new
simplekml.Polygon
and attaches it to this KML document.Arguments are the same as
simplekml.Polygon
- Returns:
- an instance of
simplekml.Polygon
class.
- an instance of
-
newschema
(**kwargs)¶ Creates a new
simplekml.Schema
and attaches it to this KML document.Arguments are the same as
simplekml.Schema
- Returns:
- an instance of
simplekml.Schema
class.
- an instance of
-
newscreenoverlay
(**kwargs)¶ Creates a new
simplekml.ScreenOverlay
and attaches it to this KML document.Arguments are the same as
simplekml.ScreenOverlay
- Returns:
- an instance of
simplekml.ScreenOverlay
class.
- an instance of
-
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
-
stylemaps
¶ Returns a list of all the stylemaps that have been attached to this container.
New in version 1.1.0
-
styles
¶ Returns a list of all the styles that have been attached to this container.
New in version 1.1.0
-
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.
-
Folder¶
-
class
simplekml.
Folder
(**kwargs)¶ A container for features that act like a folder.
Arguments are the same as the properties.
Usage:
import simplekml kml = simplekml.Kml() fol = kml.newfolder(name='A Folder') pnt = fol.newpoint() kml.save("Folder.kml")
-
address
¶ Standard address, accepts string.
-
allcontainers
¶ Returns a list of all the containers that have been attached to this container, and all sub containers.
New in version 1.1.0
-
allfeatures
¶ Returns a list of all the features that have been attached to this container, and all sub features.
New in version 1.1.0
-
allgeometries
¶ Returns a list of all the geometries that have been attached to this container, and all sub geometries.
New in version 1.1.0
-
allstylemaps
¶ Returns a list of all the stylemaps that have been attached to this container, and all sub stylemaps.
New in version 1.1.0
-
allstyles
¶ Returns a list of all the styles that have been attached to this container, and all sub styles.
New in version 1.1.0
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
-
containers
¶ Returns a list of all the containers that have been attached to this container.
New in version 1.1.0
-
description
¶ Description shown in the information balloon, accepts string.
-
extendeddata
¶ Extra data for the feature.
-
features
¶ Returns a list of all the features that have been attached to this container.
New in version 1.1.0
-
geometries
¶ Returns a list of all the geometries that have been attached to this container.
New in version 1.1.0
-
gxballoonvisibility
¶ Toggles visibility of a description balloon, accepts int 0 or 1
New in version 1.1.1
-
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.
-
newdocument
(**kwargs)¶ Creates a new
simplekml.Folder
and attaches it to this KML document.Arguments are the same as
simplekml.Folder
- Returns:
- an instance of
simplekml.Folder
class.
- an instance of
-
newfolder
(**kwargs)¶ Creates a new
simplekml.Folder
and attaches it to this KML document.Arguments are the same as
simplekml.Folder
- Returns:
- an instance of
simplekml.Folder
class.
- an instance of
-
newgroundoverlay
(**kwargs)¶ Creates a new
simplekml.GroundOverlay
and attaches it to this KML document.Arguments are the same as
simplekml.GroundOverlay
- Returns:
- an instance of
simplekml.GroundOverlay
class.
- an instance of
-
newgxmultitrack
(**kwargs)¶ Creates a new
simplekml.GxMultiTrack
and attaches it to this KML document.Arguments are the same as
simplekml.GxMultiTrack
- Returns:
- an instance of
simplekml.GxMultiTrack
class.
- an instance of
-
newgxtour
(**kwargs)¶ Creates a new
simplekml.GxTour
and attaches it to this KML document.Arguments are the same as
simplekml.GxTour
- Returns:
- an instance of
simplekml.NetworkLink
class.
- an instance of
-
newgxtrack
(**kwargs)¶ Creates a new
simplekml.GxTrack
and attaches it to this KML document.Arguments are the same as
simplekml.GxTrack
- Returns:
- an instance of
simplekml.GxTrack
class.
- an instance of
-
newlinestring
(**kwargs)¶ Creates a new
simplekml.LineString
and attaches it to this KML document.Arguments are the same as
simplekml.LineString
- Returns:
- an instance of
simplekml.LineString
class.
- an instance of
-
newmodel
(**kwargs)¶ Creates a new
simplekml.Model
and attaches it to this KML document.Arguments are the same as
simplekml.Model
- Returns:
- an instance of
simplekml.Model
class.
- an instance of
-
newmultigeometry
(**kwargs)¶ Creates a new
simplekml.MultiGeometry
and attaches it to this KML document.Arguments are the same as
simplekml.MultiGeometry
- Returns:
- an instance of
simplekml.MultiGeometry
class.
- an instance of
-
newnetworklink
(**kwargs)¶ Creates a new
simplekml.NetworkLink
and attaches it to this KML document.Arguments are the same as
simplekml.NetworkLink
- Returns:
- an instance of
simplekml.NetworkLink
class.
- an instance of
-
newphotooverlay
(**kwargs)¶ Creates a new
simplekml.PhotoOverlay
and attaches it to this KML document.Arguments are the same as
simplekml.PhotoOverlay
- Returns:
- an instance of
simplekml.PhotoOverlay
class.
- an instance of
-
newplacemark
(**kwargs)¶ Creates a new
simplekml.Placemark
and attaches it to this KML document.Arguments are the same as
simplekml.Placemark
- Returns:
- an instance of
simplekml.Placemark
class.
- an instance of
-
newpoint
(**kwargs)¶ Creates a new
simplekml.Point
and attaches it to this KML document.Arguments are the same as
simplekml.Point
- Returns:
- an instance of
simplekml.Point
class.
- an instance of
-
newpolygon
(**kwargs)¶ Creates a new
simplekml.Polygon
and attaches it to this KML document.Arguments are the same as
simplekml.Polygon
- Returns:
- an instance of
simplekml.Polygon
class.
- an instance of
-
newscreenoverlay
(**kwargs)¶ Creates a new
simplekml.ScreenOverlay
and attaches it to this KML document.Arguments are the same as
simplekml.ScreenOverlay
- Returns:
- an instance of
simplekml.ScreenOverlay
class.
- an instance of
-
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
-
stylemaps
¶ Returns a list of all the stylemaps that have been attached to this container.
New in version 1.1.0
-
styles
¶ Returns a list of all the styles that have been attached to this container.
New in version 1.1.0
-
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.
-
NetworkLink¶
-
class
simplekml.
NetworkLink
(refreshvisibility=None, flytoview=None, link=None, **kwargs)¶ References a KML file or KMZ archive on a local or remote network.
Arguments are the same as the properties.
Usage:
import simplekml kml = simplekml.Kml() netlink = kml.newnetworklink(name="Network Link") netlink.link.href = "http://simplekml.googlecode.com/hg/samples/samples.kml" netlink.link.viewrefreshmode = simplekml.ViewRefreshMode.onrequest kml.save("NetworkLink.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
-
description
¶ Description shown in the information balloon, accepts string.
-
extendeddata
¶ Extra data for the feature.
-
flytoview
¶ A value of 1 causes Google Earth to fly to the view of the AbstractView.
Accepts int (0 or 1).
-
gxballoonvisibility
¶ Toggles visibility of a description balloon, accepts int 0 or 1
New in version 1.1.1
-
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
-
link
¶ A
simplekml.Link
class instance, acceptssimplekml.Link
-
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
-
refreshvisibility
¶ How the visibility is affected by a refresh
A value of 0 leaves the visibility of features within the control of the Google Earth user. Set the value to 1 to reset the visibility of features each time the NetworkLink is refreshed, accepts int (0 or 1).
-
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.
-