Open Data: .KML conversion

After cleaning up my data set using SQL Queries I used an online CSV to KML converter to convert the data. While this converted fine it didn’t offer much customisation. After seeing the data set in Google Earth it was suggested that I change some settings in the KML for each pin. Since the converter I used was unable to do this I decided to pick up my earlier attempt at manually converting CSV to KML and go from there.

OpenDataImport

Originally I had been able to successfully import the .csv and store its data within a data structure. However I had run into some issues with condensing and sorting the information. This led to using SQL Queries as an alternative. Now that I have the data in the condensed format that I want it was relatively easy to write the second half of the program and convert the data structure into KML. In particular, I need to adjust the extrude and altitudeMode settings in KML. With these changed Google Earth will display the pin in the air based on altitude and draw a line down to its ground point.

OpenDataExport

The result:

OpenDataResultI did run into some minor errors with syntax at first, mostly accidentally adding spaces where there shouldn’t be any, and getting the Latitude and Longitude backwards in the KML, resulting in the pins being in the middle of the ocean.

Advertisements

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Google+ photo

You are commenting using your Google+ account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

w

Connecting to %s