Import, then convert .kmz files to .dae?

My workflow:

-I have created flat (X and Y axis), geo-referenced 2D shape-files (.shp) in a program called Pix4D.

-I import these shape-files into Google Earth and give them height (Z axis) during import. They import easily, and land in the exact geo-location I expect them to. They are now basically 3 dimensional obelisks.

-Somehow I need to convert these obelisks into Collada (.dae) files, so that they can be imported into a program (PVSyst) that can import .dae, but not .kmz.

I’m a bit of a beginner at much of this, and could use some help and suggestions.

MUCH APPRECIATED !

-John

I should add that I’ve tried doing a straight import of the .kmz files into Sketchup, and I get the error message: “import failed.”

-John

If I recall rightly a KMZ is really a ZIP file with another suffix.
Inside it is a DAE file inside a ‘models’ or ‘files’ subfolder.
Look in there and see what you have.
Extract the DAE file and any related images etc…
See if those work…

1 Like

I actually did try that, but got the same error message.

As @TIG wrote, a kmz file is actually a zipped archive that can contain multiple files of several types. Of these, SketchUp only knows how to import collada (dae). But Google Earth exports geometry only as Keyhole Markup Language (kml), it does not generate collada. You can unzip the kmz and examine the contents. If there is no dae, only kml, SketchUp is going to fail to import the kmz file and you won’t be able to use SketchUp as a kmz to dae converter for it. In fact, it would be a silly exercise if the dae already exists inside the kmz!

There have been a few attempts to implement a kml importer extension for SketchUp (including one of mine, and one by @Aerilius) but so far as I know none is 100% complete or officially published. If you are able to share a sample kmz, I’d be willing to see what my prototype importer makes of it. Since I have no need for it, I’ve never searched to see if there is a direct kml to dae converter independent of SketchUp.

For the technically-minded, kml works in geodetic lat, lon, height coordinates so it is inherently geolocated. That makes it a natural fit for Google Earth. Collada works in Cartesian x,y,z coordinates that need external geolocation information to map them to lat,lon,height. When it contains a dae file, a kmz also includes this geolocation information so that Google Earth will know how to map the model.

The one-way relationship between SketchUp and GE arose when Google bought SketchUp to allow users to create 3D buildings and import them to GE. They didn’t see any need to go the other way, e.g. to import native GE placemarks or other kml geometry into SketchUp, especially as some kml features depend on GE terrain also being available. So they didn’t make a kml importer for SketchUp. Google moved on to other ways of handling 3D buildings and then sold SketchUp to Trimble some years ago.

Trimble hasn’t seen kml import as a pressing need either and a couple of years ago Google terminated the arrangement by which SketchUp could import terrain and imagery from Google Earth and Google Maps. That adds additional problems, as SketchUp’s replacement source for terrain doesn’t exactly match Google’s data. Elements that depend on terrain won’t usually import correctly.

That is wonderfully helpful info, thank you! I like learning the back story.

So it sounds like it probably isn’t possible to do things quite the way I am going about it.

Another option for me would be to skip Google Earth altogether, and import those 2-dimensional surface shape files into some sort of format that Sketchup can import, and then manually push/pull them into three-dimensional structures, giving them the correct height. I just need to make sure that they maintain their original latitude/longitude information.

Any suggestions on a straightforward way to do this ?

Thank you very much in advance for your time!

John

I think there’s a free KML to DXF converter online - search.
Then you can Import that DXF into SketchUp…
If you maintain the CAD file’s origin in Options it should import properly - however, having entities miles away from the SketchUp origin is known to cause other issues !

1 Like

Hi ! I’ll attach one of the .KMZ files that I’m trying to import into sketchup. Maybe it will provide some insight as to a workaround I can use.

To explain my goals:
I’m using drone photos with Pix4D to make a 3D polygon representation of the heights of a treeline around a solar panel field. My end goal is to turn these into DAE files to be able to be imported into a client’s software (PVSyst). So I’m making geo-referenced rectangles in Pix4D at the edge of the treeline, and exporting them. Pix 4D can’t export the height (Z axis) so that’s why I’m importing them into Google Earth, which will let me create the height of the polygon. And that part seems to work perfectly. I just can’t figure out how to get them converted from there to DAE files.

Another option is for me to export the point cloud (which is exportable as .las or .laz or .ply or .xyz files), into some program that can handle it, and just measure and create the polygons there. And then convert them into DAE files.

I can’t seem, to get a point cloud or mesh into Sketchup though.

There must be some way, and some program that can do this. But I am not sure of all my options.

-John

Kiawah Export 21_surfaces.kml (694 Bytes)
Kiawah Export 21_vertices.kml (762 Bytes)

KML is a very diverse and broad format with too many specialized use cases.

The problems for importer extensions are:

  • There is no one-to-one feature mapping between KML and SketchUp entities. An importer extension must either limit itself and define one mapping or provide almost infinite choices to the user. Your KML file uses KML Polygons, whereas another user may have KML Tracks that look identically. Another user using an importer that works for you would complain that it does not work for their use case.

  • KML primitives can set simple attributes to define complex features that are hard to reproduce exactly in SketchUp (extrusion requires computing a lot of geometry, tessellation requires exactly same terrain and more complex algorithms).

How much to support?

Is it worth the maintenance effort if it is unknown who actually uses it? (see my KML Tools, if someone has fun to maintain or rewrite them)

Google Earth has been discontinued by Google (but still downloadable), so it has no future. Only subsets of the KML file format are commonly used by other softwares (for which people would better use gpx etc.), but for claiming to support KML, an importer would be expected to support all of them (?).

1 Like

Please see your Private Messages for more from me.

The fantastic KML tools might solve my problem. I installed therefore the previous SU 2013.
Unfortunately I was prompted with the error message “File seems not exist, …” while importing a kml polygon created in Google Earth.
It would wonderful, if I could import a GE created polygon (kmz, kml) to SU and reimport the kmz file (dae) back to GE. Attached there is the error message and the kml file from Google Earth.
I would be very grateful, if there is any idea to challenge this.doc.kml (2.0 KB)