[Plugin] KML Tools (2.0.0-beta) — updated 31.05.2013

[Plugin] KML Tools (2.0.0-beta) — updated 31.05.2013

Postby Aerilius » Wed Jun 15, 2011 11:15 pm

This Plugin allows to import and export KML files (Keyhole Markup Language) into Sketchup. SketchUp's current capabilities of KMZ do not go beyond Collada models. These tools fill this wide gap and make it possible to bring almost any feature from Google Earth to SketchUp and back.

Warning: This is not actively developed until I get time to actively develop it. Any type of contributions welcome!

ae_KMLTools_2.0.0-beta.rbz

It is intended to be a bridge between Google Earth and SketchUp for people who need it, but it does not want to be a full-fledged KML editor since Google Earth itself has a very capable integrated editor.
Many geo information agencies provide geo-referenced data like building footprints or ground overlays in KML format, and most GPS devices create tracks in KML format that can be used as a basis for modeling. On the other side, it's now also easier to create and edit animated content for Google Earth.

Stable version:
kmlTools_1_4_12.rbz


Version: 1.4.12

Date: 25.05.2013

Requirements:
SketchUp 7.0 – SketchUp 2013 (not SketchUp 2014)
Dynamic Components enabled

Supported features:
<Model>, <Multigeometry>, <Polygon>, <LineString>, <gx:Track>, <Point>, <GroundOverlay>, <PhotoOverlay> (only GE→SU), <Camera>, <LookAt>, <gx:Tour>, <TimeSpan>

Usage:
Plugins → KML Tools → Import KML File
If you have a KMZ file (zipped KML), unzip it first. The importer cannot download files, so all ressources must be available locally and network links will be ignored. The result can be more accurate if you first import a big enough Google Earth Terrain via 'File → Geo-Location → Add Location'. Unfortunately KML files larger than ~200 kB can take very long to import.

Either select specific groups/components to export or export all:
Plugins → KML Tools → Export KML File
The model must be georeferenced first, it is also beneficial to have a Google Earth Terrain ('File → Geo-Location → Add Location'). For each feature entities should be grouped, but groups should not be nested. A dialog will pop up which shows as which features the entities in the model can be exported. The resulting KML file (and its accompanying folder) can be loaded into Google Earth, tweaked, enhanced and saved as a single KMZ file.
exportoptions.jpg


Plugins → KML Tools → Add Timespan to entities
Allows to add/edit timespan attributes. These attributes are used for example by the Google Earth timeslider. This allows to animate building structures over time (historic or future state). Select groups or components and choose a begin and end date (or type the date in this format: yyyy-mm-ddThh:mm). 'Preview' will open a simple time slider to preview the changes.

GE-SU.jpg

History:
version 1.4.12: 25.05.2013
- small change for comatibility with SketchUp 2013
version 1.4.11: 21.07.2012
- fixed support for pairs of 2 instead of 3 coordinates
version 1.4.10: 01.06.2012
- fixed materials.remove that is only available in SU8M1+
- fixed empty points in polygon import
version 1.4.9: 29.04.2012
- fixed hangup when importing linestrings
version 1.4.8: 09.02.2012
- fixed broken filepath with component export
- fixed orientation of components (reversed tilt angle)
version 1.4.6: 02.02.2012
- fixes for round_to method
version 1.4.5: 28.01.2012
- fixes for elevation import
version 1.4: 10.09.2011 Note: Delete old "kmlTools_loader.rb"
- various fixes (hang at styles import)
- support of <StyleMap> added
- registered as SketchupExtension
- registered as importer (now available in 'File' -> 'Import'...)
version 1.3b: 22.07.2011
- various fixes in timeslider and timespan dialog
- fix in kmlImport to remove nil elements from array (line 737 etc.)
version 1.2: 22.06.2011
- time slider added
- dependency on IE8 removed
- typos fixed
version 1.1: 16.06.2011
- groundoverlay: texturewriter doesn't distort images anymore
- wrong date in date picker on Windows fixed
- errors in older SU versions fixed
version 1.0: 15.06.2011
4
Last edited by Aerilius on Wed Mar 12, 2014 3:03 pm, edited 28 times in total.

Aerilius 
PluginStore Author
PluginStore Author
 

Re: [Plugin] KML Tools - Importer and Exporter

Postby pilou » Wed Jun 15, 2011 11:18 pm

Cool work! :thumb:
0
Frenchy Pilou
Is beautiful that please without concept!
Speedy Galerie
User avatar
pilou 
Top SketchUcator
 

Re: [Plugin] KML Tools - Importer and Exporter

Postby lexmonteiro » Thu Jun 16, 2011 2:05 pm

First I would like to thank you for the plugin, will be very useful! :berserk:
I try to make it work in SU 7.1 and 8 (both free) but when I try to import a kml it stops on "progress " Fetching elevation data from ...
I click in ... and nothing happens, can you help me? I do not know if the problem may be related to my default browser that is Google Chrome... :?: :?:
0

lexmonteiro 
 

Re: [Plugin] KML Tools - Importer and Exporter

Postby Aerilius » Thu Jun 16, 2011 8:09 pm

Hello lexmonteiro,
the default browser doesn't matter because SketchUp always uses the operating systems browser (IE/Safari) ;) .

That error could mean that the webdialog didn't receive commands from SketchUp. Can you please try it with the new version again? If it doesn't work, can you open the Ruby console while running the plugin and post what you it says?
0

Aerilius 
PluginStore Author
PluginStore Author
 

Re: [Plugin] KML Tools - Importer and Exporter

Postby lexmonteiro » Fri Jun 17, 2011 7:21 pm

Aerilius wrote:Hello lexmonteiro,
the default browser doesn't matter because SketchUp always uses the operating systems browser (IE/Safari) ;) .

That error could mean that the webdialog didn't receive commands from SketchUp. Can you please try it with the new version again? If it doesn't work, can you open the Ruby console while running the plugin and post what you it says?



I try it, and got some progress, but it stucks in the next screem:
0

lexmonteiro 
 

Re: [Plugin] KML Tools - Importer and Exporter

Postby Aerilius » Fri Jun 17, 2011 9:11 pm

I cannot reproduce the problem. Are you using an older browser than Internet Explorer 8 (it needs version 8)?
If it happens although you have IE8/IE9, maybe you can eventually PM me the kml file?
0

Aerilius 
PluginStore Author
PluginStore Author
 

Re: [Plugin] KML Tools - Importer and Exporter

Postby Gaieus » Sat Jun 18, 2011 8:00 am

:thumb: :thumb: :thumb:

Great, thanks Aerilius! I am pretty sure this will be an invaluable tool for many people!
0
User avatar
Gaieus 
 

Re: [Plugin] KML Tools - Importer and Exporter

Postby bilianb » Mon Jun 20, 2011 9:31 am

Hi
Greetings from Bulgaria

i receive error on line 840: @model.pages.eachp - no method eachp for Sketchup::Pages.
It works with @model.pages.each

Have a nice day
0

bilianb 
 

Re: [Plugin] KML Tools - Importer and Exporter

Postby Pixero » Tue Jun 21, 2011 8:24 am

I have the same problem as lexmonteiro (above).
IE 8 Windows 7 64bit. SketchUp 8 Pro.
0
User avatar
Pixero 
Premium Member
Premium Member
 

Re: [Plugin] KML Tools - Importer and Exporter

Postby lexmonteiro » Tue Jun 21, 2011 12:44 pm

Aerilius wrote:I cannot reproduce the problem. Are you using an older browser than Internet Explorer 8 (it needs version 8)?
If it happens although you have IE8/IE9, maybe you can eventually PM me the kml file?

:oops: You're right, I'm using a previous version (IE7).
I've been using Google Chrome for so long that not even remember which version IE I was using ..
I'll update it and then put the results here.
Thank you!
0

lexmonteiro 
 

Re: [Plugin] KML Tools - Importer and Exporter

Postby Aerilius » Wed Jun 22, 2011 6:50 pm

I had done more than a week testing and hadn't imagined that there still could be such issues.
Now I've uploaded a new version. I found a work-around to drop the IE8 requirement and fixed some more things. I hope it works this time.
0

Aerilius 
PluginStore Author
PluginStore Author
 

Re: [Plugin] KML Tools - Importer and Exporter

Postby lexmonteiro » Mon Jun 27, 2011 2:44 pm

:berserk: It works fine now, ie7 and SU 7.1 free!

Thank you! :thumb:
0

lexmonteiro 
 

Re: [Plugin] KML Tools - Importer and Exporter

Postby Tobobo » Tue Jul 05, 2011 10:50 am

Thanks very much :berserk:
0
Toby

Philippians 4:13

I can do everything through him who gives me strength.
User avatar
Tobobo 
 

Re: [Plugin] KML Tools - Importer and Exporter

Postby BillB1 » Thu Jul 07, 2011 7:52 pm

Hi there Aerilius.

You say
it's now also easier to create and edit animated content for Google Earth

and I see there is a timespan option on the menu. Can you explain what this does and an example of how to use it?

Thanks
0

BillB1 
 

Re: [Plugin] KML Tools - Importer and Exporter

Postby 3dworks » Fri Jul 15, 2011 12:01 pm

is this working with SU version 8 on mac or is there another solution in the meantime? what i'm missing in SU 8 is the ability to batch capture a sequence of aligned terrains. the frame tool in SU8 is making a manual selection of an area around an already captured terrain very difficult. anyone?

cheers

markus
0

3dworks 
 

Re: [Plugin] KML Tools - Importer and Exporter

Postby marktonium » Mon Jul 18, 2011 10:24 pm

Might be a silly question, but here it goes.

Is it possible to completely remove the entire process of downloading elevation data? I do not need it, as I am using the drape tool with the files, and can manually georeference the KML files.

I've tried deleting that portion of the code, but I know nothing about Ruby, so I really don't know what I'm doing.

Thanks.

This tool is exactly what I needed by the way, thanks for the development!
0

marktonium 
 

Re: [Plugin] KML Tools - Importer and Exporter

Postby Aerilius » Tue Jul 19, 2011 12:45 pm

I think it should assume an elevation of 0 if it can't connect to the internet. So you could disconnect from the internet and after using the tool you can reconnect again. Tell me if that solves it ;-)
0

Aerilius 
PluginStore Author
PluginStore Author
 

Re: [Plugin] KML Tools - Importer and Exporter

Postby marktonium » Tue Jul 19, 2011 6:19 pm

Looks like that part of the script is working now (I re-downloaded the files, maybe they were/are corrupted for me).

I am getting the following error now, though:

no JSON returned (which I'm expecting)
Error: #<NoMethodError: undefined method `[]' for nil:NilClass>
...kmlTools/kmlImport.rb:737:in `points_to_plane'
...kmlTools/kmlImport.rb:737:in `each'
...kmlTools/kmlImport.rb:737:in `points_to_plane'
...kmlTools/kmlImport.rb:320:in `polygon'
...kmlTools/kmlImport.rb:205:in `run2'
...kmlTools/kmlImport.rb:205:in `eachp'
...kmlTools/kmlImport.rb:632:in `each_with_index'
...kmlTools/kmlImport.rb:632:in `each'
...kmlTools/kmlImport.rb:632:in `each_with_index'
...kmlTools/kmlImport.rb:632:in `each'
...kmlTools/kmlImport.rb:205:in `run2'
...kmlTools/kmlImport.rb:176:in `each'
...kmlTools/kmlImport.rb:176:in `run2'
...kmlTools/kmlImport.rb:114:in `fetch_alt'
...kmlTools/kmlImport.rb:109:in `call'

Thanks again.

Mark
0

marktonium 
 

Re: [Plugin] KML Tools - Importer and Exporter

Postby Aerilius » Fri Jul 22, 2011 3:44 pm

marktonium wrote:I am getting the following error now, though:

Hi Mark,
I have fixed something that could have caused this error in line 737. After reading the kml file, the plugin could have come across some unexpected (empty) elements. Can you check if it works now?
0

Aerilius 
PluginStore Author
PluginStore Author
 

Re: [Plugin] KML Tools - Importer and Exporter

Postby Aerilius » Fri Jul 22, 2011 3:53 pm

3dworks wrote:is this working with SU version 8 on mac or is there another solution in the meantime?

Hi 3dworks,
It is not yet tested on mac, but it shouldn't contain anything specific that doesn't work on both platforms.
3dworks wrote:[...] the ability to batch capture a sequence of aligned terrains.

That's probably not in the scope of this plugin, but it's a question that many people ask. Technically it is not possible to do the batch part automatically (because one had to interfere with the Add location tool in a way that is impossible), but one could imagine a tool that helps to perfectly align the selection rectangle to the previous terrain.
0

Aerilius 
PluginStore Author
PluginStore Author
 

Re: [Plugin] KML Tools - Importer and Exporter

Postby ccreynol » Fri Jul 22, 2011 5:39 pm

It is hanging up on the "importing styles" when I try to import a Google Earth made .kml file, any thoughts? Your previous tool worked fine to import a simple ground tracing from a Google Earth .kmz file, is this new tool any improvement for this simple function? Thanks!
0

ccreynol 
 

Re: [Plugin] KML Tools - Importer and Exporter

Postby Aerilius » Fri Jul 29, 2011 1:21 pm

Hi,
the importing will probably be the problematic part of KML Tools because there is no simple and clean way in ruby to parse xml files and because kml files can occur in many different kinds.
If you open the ruby console before starting the import, can you send me the error message (first lines of the error)? Or you can pm me the kml file so that it's easier to find the cause of the problem.

If you refer to the KML linestring importer, this tool here is not limited to only "linestrings" but it's also ways more complex. So the simple tool is not a bad choice if it does the job sufficiently.
0

Aerilius 
PluginStore Author
PluginStore Author
 

Re: [Plugin] KML Tools - Importer and Exporter

Postby ccreynol » Fri Aug 12, 2011 10:35 pm

Why does this not work on international locations? My shapes are imported at strange sizes, occasionally with angles changed as well. Thoughts?
0

ccreynol 
 

Re: [Plugin] KML Tools - Importer and Exporter

Postby Gaieus » Fri Aug 12, 2011 10:51 pm

What do you mean by "international locations"? (Are there "national locations"? :? )
0
User avatar
Gaieus 
 

Re: [Plugin] KML Tools - Importer and Exporter

Postby thomthom » Mon Aug 22, 2011 10:18 am

I've been looking around at the various ruby based importers for SketchUp and I see that no one uses the Importer class. If this class is used the importer can be found in the native import list which would be very nice.
http://code.google.com/apis/sketchup/do ... orter.html
0
Thomas Thomassen — SketchUp Monkey & Coding addict
List of my plugins and link to the CookieWare fund
User avatar
thomthom 
PluginStore Author
PluginStore Author
 

Re: [Plugin] KML Tools - Importer and Exporter

Postby Aerilius » Mon Aug 22, 2011 12:56 pm

ccreynol wrote:My shapes are imported at strange sizes, occasionally with angles changed as well. Thoughts?

If you can tell me more details and send me an example file that does not work as expected, I can have a look at it. SketchUp documents can only cover an area of some kilometers, so one shouldn't import too distant places, otherwise SketchUp behaves very weird (navigation won't work properly, clipping occurs and shapes can look strange).
0

Aerilius 
PluginStore Author
PluginStore Author
 

Re: [Plugin] KML Tools - Importer and Exporter

Postby Aerilius » Mon Aug 22, 2011 1:03 pm

thomthom wrote:Importer class

I had looked at it, but since no other plugin used it I had thought users would expect to find the importer in the Plugins menu. In general I like the idea of using existing standards, so I will add this in the next update. Especially that the Importer class also allows options dialogs (Importer.do_options) sounds promissing.
0

Aerilius 
PluginStore Author
PluginStore Author
 

Re: [Plugin] KML Tools - Importer and Exporter

Postby thomthom » Sat Sep 10, 2011 2:59 pm

I think the reason why no-one else has used it is because it's simply over-looked. Which is a pity as it'd help clean up the menus and integrates the ruby importers with the native ones.

(I kind of spammed the forum of the importers I could find... :oops: :D .. in an attempt to bring focus to this unused class. )
0
Thomas Thomassen — SketchUp Monkey & Coding addict
List of my plugins and link to the CookieWare fund
User avatar
thomthom 
PluginStore Author
PluginStore Author
 

Re: [Plugin] KML Tools (1.4) — updated 10.09.2010

Postby Jim » Sun Sep 11, 2011 2:17 am

But there isn't a corresponding exporter class. So if you did use the Importer class, the exporter would still need to go in the standard menus which would make the UI inconsistent.
0
Hi

Jim 
Global Moderator
 

Re: [Plugin] KML Tools (1.4) — updated 10.09.2010

Postby thomthom » Sun Sep 11, 2011 10:42 am

Jim wrote:But there isn't a corresponding exporter class. So if you did use the Importer class, the exporter would still need to go in the standard menus which would make the UI inconsistent.

True, this would do well as a feature request.
0
Thomas Thomassen — SketchUp Monkey & Coding addict
List of my plugins and link to the CookieWare fund
User avatar
thomthom 
PluginStore Author
PluginStore Author
 

SketchUcation One-Liner Adverts

by Ad Machine » 5 minutes ago



Ad Machine 
Robot
 

Next


 

Return to Plugins

Who is online

Users browsing this forum: atagharehshir, Google Bot, maximt, sketchy22, summerv31, thedaverman and 10 guests

Visit our sponsors: