Adding KML_FOLDER attribute to a 100 hundred layers or so...
Steve D
Global Mapper UserTrusted User
Problem:
I have a *pile* of viewsheds, each with a bajillion islands (particularly the older ones, created using Pathloss)
Obviously, a bazillion features in KML's are useless. All my data was originally created with it being used for a tile server (display on google maps) in mind, but trying to be fancy for the company intranet and have the ability to turn on and off individual viewsheds, as many are overlapping. Right now, coworkers will call me, I'll fire up GM and have a look for them. Would prefer they have a KML in Google Earth, or maybe in Google Maps... but for the time being I need to overcome one major flaw: none of the features have a KML_FOLDER, and the viewsheds generated by GM don't (seem to?) even put the layer name into the features.
Goal:
I would like to come up with a script that adds the KML_FOLDER to all of the features, with value set to the name (or description, if that's more accurate) of the layer.
Progress:
How do I A) create the KML_FOLDER attribute and grab the layer description to put it in the KML_FOLDER value? (I would like to give <feature name> this value as well, but it's not as important.)
Like to script it because not looking forward to manually doing this. As I change or add layers, I'd like to have a simple script to do this too.
I think I can figure out how to create the attribute, (copy existing one and rename it? Must be a more direct way?) but it's finding the layer description that's bugging me. When I inspect a feature, above the list of attributes there is Name, Feature Type, Geometry and "Map Name"... which appears to hold the value I want.
(I'm still using GM11 btw, in case this is something more easily done in a newer version...)
Thanks in advance!
I have a *pile* of viewsheds, each with a bajillion islands (particularly the older ones, created using Pathloss)
Obviously, a bazillion features in KML's are useless. All my data was originally created with it being used for a tile server (display on google maps) in mind, but trying to be fancy for the company intranet and have the ability to turn on and off individual viewsheds, as many are overlapping. Right now, coworkers will call me, I'll fire up GM and have a look for them. Would prefer they have a KML in Google Earth, or maybe in Google Maps... but for the time being I need to overcome one major flaw: none of the features have a KML_FOLDER, and the viewsheds generated by GM don't (seem to?) even put the layer name into the features.
Goal:
I would like to come up with a script that adds the KML_FOLDER to all of the features, with value set to the name (or description, if that's more accurate) of the layer.
Progress:
How do I A) create the KML_FOLDER attribute and grab the layer description to put it in the KML_FOLDER value? (I would like to give <feature name> this value as well, but it's not as important.)
Like to script it because not looking forward to manually doing this. As I change or add layers, I'd like to have a simple script to do this too.
I think I can figure out how to create the attribute, (copy existing one and rename it? Must be a more direct way?) but it's finding the layer description that's bugging me. When I inspect a feature, above the list of attributes there is Name, Feature Type, Geometry and "Map Name"... which appears to hold the value I want.
(I'm still using GM11 btw, in case this is something more easily done in a newer version...)
Thanks in advance!
Comments
-
You can easily do this in a script in v13, but not in v11. Contact gmorders@bluemarblegeo.com for information about upgrading from v11 to v13.
What you would want to do is use the EDIT_VECTOR script command as described at http://globalmapper.com/helpv13/ScriptReference.html#cmd_edit_vector. You would have a script that looks something like this:
GLOBAL_MAPPER_SCRIPT VERSION=1.00
EDIT_VECTOR ATTR_VAL="KML_FOLDER=<Feature Layer Name>"
Let me know if I can be of further assistance.
Thanks,
Mike
Global Mapper Guru
gmsupport@bluemarblegeo.com
http://www.globalmapper.com -
How about version 12 Mike? The higher ups are preferring to move as slowly up the upgrade chain as possible... :rolleyes:
-
That might work in v12.02, I can't really remember when it was added LOL.
Thanks,
Mike
Global Mapper Guru
gmsupport@bluemarblegeo.com
http://www.globalmapper.com
Categories
- 12.7K All Categories
- 5.6K Features Discussion
- 342 Downloading Imagery
- 1.3K Elevation Data
- 380 Georeferencing Imagery Discussion
- 628 GM Script Language
- 53 User Scripts
- 113 GPS Features
- 414 Projection Questions
- 819 Raster Data
- 1.3K Vector Data
- 6.6K Support
- 177 Announcement and News
- 908 Bug Report
- 558 SDK
- 1.2K Suggestion Box
- 3.7K Technical Support
- 562 Other Discussion
- 129 GIS Data Sources
- 27 Global Mapper Showcase
- 233 How I use Global Mapper
- 107 Global Mapper Forum Website