Take the 2-minute tour ×
Geographic Information Systems Stack Exchange is a question and answer site for cartographers, geographers and GIS professionals. It's 100% free, no registration required.

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.

Thanks...

EDIT QUESTION

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.

share|improve this question

2 Answers 2

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).

share|improve this answer
    
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 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 at 15:39
    
Thank you. We are close. –  Ryan Garnett Feb 6 at 15:55

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.

share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

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