I am curious if there is a way to export from a vector format (ie: shapefile for PostGIS table) to Collada (.dae). ogr2ogr will do to GML and KML, but not Collada. My preference is to use open source, where at all possible.



To add a little further, I am hoping to find a way to go directly from vector to Collada. Either with an existing tool, or building upon available libraries.


To export a vector to Collada, you can choose any free versions of SketchUp. I give you this link because here you can find a lot of versions, begining with 5. (I've tested only the following versions: 7, 8, and Make. The Make version has enabled the Pro version, for eight hours of work).

To be able to load your kml files in SketchUp, you may use the KML Tools plugin. (Also, you need to register yourself as a basic forum member, to be able to download this free plugin). I have used the beta version with no problems (ae_KMLTools_2.0.0-beta.rbz). just rename the rbz extension to zip and extract the archive content into the SketchUp plugin directory:

enter image description here

Now, I'm going back to QGIS to show you my vector layer:

enter image description here

Just wait a moment to save my layer as a kml file:

enter image description here

Ok, it's done! Please, open SketchUp and specify your location (otherwise your import will fail):

enter image description here

After grabbing your location is done you may begin the kml import:

enter image description here

You will see a lot of import options, just press OK, and choose the kml file to be imported. Wait until the import is done and you'll see a summary report:

enter image description here

Well, the kml import is finished and you may start the Collada export:

enter image description here

You may choose your desired options, press Ok and your dae it's ready!

enter image description here

Some considerations:

  • You must know that it is possible to import a shapefile from QGIS into SketchUp

  • Also, there is the possibility to import dxf in SketchUp

  • If using the first link I gave you in this post, you can download older SketchUp versions with dxf import embedded, removed from the current versions (I didn't test it).

  • Sorin thank you for the great explanation using SketchUp. I am very aware of this process, and we are building a shapefile importer for SU. I was hoping to find something that will directly write from vector to collada. – Ryan Garnett Feb 6 '14 at 15:15
  • I wish you good luck with your shapefile importer! I'm looking forward to hear news from this project! – Sorin Călinică Feb 6 '14 at 15:39
  • This workaround no longer works. There has to be some sort of FOSS tool that converts a 3D KMZ file into a Collada file. Any help? – MjonesGEO Aug 30 '16 at 21:21

There are plugins for importing KML into the FOSS 3D modelling package Blender (a GREAT piece of software by the way.) And Blender also exports to Collada, and has a python api. So you might be able to build something with those components.

The thing to watch out for is preserving coordinates though. Since Blender isn't explicitly a GIS, you'll have to make sure the coordinates look right along the way.

Blender: http://www.blender.org/

KML Plugin: http://wiki.blender.org/index.php/Extensions:2.4/Py/Scripts/Import/KMZ

Obviously this is still a pretty contrived method, even if it works. The smoothest would of course be something like GDAL, but with support for Collada and Shape.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.