COMPARE_STR operators
pgoodyear
Global Mapper User
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
Also, is there a way to do an "OR" function to compare an attribute to multiple values?
Kind Regards,
Patrick Goodyear
Comments
-
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 -
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*" -
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 -
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. -
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
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