Skip to content

A kml data extraction script. Creates two csv: 1) with the placemaker's name and the latitude, longitude coordinates and 2) with the placemaker's name and the x,y,z coordinates.

License

Notifications You must be signed in to change notification settings

Panagiotis-Sklidas/KMLDataExtractor

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

18 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

KMLDataExtractor

CodeFactor

Contents

About the Project

This project was created during my studies at the University for the course "Optimization Algorithms". The final assignment required us to use optimization algorithms to find a solution to a similar postman problem with coordinates from a kml file. This python script can export the placemarks name and coordinates (latitude and longitude) to a csv file as well as convert the latitude and longitude to x, y, and z coordinates creating a second csv file with them.

Features

  • Exports a csv file named rawcoordinates, which has all placemarkers name and their latitude, longitude and altitude coordinates
  • Exports a csv file named coordinates, which has all placemarkers name, their x, y and z coordinates

Getting Started

Prerequisites

In order to run the application locally you should have the following installed:

  • Python 3.9.6 (Download here)
  • defusedxml module
pip install defusedxml

Usage

  1. Download the python file (extractData.py) and add it at the folder where your kml file is (or not)
  2. In your terminal window move to where you downloaded the extractData.py
  3. Then run the following command:
python extractData.py "example.kml"   
  1. The script will extract and create the csv files with the latitude and longitute and x,y,z coordinates.

Notes!

  • To add full fillpath for example if the kml file is in your Desktop the command should look like this:
python extractData.py "C:\Users\User\Desktop\example.kml"
  • The csv files will be located at the same folder as extractData.py file
  • The default namespace is: http://www.opengis.net/kml/2.2, but if you want to use another then you can use the -n/--namespace flag. The command with -n flag looks like this:
python extractData.py "C:\Users\User\Desktop\example.kml" -n "http://www.opengis.net/kml/2.2"

License

See LICENSE

Acknowledgements

SUBJECT AREA: Optimazation Algorithms
KEYWORDS: Python, KML, Data extraction, Transform coordinates to xyz

About

A kml data extraction script. Creates two csv: 1) with the placemaker's name and the latitude, longitude coordinates and 2) with the placemaker's name and the x,y,z coordinates.

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages