Global Mapper Pro

Changing the Object Type via script

Alex404
Alex404 Global Mapper UserTrusted User
edited December 2011 in GM Script Language
Hi all,

I am currently tying to change the Type of an object depending on a value of an attribute
EDIT_VECTOR AREA_TYPE="Unknown Area Type" ATTR_VAL="MyLay=Regional River" COMPARE_STR="FTYPE=460"
EDIT_VECTOR ATTR_TO_COPY="<Feature Type>=MyLay"

Above does not work. Also assigning <Feature Type> or Layer directly fails.
Any idea how this can be done?

Best regards,
Alex

Comments

  • global_mapper
    global_mapper Administrator
    edited December 2011
    Alex,

    Your first EDIT_VECTOR call looks correct. It should assign a type of "Unknown Area Type" and set the MyLay attribute to 'Regional River' for all features with a FTYPE attribute with a value of 460. Is that how you intended it to work? What version of Global Mapper are you using?

    Thanks,

    Mike
    Global Mapper Guru
    gmsupport@bluemarblegeo.com
    http://www.globalmapper.com
  • Alex404
    Alex404 Global Mapper User Trusted User
    edited December 2011
    Mike,

    Yes, it works to assign the value "Regional River" to the attribute "MyLay". But what I want to achieve is to assign this value to the "<Feature Type>" and this is where I fail.

    I am working with GM13 64bit.

    Best regards,
    Alex
  • global_mapper
    global_mapper Administrator
    edited December 2011
    Alex,

    So you want to assign the <Feature Type> to a type named 'Regional River'? If so you would have to first have an area type defined named 'Regional River', then you would use AREA_TYPE="Regional River" in your EDIT_VECTOR script command.

    Thanks,

    Mike
    Global Mapper Guru
    gmsupport@bluemarblegeo.com
    http://www.globalmapper.com
  • Alex404
    Alex404 Global Mapper User Trusted User
    edited December 2011
    Mike,

    sorry my english ist not the best.

    maybe an picture makes it clearer. I want to change the object type to the GM Area Type "Regional River"
    8986837wfv.jpg

    In the image above it is recognized as "Feature Type: Unknown Area Feature"
    I want to change it to "Feature Type: Regional River" per script if "FType" has the value "foo"

    I can do this manually in the GUI, by searching for "FType = foo" and then click select all, click "edit" and then select the feature type "Regional River"
    8986915kxl.jpg
    But this takes very long, especially on large datasets. I therfore woud like to do it per script and let it run overnight.

    is this possible with GM13?

    Thanks
    Alex
  • global_mapper
    global_mapper Administrator
    edited December 2011
    Alex,

    Sorry I completely forgot there was already a built-in area type named 'Regional River'! Try just using the following to assign the features to that type:

    EDIT_VECTOR AREA_TYPE="Regional River" COMPARE_STR="FTYPE=460"

    Let me know if I can be of further assistance.

    Thanks,

    Mike
    Global Mapper Guru
    gmsupport@bluemarblegeo.com
    http://www.globalmapper.com
  • Alex404
    Alex404 Global Mapper User Trusted User
    edited December 2011
    Mike,

    thank you, it works like a charm.

    Best regards
    Alex
Sign In or Register to comment.