Reputation: 12005
Is there a way to get the KML file attached to this Google Map in JSON format instead of XML?:
I'm currently writing an app that needs to load this KML data. I would prefer that it's in JSON format. Is there a way of getting it in this format?
Upvotes: 7
Views: 16742
Reputation: 5879
I was trying to convert KML files to JSON and it was the most useful tool I found to do it programmatically
https://github.com/mapbox/togeojson#using-it-as-a-console-utility
It is with nodejs, you should do something like that in the cli
togeojson file.kml > file.geojson
Then, you can pass it into a json quite easy
Anyway, hope this help
Upvotes: 3
Reputation: 9564
Since KML is just a flavor of XML, you could use any XML to JSON converter, of which there are many.
Here's one that's been around for a few years: http://www.thomasfrank.se/xml_to_json.html
Upvotes: 7