Download Sample KML & KMZ Files (Google Earth)
Download free sample KML files. Keyhole Markup Language is the standard for geospatial data in Google Earth and Google Maps. Use these files to test XML parsing logic, coordinate extraction (Lon/Lat), and zipped KMZ handling. STANDARD Placemarks & Polygons File Name Specs Size Action simple_placemark.kml Point Basic location pin. Contains <Point> coordinates. Good for testing…
Download free sample KML files. Keyhole Markup Language is the standard for geospatial data in Google Earth and Google Maps. Use these files to test XML parsing logic, coordinate extraction (Lon/Lat), and zipped KMZ handling.
STANDARD
Placemarks & Polygons
| File Name | Specs | Size | Action |
|---|---|---|---|
| simple_placemark.kml Point |
Basic location pin. Contains <Point> coordinates. Good for testing basic mapping. |
1 KB | Download |
| travel_route.kml LineString |
Path connecting multiple coordinates. Used for GPS tracks. Contains <LineString>. |
5 KB | Download |
| restricted_zone.kml Polygon |
Closed area defined by an outer boundary. Used for zoning. Contains <Polygon>. |
2 KB | Download |
QA / ADVANCED
KMZ & 3D Data
| Test Case | Description | Size | Action |
|---|---|---|---|
| Archive (.kmz) | Zipped KML. Contains a `doc.kml` and an images folder. Tests your ability to unzip and parse referenced assets. | 50 KB | Download |
| HTML Popups (CDATA) | Rich Content. Uses <![CDATA[...]]> to embed HTML tables and links inside the map balloon. |
5 KB | Download |
| 3D Buildings | Extruded Polygons. Uses <extrude>1</extrude> and relativeToGround to create 3D volumes. |
10 KB | Download |
Technical Specs: KML
- Coordinates: Order is
Longitude,Latitude,Altitude. Note that Google Maps API often usesLat,Lon. Don’t mix them up! - Colors (AABBGGRR): KML uses 8-digit Hex codes in KML order (Alpha, Blue, Green, Red). This is the reverse of standard HTML (Red, Green, Blue).
- MIME Type:
application/vnd.google-earth.kml+xml.
Frequently Asked Questions
If you use an HTML hex code like `#FF0000` (Red), KML reads it as Blue because the order is BGR, not RGB. You must swap the first and last pairs.
A KMZ file is just a ZIP archive. Rename `file.kmz` to `file.zip` and extract it. You will find a `doc.kml` file inside, which is the actual text data.
How to view KML files?
Google Earth is the standard, but you can check the XML code directly.
- Google Earth Pro: The desktop version allows you to edit KMLs, create tours, and export movies.
- VS Code (XML Tools): Since KML is XML, use an XML formatter to make the file readable and debug coordinate errors.
- QGIS: Professional GIS software to convert KML to Shapefile (SHP) or GeoJSON.
Developer’s Corner: Coordinate Parsing
KML is XML. You can use standard XML libraries to extract data.
from pykml import parserwith open(‘map.kml’, ‘r’) as f:
root = parser.parse(f).getroot()for pm in root.Document.Folder.Placemark:
print(pm.name)
