what file format should a script be.

I have tried to create a script as a .txt file but GM does not recognise ( show to select) this in the run script command.
I am new to GM so any help will be great.
If I can download a file to start this would be easiest.
Thank you

Best Answers

  • bmg_bobbmg_bob Global Mapper Programmer Posts: 2,026
    Answer ✓
    Hello,

    A script should be a text file with a .gms extension, but you can use a .txt file. On the dialog to open a script file, choose "All Files" from the file type list, and .txt files will be shown in the list.

    Here is a link to a recorded webinar that is an introduction to scripting in Global Mapper.

    Cheers,
    Bob
  • bmg_bobbmg_bob Global Mapper Programmer Posts: 2,026
    Answer ✓
    Hello,

    Use the EDIT_VECTOR command to select a subset of your features and do something to them.  Here is an example that uses the "not equal" operator:
    EDIT_VECTOR COMPARE_STR="ATTR!=street" COPY_TO_NEW_LAYER NEW_LAYER_NAME="NON_STREETS"
    That command will find all features where the attribute value is not "street" and copy them to a new layer called "NON_STREETS".

    You can find the full documentation for the EDIT_VECTOR command here.

    Cheers,
    Bob

Answers

  • LewisLewis Posts: 4
    Great thanks for that. It did work.
    I'm also interested in knowing how to script or query "not equal to" in GM. for example all road features with a name not equal to "street".
    Thanks

  • LewisLewis Posts: 4
    Thanks Bob
    That did work in a script, is there also a way to perform this through the "search vector data/ query" tool in GM.
    Regards

    Lewis
  • bmg_bobbmg_bob Global Mapper Programmer Posts: 2,026
    Lewis said:
    That did work in a script, is there also a way to perform this through the "search vector data/ query" tool in GM.
    1. In the Search Vector Data tool, type ATTR <> 'street' into the Query section and click the Search button. A window of search results will pop up.
    2. In the search results window, click the Select All button.
    3. Right-click in the list with the selected features and choose Copy the Selected Features to the Clipboard
    4. In the main Global Mapper window, choose Edit | Paste Features from Clipboard. A Select Paste Layer window will appear.
    5. Choose Create a New Layer to Paste To from the list and click OK.
    6. Type a name for the new layer and click OK.
    7. Choose the Projection (default is the current projection, which is most likely what you will want) and click OK
    Cheers,
    Bob
Sign In or Register to comment.