Global Mapper Pro Coming Soon

COMPARE_STR operators

pgoodyearpgoodyear Global Mapper UserPosts: 16
edited February 2010 in Technical Support
I apologize if these are rudimentary questions, but is there a way to do a "not equal to" operation with COMPARE_STR?

Also, is there a way to do an "OR" function to compare an attribute to multiple values?

Kind Regards,

Patrick Goodyear

Comments

  • global_mapperglobal_mapper Administrator Posts: 17,238
    edited July 2009
    Patrick,

    Currently the COMPARE_STR functionality is limited to a single equality comparison. For any more advanced searches you would have to either use the Search by Attributes option in Global Mapper or use the Global Mapper SDK to form your own queries.

    Thanks,

    Mike
    Global Mapper Support
    support@globalmapper.com
  • kartoone76kartoone76 Global Mapper User Posts: 38Trusted User
    edited February 2010
    Works great except for one thing - how can I formulate a COMPARE_STR to find all unnamed features? I tried the following to no avail:

    COMPARE_STR="<Feature Name>="
    COMPARE_STR="<Feature Name>= "
    COMPARE_STR="<Feature Name>=<UNNAMED FEATURE>"

    The tool for searching by attribute within Globalmapper works great to find unnamed features, but I would like to recreate that capability in the scripting language.

    Thanks in advance for your help!

    Also there is a way to do OR ... simply recreate the ASSIGN command however many times you need ... see below for an example:

    ASSIGN_TYPE FILENAME="%FNAME_W_DIR%" LINE_TYPE="COUNTY ROUTE" COMPARE_STR="tiger:name=County*"
    ASSIGN_TYPE FILENAME="%FNAME_W_DIR%" LINE_TYPE="COUNTY ROUTE" COMPARE_STR="NAME_1=County*"
  • global_mapperglobal_mapper Administrator Posts: 17,238
    edited February 2010
    You should be able to use your first option. What version of Global Mapper are you using? I just used the following script it and it renamed all unnamed features:

    GLOBAL_MAPPER_SCRIPT VERSION="1.00" FILENAME="C:\Temp\export test\test.gmw"
    UNLOAD_ALL
    IMPORT FILENAME="BLUE_SPRINGS.OPT"

    ASSIGN_TYPE COMPARE_STR="<Feature Name>=" LINE_TYPE=INTERSTATE

    For an OR operation, just do as you suggested and have multiple ASSIGN_TYPE commands, one for each condition.

    Let me know if I can be of further assistance.

    Thanks,

    Mike
    Global Mapper Support
    support@globalmapper.com
  • kartoone76kartoone76 Global Mapper User Posts: 38Trusted User
    edited February 2010
    It was still not working for me using the latest 64-bit version of Global Mapper 11.01 Build Time Jan 11 2010. I just downloaded and installed the 32-bit version, and that wasn't working either. Here is the exact script file:

    GLOBAL_MAPPER_SCRIPT VERSION="1.00" FILENAME="C:\data\osm\osm9-restmp\test.gmw"
    UNLOAD_ALL
    IMPORT FILENAME="c:\data\osm\osm9-restmp\alabama.osm.residential_D_06.zip"
    ASSIGN_TYPE COMPARE_STR="<Feature Name>=" LINE_TYPE=INTERSTATE

    The exact problem is that it is matching all features instead of only the ones that are unnamed. I have attached the osm data I am using.

    Let me know what you think might be the problem.
  • global_mapperglobal_mapper Administrator Posts: 17,238
    edited February 2010
    Ah, you are right, I didn't notice that the named features were being matched as well. I have now fixed that and the ASSIGN_TYPES works properly now for matching against empty values. I have placed a new build at http://www.globalmapper.com/global_mapper11.zip with the change for you to try. Simply download that file and extract the contents into your existing v11.xx installation folder to give it a try. If you are using the 64-bit version, there is a new build available at http://www.globalmapper.com/global_mapper11_64bit.zip .

    Let me know if I can be of further assistance.

    Thanks,

    Mike
    Global Mapper Support
    support@globalmapper.com
Sign In or Register to comment.