[Plugin] KML Tools (2.0.0-beta) — updated 31.05.2013
-
Weird ?
I suggest you PM Aerilius... -
In case anyone is interest there is plugin for ARC GIS that allows contours to be exported to a KML file.
The KML can be imported into GEarth. And, using KML Tools, imported into SU. The GIS plugin has some nice features such as adding text labels or text with leaders to the KML file which KML Tools handles just fine. The text info comes from the elevation name assigned to a contour group (which is a nice "welded" polyline). With this particular KML no effort was made to optimize the segmentation of the polyline contours.
It took less than 5 minutes to generate the terrain mesh using the Sandbox Tool with my Cor7 PC.
I posted this here because the old ARCgis plugin on the SketchUp site (http://sketchup.google.com/intl/en/download/plugins.html) no longer works with SU7 and SU8. There is a "multipatch" function/workflow in GIS but the files created are huge and usually crash SU when attempting to import or error out. With KML Tools, SU has now regained some of the ability to handle GIS output.
If anyone is interested, I will try to find out the specifics of the GIS plugin used to create this KML.
-
Follow Up:
I've had issues with the KMT Tool export functions. I finally, did a complete re-installation of SU8. Aside from the default plugin installation, only the KML Tools were installed.
I found that Groups were ignored, but Components were not ... provided they were preselected. However, the KML of a component export could not be imported nor opened in Google Earth (Pro).
If nothing is selected then the export dialog did not display.
The selection of loose geometry works, but when imported into Google Earth, edges could be misplaced. For example, a one leg of cube was tilted.
-
The cause of the problem one rare occasions has been fixed. Generally groups should be exported and the export dialog should show now always.
The export of ungrouped geometry is not intended. It is better to group an object so that the corresponding kml feature can be recognized. -
Thanks for the update 1.4.7. Some problems still exist.
Please use the attached .skp and export to kml.
I think the following will ALWAYS FAIL to export correctly. Any geometry drawn off axis or rotated so that its edges are off axis will not export correctly.
What does work now is making a group or a component of any geometry, then exporting the group or component. However, they too will fail if subsequently rotated. Scaling the component after creating it does not appear to adversely affect the component when exported.
Regards, John
-
Thanks for the test case. I fixed that components were exported with reversed tilt angle (Google Earth uses it in the opposite direction than SketchUp).
Ungrouped geometry is NOT intended to be used for export (as written above).
-
And thank you one more time.
John
-
I've had success importing certain kml files. Others not so much. The error i'm receiving in the ruby console is as follows:
fetching elevation from url: http://api.geonames.org/astergdemJSON?formatted=true&lat=38.7126087917573&lng=-77.1426263045962&username=aerilius&style=full&callback=returnJson
kmlImport.rb: geonames returned 38
Error: #<NoMethodError: undefined method `+' for nil:NilClass>Any input would be helpful. Thanks
-
Can you paste this in the Ruby Console before running the lugin again?
$VERBOSE=true
Then the error message will tell a bit more useful. Thanks!
-
Another benefit of the export KML option is creating Tour Paths for GoogleEarth. SU makes it easier to create smooth paths, edit those paths, and append a path via the Weld script. After opening the KML path in GoogleEarth, if you discover you want to reverse the direction of the tour along the path, then you can use Fredo6's revert path script and then save it as a new kml file.
-
I have been importing the attached file to draw lines between the points I marked in GE Pro from a survey I did sometime ago.
But when I try to connect one point with the other, the pencil tool would never pick the end of any of the points. It picks something on the air and not sure what I am doing wrong. Please help.
-
I see that the plugin is only importing the coordinates as labels with a leader, but is not adding a Construction Point to the tip of the leader; thus, you can not snap to the tip of the leader with any of SU/s drawing tools.
The import function of this plugin would have to be modified to have an option to do this.
PERHAPS THERE ALREADY IS A SCRIPT TO ADD CONSTRUCTION POINTS TO THE TIPS OF LEADERS?
-
Perhaps
if !description.nil? && !description.empty? context.add_text description, c, [1,1,1] elsif !name.empty? context.add_text name, c, [1,1,1] else context.add_cpoint c end
needs to become
if !description.nil? && !description.empty? context.add_text description, c, [1,1,1] context.add_cpoint c elsif !name.empty? context.add_text name, c, [1,1,1] context.add_cpoint c else context.add_cpoint c end
-
Questions:
-
And how do I convert labels to construction points?
-
Where do I insert the code TIG is suggesting?
-
I have imported in the past fro GE to SU with this plugin and do not remember having this issue.
-
-
@schoobie said:
Questions:
-
And how do I convert labels to construction points?
-
Where do I insert the code TIG is suggesting?
-
I have imported in the past from GE to SU with this plugin and do not remember having this issue.
- The code changes adds cpoints at all labels.
- Search the script for the first set of code and add the extra lines
context.add_cpoint c
where shown... - ???
-
-
@tig said:
@schoobie said:
Questions:
-
And how do I convert labels to construction points?
-
Where do I insert the code TIG is suggesting?
-
I have imported in the past from GE to SU with this plugin and do not remember having this issue.
- The code changes adds cpoints at all labels.
- Search the script for the first set of code and add the extra lines
context.add_cpoint c
where shown... - ???
Wow, thanks!
Quite simple, but very impressive! -
-
Thanks TIG for helping out.
-
Hi
This is a great tool thank you. I am using it to import contour lines but am having an issue with failing to import all data with more detailed contours (ie 1 metre contours for a small area).
The KML file containing contours is only 152 k but when using the plug in fetches elevation data and then imports about 1/3 of the contour lines but then it hangs on a dialog title "Progess" importing linestrings which is all in blue and no further data is imported.
Is this a size / number of entities / memory limitation? Even though detailed it is not huge.
Any help would be appreciated.
Thanks regards
David
-
TIG Thanks for your PM reply :
I know of no size limit.
Are you sure Sketchup has hung and not just slowed down?
What does the Task Manager show ??TIG
Re your questions :
Sketchup doesnt seem to have "Stopped responding" according to the task manager.
The first third of the contours come in quickly. After trying a couple of times I left it sit for a couple of hours but no further activity other than a blue progress bar sitting at 100%.
I did find a suggested size kml file limit of not much more than 200KB, otherwise Sketchup will go very slowly.
I have attached the file in question.
For other forum members interest, I also found another tool to import shapefiles into sketchup at the following URL :
[http://www.strategis.nl/StrateGisSoftware/SGGISShapeImporterForSketchup.zip](http://www.strategis.nl/StrateGisSoftware/SGGISShapeImporterForSketchup.zip)
This imports all the contours from a shapefile into sketchup in instant (which suggests to me the KML file shouldn't be too big for sketchup).
However unlike KML Import, GIS Shape Importer does not georeference the contours or group individual contours with the elevation height as the group name. GIS Shape Importer as the name suggests also cannot export to shapefiles whereas KML Import can export as well. These features in KML Import are nice features which allows automation of height adjustment of the contours to create a tin file and export the elevated contours as well.
Unfortunately because of the import problem I cant use KML import for this at the moment so am doing it all painfully / manually. However at least with GIS Shape importer I am able to progress in the meantime.
If anyone can test my file and see if they are getting the same problem and suggest a solution that would be much appreciated.
Regards
David
-
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.
Advertisement