sketchucation logo sketchucation
    • Login
    ℹ️ Licensed Extensions | FredoBatch, ElevationProfile, FredoSketch, LayOps, MatSim and Pic2Shape will require license from Sept 1st More Info

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

    Scheduled Pinned Locked Moved Plugins
    137 Posts 49 Posters 124.4k Views 49 Watching
    Loading More Posts
    • Oldest to Newest
    • Newest to Oldest
    • Most Votes
    Reply
    • Reply as topic
    Log in to reply
    This topic has been deleted. Only users with topic management privileges can see it.
    • A Offline
      Aerilius
      last edited by

      Hi,
      I found the problem and fixed it. Thanks for attaching the file with which the problem occured.

      Importing big kml files can be slow because they are in xml format and there is no efficient way in SketchUp/Ruby to do it faster. I think shapefiles are in a binary format, so if there is a direct importer it could be faster.

      1 Reply Last reply Reply Quote 0
      • D Offline
        dawrightau
        last edited by

        Hi Aerilius,

        Thanks for getting back to me.

        Glad you were able to fix it but how do I get access to the fix?

        I checked the plugin download site and the date of the download plugin file is

           3/07/2011 7:05 PM
        

        Be grateful to get this working.

        Thanks again.

        Cheers

        David

        1 Reply Last reply Reply Quote 0
        • A Offline
          Aerilius
          last edited by

          Hi,
          the first post of this thread has version 1.4.9 (29.04.2012). If it is also distributed on another site, then I don't have access to update it there.

          1 Reply Last reply Reply Quote 0
          • D Offline
            dawrightau
            last edited by

            Thanks Aerilus,

            The update worked perfectly and immediately (essentially no delay).

            For some reason I thought the official site was http://extendsketchup.com/plugins/kml-tools/

            The logical spot as you say was at the beginning of this forum.

            Thanks again.

            Kind regards

            David Wright

            1 Reply Last reply Reply Quote 0
            • U Offline
              ulisessol7
              last edited by

              @aerilius said:

              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.

              just wanted to say thank you so much for making this tool available

              cheers from Mexico

              1 Reply Last reply Reply Quote 0
              • GaieusG Offline
                Gaieus
                last edited by

                @ulisessol7 said:

                just wanted to say thank you so much for making this tool available...

                👍

                Gai...

                1 Reply Last reply Reply Quote 0
                • D Offline
                  dawrightau
                  last edited by

                  Hi Again Aerilus

                  The plugin is working fine for some kml files but for some reason inst working with others.

                  The ones that work have elevation data generated when they are created.

                  I tried importing a simple kml file with no elevation data and I get a white dialog box progress and no progress (please see hayrack boundary.kml)

                  I added 10 m vertices to the polygon and added elevation data to them and now get a dialog box with 50% progress where it stops (please see hayrack boundary with elevation.kml)

                  Any assistance would be appreciated.

                  Regards

                  David

                  @dawrightau said:

                  Thanks Aerilus,

                  The update worked perfectly and immediately (essentially no delay).

                  For some reason I thought the official site was http://extendsketchup.com/plugins/kml-tools/

                  The logical spot as you say was at the beginning of this forum.

                  Thanks again.

                  Kind regards

                  David Wright


                  Hayrack Boundary.KML


                  Hayrack Boundary with Elevation.KML

                  1 Reply Last reply Reply Quote 0
                  • thomthomT Offline
                    thomthom
                    last edited by

                    I got an KML file I'm trying to import, but I'm getting errors:

                    
                    fetching elevation from url; http://api.geonames.org/astergdemJSON?formatted=true&lat=63.430509&lng=10.395091&username=aerilius&style=full&callback=returnJson
                    kmlImport.rb; geonames returned 6
                    Error; #<NoMethodError; undefined method `[]' for nil;NilClass>
                    C;/Program Files (x86)/Google/Google SketchUp 8/Plugins/kmlTools/kmlImport.rb;758;in `points_to_plane'
                    C;/Program Files (x86)/Google/Google SketchUp 8/Plugins/kmlTools/kmlImport.rb;758;in `each'
                    C;/Program Files (x86)/Google/Google SketchUp 8/Plugins/kmlTools/kmlImport.rb;758;in `points_to_plane'
                    C;/Program Files (x86)/Google/Google SketchUp 8/Plugins/kmlTools/kmlImport.rb;327;in `polygon'
                    C;/Program Files (x86)/Google/Google SketchUp 8/Plugins/kmlTools/kmlImport.rb;195;in `run2'
                    C;/Program Files (x86)/Google/Google SketchUp 8/Plugins/kmlTools/kmlImport.rb;655;in `eachp'
                    (eval);155;in `each_with_index'
                    C;/Program Files (x86)/Google/Google SketchUp 8/Plugins/kmlTools/kmlImport.rb;653;in `each'
                    C;/Program Files (x86)/Google/Google SketchUp 8/Plugins/kmlTools/kmlImport.rb;653;in `each_with_index'
                    C;/Program Files (x86)/Google/Google SketchUp 8/Plugins/kmlTools/kmlImport.rb;653;in `eachp'
                    C;/Program Files (x86)/Google/Google SketchUp 8/Plugins/kmlTools/kmlImport.rb;195;in `run2'
                    C;/Program Files (x86)/Google/Google SketchUp 8/Plugins/kmlTools/kmlImport.rb;175;in `each'
                    C;/Program Files (x86)/Google/Google SketchUp 8/Plugins/kmlTools/kmlImport.rb;175;in `run2'
                    C;/Program Files (x86)/Google/Google SketchUp 8/Plugins/kmlTools/kmlImport.rb;151;in `fetch_alt'
                    
                    

                    Thomas Thomassen — SketchUp Monkey & Coding addict
                    List of my plugins and link to the CookieWare fund

                    1 Reply Last reply Reply Quote 0
                    • A Offline
                      Aerilius
                      last edited by

                      This plugin is unfortunately very error-prone because it was my second plugin and it uses RegExps to parse xml (I hope I find a better way to handle xml, rexml didn't prove to perform better). I'll take a look at this whern I'm at home!

                      1 Reply Last reply Reply Quote 0
                      • thomthomT Offline
                        thomthom
                        last edited by

                        You're using a webdialog for the import - you can use the XML parsing capabilities of the web-browser:
                        http://www.w3schools.com/xml/xml_parser.asp

                        If you use jQuery it's very simple:
                        http://stackoverflow.com/questions/649614/xml-parsing-in-javascript

                        Thomas Thomassen — SketchUp Monkey & Coding addict
                        List of my plugins and link to the CookieWare fund

                        1 Reply Last reply Reply Quote 0
                        • A Offline
                          Aerilius
                          last edited by

                          That sounds interesting. Javascript isn't the fastest either, but this strategy probably doesn't use the script language's string functions but the browser's compiled code.
                          I once ported the plugin (partly) to ReXML and ran performace tests (more reliable but 107% slower, ReXML is pure Ruby and I wanted to avoid gems). So I'll try it with this again.

                          1 Reply Last reply Reply Quote 0
                          • thomthomT Offline
                            thomthom
                            last edited by

                            ReXML is one of the slowest XML solutions - but as you mention it's pure Ruby. The others require some binaries. I want a Ruby parser because some times I don't have a WebDialog UI for plugins that has use of XML.

                            Thomas Thomassen — SketchUp Monkey & Coding addict
                            List of my plugins and link to the CookieWare fund

                            1 Reply Last reply Reply Quote 0
                            • A Offline
                              Aerilius
                              last edited by

                              @dawrightau said:

                              The plugin is working fine for some kml files but for some reason inst working with others.

                              Hi David,
                              I tried both files in a non-geolocated model and in a geolocated model (with terrain) and they both work for me (plugin version 1.4.6). I have no idea what could go wrong. When you open the Ruby Console before running th plugin, do there appear some error messages?


                              with terrain

                              1 Reply Last reply Reply Quote 0
                              • A Offline
                                Aerilius
                                last edited by

                                @thomthom said:

                                I got an KML file I'm trying to import, but I'm getting errors

                                I'm not sure what causes this problem. It looks like one point of a polygon could not be parsed (nil) or a polygon has less than 3 points. Off the bat I would have tried:

                                while a.length > 3 # replace line 754
                                
                                return if outerLoop.length < 3 # insert after line 311
                                
                                1 Reply Last reply Reply Quote 0
                                • D Offline
                                  dawrightau
                                  last edited by

                                  Thanks for getting back to me Aerilius,

                                  I am using 1.4.9 being the version you updated to fix the part loading issue of mine in a previous post.

                                  There is an error in the ruby console. This is the ruby console messages for the harack boundary file :

                                  fetching elevation from url: http://api.geonames.org/astergdemJSON?formatted=true&lat=-30.4077328499&lng=152.0265933208&username=aerilius&style=full&callback=returnJson
                                  kmlImport.rb: geonames returned 1098
                                  Error: #<NoMethodError: undefined method remove' for #<Sketchup::Materials:0xbfba0e4>> C:/Program Files/Google/Google SketchUp 8/Plugins/kmlTools/kmlImport.rb:740:in color_to_su'
                                  C:/Program Files/Google/Google SketchUp 8/Plugins/kmlTools/kmlImport.rb:738:in each' C:/Program Files/Google/Google SketchUp 8/Plugins/kmlTools/kmlImport.rb:738:in color_to_su'
                                  C:/Program Files/Google/Google SketchUp 8/Plugins/kmlTools/kmlImport.rb:607:in style' C:/Program Files/Google/Google SketchUp 8/Plugins/kmlTools/kmlImport.rb:170:in run2'
                                  C:/Program Files/Google/Google SketchUp 8/Plugins/kmlTools/kmlImport.rb:655:in eachp' (eval):48:in each_with_index'
                                  C:/Program Files/Google/Google SketchUp 8/Plugins/kmlTools/kmlImport.rb:653:in each' C:/Program Files/Google/Google SketchUp 8/Plugins/kmlTools/kmlImport.rb:653:in each_with_index'
                                  C:/Program Files/Google/Google SketchUp 8/Plugins/kmlTools/kmlImport.rb:653:in eachp' C:/Program Files/Google/Google SketchUp 8/Plugins/kmlTools/kmlImport.rb:170:in run2'
                                  C:/Program Files/Google/Google SketchUp 8/Plugins/kmlTools/kmlImport.rb:151:in fetch_alt' C:/Program Files/Google/Google SketchUp 8/Plugins/enjshape/shapes.rb:48:in call'
                                  C:/Program Files/Google/Google SketchUp 8/Plugins/enjshape/shapes.rb:48

                                  This is the ruby console message for the other file :

                                  fetching elevation from url: http://api.geonames.org/astergdemJSON?formatted=true&lat=-30.40773285&lng=152.026593321&username=aerilius&style=full&callback=returnJson
                                  kmlImport.rb: geonames returned 1098
                                  Error: #<NoMethodError: undefined method remove' for #<Sketchup::Materials:0xc11d030>> C:/Program Files/Google/Google SketchUp 8/Plugins/kmlTools/kmlImport.rb:740:in color_to_su'
                                  C:/Program Files/Google/Google SketchUp 8/Plugins/kmlTools/kmlImport.rb:738:in each' C:/Program Files/Google/Google SketchUp 8/Plugins/kmlTools/kmlImport.rb:738:in color_to_su'
                                  C:/Program Files/Google/Google SketchUp 8/Plugins/kmlTools/kmlImport.rb:607:in style' C:/Program Files/Google/Google SketchUp 8/Plugins/kmlTools/kmlImport.rb:170:in run2'
                                  C:/Program Files/Google/Google SketchUp 8/Plugins/kmlTools/kmlImport.rb:655:in eachp' (eval):740:in each_with_index'
                                  C:/Program Files/Google/Google SketchUp 8/Plugins/kmlTools/kmlImport.rb:653:in each' C:/Program Files/Google/Google SketchUp 8/Plugins/kmlTools/kmlImport.rb:653:in each_with_index'
                                  C:/Program Files/Google/Google SketchUp 8/Plugins/kmlTools/kmlImport.rb:653:in eachp' C:/Program Files/Google/Google SketchUp 8/Plugins/kmlTools/kmlImport.rb:170:in run2'
                                  C:/Program Files/Google/Google SketchUp 8/Plugins/kmlTools/kmlImport.rb:151:in fetch_alt' C:/Program Files/Google/Google SketchUp 8/Plugins/kmlTools/kmlImport.rb:740:in call'
                                  C:/Program Files/Google/Google SketchUp 8/Plugins/kmlTools/kmlImport.rb:740

                                  Hope this helps nut it out.

                                  Regards

                                  David

                                  @aerilius said:

                                  @dawrightau said:

                                  The plugin is working fine for some kml files but for some reason inst working with others.

                                  Hi David,
                                  I tried both files in a non-geolocated model and in a geolocated model (with terrain) and they both work for me (plugin version 1.4.6). I have no idea what could go wrong. When you open the Ruby Console before running th plugin, do there appear some error messages?

                                  1 Reply Last reply Reply Quote 0
                                  • D Offline
                                    dawrightau
                                    last edited by

                                    Also a question

                                    When one kml file (that imports ok) has been imported it is not possible to import another. A new instance of sketchup has to be opened to use the tool again.

                                    Is this how it is or should I be able to import multiple kml files, one after another?

                                    Thanks

                                    [quote="dawrightau"]Thanks for getting back to me Aerilius,

                                    I am using 1.4.9 being the version you updated to fix the part loading issue of mine in a previous post.

                                    1 Reply Last reply Reply Quote 0
                                    • A Offline
                                      Aerilius
                                      last edited by

                                      @dawrightau said:

                                      When one kml file (that imports ok) has been imported it is not possible to import another.

                                      This should not happen, one should be able to import any amount of kml files ninto the same model.

                                      I think I found the issue and have almost fixed it (I will finish and release an update this evening).

                                      1 Reply Last reply Reply Quote 0
                                      • A Offline
                                        Aerilius
                                        last edited by

                                        I uploaded a new version!

                                        1 Reply Last reply Reply Quote 0
                                        • D Offline
                                          dawrightau
                                          last edited by

                                          Thanks very much Aerilius I will give it a try.

                                          Regards

                                          David

                                          1 Reply Last reply Reply Quote 0
                                          • D Offline
                                            dawrightau
                                            last edited by

                                            Hi Aerilius,

                                            Billiant thank you.

                                            Just to let you know that I could import both kml files into the one session, both geolocted correctly.

                                            Regards

                                            David

                                            1 Reply Last reply Reply Quote 0
                                            • 1
                                            • 2
                                            • 3
                                            • 4
                                            • 5
                                            • 6
                                            • 7
                                            • 5 / 7
                                            • First post
                                              Last post
                                            Buy SketchPlus
                                            Buy SUbD
                                            Buy WrapR
                                            Buy eBook
                                            Buy Modelur
                                            Buy Vertex Tools
                                            Buy SketchCuisine
                                            Buy FormFonts

                                            Advertisement