OpenersPrimaryExamplesSection(Spacer1)Examples  (6)

OpenersExampleSection0(Spacer1)Basic Examples  (5)

Import all layers from a KML file:

Import["ExampleData/weather.kml", "Graphics"]

Import layers as a list:

Import["ExampleData/weather.kml", "GraphicsList"]

Import the layer names:

Import["ExampleData/weather.kml", "LayerNames"]

Import city information:

Import["ExampleData/weather.kml", {"Data", 2, "LabeledData"}]

Show a list of all import elements available for this file:

Import["ExampleData/weather.kml", "Elements"]

OpenersExampleSection1(Spacer1)Applications  (1)

Find the shortest path between the 40 largest German cities:

coords=CityData[#,"Coordinates"]&/@Take[CityData[{Large,"Germany"}],40];

line=Line[Reverse/@coords[[FindShortestTour[coords][[2]]]]];

Graphics[{Gray,CountryData["Germany","Polygon"],Black,line}]

Export the resulting tour:

Export["tour.kml", "Data"->{{"LayerName"->"ShortestTour","Geometry"->{line}}}, {"KML","Rules"}]

({{DocumentationFooterIconsRelatedFunction.png, ({{See Also}, {Related Formats:  (RefLink[SHP, paclet:ref/format/SHP])  ▪  (RefLink[SDTS, paclet:ref/format/SDTS])  ▪  (RefLink[TIGER, paclet:ref/format/TIGER])}})}})

({{DocumentationFooterIconsRelatedGuide.png, ({{Related Guides}, {▪(RefLinkPlain[Geospatial Formats, paclet:guide/GeospatialFormats])}, {▪(RefLinkPlain[Graphics Importing & Exporting, paclet:guide/GraphicsImportingAndExporting])}, {▪(RefLinkPlain[Importing & Exporting, paclet:guide/ImportingAndExporting])}, {▪(RefLinkPlain[Listing of All Formats, paclet:guide/ListingOfAllFormats])}, {▪(RefLinkPlain[New in 6.0: Data Handling & Data Sources, paclet:guide/NewIn60DataHandlingAndDataSources])}, {▪(RefLinkPlain[New in 6.0: Import & Export Formats, paclet:guide/NewIn60ImportAndExportFormats])}})}})