{"id":18600661,"url":"https://github.com/georust/kml","last_synced_at":"2025-08-20T03:30:52.799Z","repository":{"id":37789127,"uuid":"322618246","full_name":"georust/kml","owner":"georust","description":"Rust support for KML","archived":false,"fork":false,"pushed_at":"2024-01-02T23:34:20.000Z","size":238,"stargazers_count":27,"open_issues_count":4,"forks_count":22,"subscribers_count":5,"default_branch":"main","last_synced_at":"2024-10-29T19:03:47.660Z","etag":null,"topics":["geospatial","gis","hacktoberfest","kml","rust"],"latest_commit_sha":null,"homepage":"https://docs.rs/kml/","language":"Rust","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"apache-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/georust.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":null,"funding":null,"license":"LICENSE-APACHE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null}},"created_at":"2020-12-18T14:30:25.000Z","updated_at":"2024-05-26T01:03:00.000Z","dependencies_parsed_at":"2023-02-16T02:10:23.465Z","dependency_job_id":"11cd02d1-63ef-473e-8f20-2f02dd2d516e","html_url":"https://github.com/georust/kml","commit_stats":{"total_commits":82,"total_committers":12,"mean_commits":6.833333333333333,"dds":"0.35365853658536583","last_synced_commit":"1a6d64ed60df4016665cc42d03e60a1c061fc0c7"},"previous_names":[],"tags_count":21,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/georust%2Fkml","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/georust%2Fkml/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/georust%2Fkml/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/georust%2Fkml/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/georust","download_url":"https://codeload.github.com/georust/kml/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":230311962,"owners_count":18206759,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["geospatial","gis","hacktoberfest","kml","rust"],"created_at":"2024-11-07T02:04:53.946Z","updated_at":"2025-08-20T03:30:52.791Z","avatar_url":"https://github.com/georust.png","language":"Rust","funding_links":[],"categories":["Rust"],"sub_categories":[],"readme":"# kml\n\n[![crates.io](https://img.shields.io/crates/v/kml.svg)](https://crates.io/crates/kml)\n[![Build status](https://github.com/georust/kml/workflows/CI/badge.svg)](https://github.com/georust/kml/actions?query=workflow%3ACI)\n[![Documentation](https://docs.rs/kml/badge.svg)](https://docs.rs/kml)\n\nRust support for reading and writing KML with a focus on conversion to [`geo-types`](https://github.com/georust/geo) primitives.\n\n## Examples\n\n### Reading\n\n```rust\nuse std::path::Path;\nuse kml::{Kml, KmlReader};\n\nlet kml_str = r#\"\n\u003cPolygon\u003e\n  \u003couterBoundaryIs\u003e\n    \u003cLinearRing\u003e\n    \u003ctessellate\u003e1\u003c/tessellate\u003e\n    \u003ccoordinates\u003e\n        -1,2,0\n        -1.5,3,0\n        -1.5,2,0\n        -1,2,0\n    \u003c/coordinates\u003e\n    \u003c/LinearRing\u003e\n  \u003c/outerBoundaryIs\u003e\n\u003c/Polygon\u003e\n\"#;\n\n// Parse from a string\nlet kml: Kml = kml_str.parse().unwrap();\n\n// Read from a file path\nlet kml_path = Path::new(env!(\"CARGO_MANIFEST_DIR\"))\n    .join(\"tests\")\n    .join(\"fixtures\")\n    .join(\"polygon.kml\");\nlet mut kml_reader = KmlReader::\u003c_, f64\u003e::from_path(kml_path).unwrap();\nlet kml_data = kml_reader.read().unwrap();\n\n// Read KMZ files with the `zip` feature or default features enabled\nlet kmz_path = Path::new(env!(\"CARGO_MANIFEST_DIR\"))\n    .join(\"tests\")\n    .join(\"fixtures\")\n    .join(\"polygon.kmz\");\nlet mut kmz_reader = KmlReader::\u003c_, f64\u003e::from_kmz_path(kmz_path).unwrap();\nlet kmz_data = kmz_reader.read().unwrap();\n```\n\n### Writing\n\n```rust\nuse kml::{Kml, KmlWriter, types::Point};\n\nlet kml = Kml::Point(Point::new(1., 1., None));\n\nlet mut buf = Vec::new();\nlet mut writer = KmlWriter::from_writer(\u0026mut buf);\nwriter.write(\u0026kml).unwrap();\n```\n\n### Conversion\n\n```rust\nuse geo_types::{self, GeometryCollection};\nuse kml::{Kml, types::Point};\n\nlet kml_point = Point::new(1., 1., None);\n// Convert into geo_types primitives\nlet geo_point = geo_types::Point::from(kml_point);\n// Convert back into kml::types structs\nlet kml_point = Point::from(geo_point);\n\nlet kml_folder_str = r#\"\n\u003cFolder\u003e\n  \u003cPoint\u003e\n    \u003ccoordinates\u003e1,1,1\u003c/coordinates\u003e\n    \u003caltitudeMode\u003erelativeToGround\u003c/altitudeMode\u003e\n  \u003c/Point\u003e\n  \u003cLineString\u003e\n    \u003ccoordinates\u003e1,1 2,1 3,1\u003c/coordinates\u003e\n    \u003caltitudeMode\u003erelativeToGround\u003c/altitudeMode\u003e\n  \u003c/LineString\u003e\n\u003c/Folder\u003e\"#;\nlet kml_folder: Kml\u003cf64\u003e = kml_folder_str.parse().unwrap();\n\nlet geom_coll: GeometryCollection\u003cf64\u003e = kml_folder.try_into().unwrap();\n```\n\n## Code of Conduct\n\nAll contributors are expected to follow the [GeoRust Code of Conduct](https://github.com/georust/.github/blob/main/CODE_OF_CONDUCT.md)\n\n## License\n\nLicensed under either of\n\n- Apache License, Version 2.0 ([LICENSE-APACHE](LICENSE-APACHE) or http://www.apache.org/licenses/LICENSE-2.0)\n- MIT license ([LICENSE-MIT](LICENSE-MIT) or http://opensource.org/licenses/MIT)\n\nat your option.\n\n### Contribution\n\nUnless you explicitly state otherwise, any contribution intentionally submitted for inclusion in the work by you, as defined in the Apache-2.0 license, shall be dual licensed as above, without any additional terms or conditions.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fgeorust%2Fkml","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fgeorust%2Fkml","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fgeorust%2Fkml/lists"}