Changing the Object Type via script
Alex404
Global Mapper UserTrusted User
Hi all,
I am currently tying to change the Type of an object depending on a value of an attribute
Above does not work. Also assigning <Feature Type> or Layer directly fails.
Any idea how this can be done?
Best regards,
Alex
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
-
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 -
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 -
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 -
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"
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"
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 -
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 -
Mike,
thank you, it works like a charm.
Best regards
Alex
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