gis on davidchua https://dchua.com/tags/gis/ Recent content in gis on davidchua Hugo -- gohugo.io en-us Thu, 31 Mar 2016 00:00:00 +0000 Converting KML into GeoJSON for Mongoimport & Querying https://dchua.com/posts/2016-03-31-converting-kml-into-geojson-for-mongoimport/ Thu, 31 Mar 2016 00:00:00 +0000 https://dchua.com/posts/2016-03-31-converting-kml-into-geojson-for-mongoimport/ First, you need to install kml2geojson. Luckily, there’s pip. $ pip install kml2geojson Once that’s done, you can take a .kml file and convert it into a GeoJSON format. Why GeoJSON? Because its gaining in support (MongoDB, RethinkDB) and has lots of smart people working on its specification. $ kml2geojson <.kml> <output_path> Now if you’re looking to import the geoJSON data into MongoDB so that you can do geospatial queries, you’ll need to prepare the GeoJSON file for import so that MongoDB will create multiple documents rather than a single document of your geo-objects.