Global Mapper Pro


carlpett Global Mapper User
edited May 2011 in GM Script Language
I need to add an unique integer attribute to each segment in a vector layer. So suppose I have two road segments, I'd like to add MY_ATTRIB = 1 to the first one, MY_ATTRIB = 2 to the second one. Can this be done? I saw the DEFINE_VAR command, but it doesn't seem to be able to do what I want.


  • global_mapper
    global_mapper Administrator
    edited May 2011
    The DEFINE_VAR command is for creating a variable to use in the script file, it wouldn't be of any use adding a unique attribute to each feature. In fact there isn't currently a way to do that from a script.

    What you can do in the user interface is select and edit all of the features and add an attribute to all the features named MY_ATTRIB with some value like 1. Then, use the Search->Find Duplicates menu command to find those features with duplicate MY_ATTRIB values (all of them) and then automatically assign unique values.

    Let me know if I can be of further assistance.


    Global Mapper Support
  • carlpett
    carlpett Global Mapper User
    edited May 2011
    Yeah, I figured it wouldn't work. The find duplicates trick worked very well though, thank you!
Sign In or Register to comment.