Global Mapper v25.0

Easy script for changing line style.

Hello,

 

This my first post in the forum, I’m searching some help for my first and very easy script that I cannot find the way to do it.

My idea is to convert many shapefiles to kml, for that I created a loop like this:

 

GLOBAL_MAPPER_SCRIPT VERSION="1.00"

DIR_LOOP_START DIRECTORY=D:\GLOBAL_MAPPER_INPUT\ FILENAME_MASKS="*.shp"

IMPORT FILENAME="%FNAME_W_DIR%"

EXPORT_VECTOR FILENAME="D:\GLOBAL_MAPPER_OUTPUT\%FNAME_WO_EXT%.kml" TYPE=KML

UNLOAD_ALL

DIR_LOOP_END

 

But I would like to change also the line style and the color for every file. I have tried with DEFINE_LAYER_STYLE but it doesn’t work. Anyone could help me on that?

Thank you very much.


Cheers.


Tagged:

Answers

  • MorganRS
    MorganRS Global Mapper User Trusted User
    Answer ✓
    I'd try adding

    GLOBAL_MAPPER_SCRIPT VERSION=1.00
    DIR_LOOP_START DIRECTORY=D:\GLOBAL_MAPPER_INPUT\ FILENAME_MASKS="*.shp"
    IMPORT FILENAME="%FNAME_W_DIR%"
    EDIT_VECTOR STYLE_ATTR="LINE_STYLE=SOLID" STYLE_ATTR="LINE_WIDTH=3" STYLE_ATTR="LINE_COLOR=RGB(0,255,0) COMPARE_STR="attribute_value=something"
    EXPORT_VECTOR FILENAME="D:\GLOBAL_MAPPER_OUTPUT\%FNAME_WO_EXT%.kml" TYPE=KML
    DIR_LOOP_END
    UNLOAD_ALL
    Then you can set up an attribute value to style off and Global Mapper will find it in the COMPARE_STR command
    There is a list of supported styles you can script with here




  • Hi MorganRS,

    Thank you very much for your help.

    I copy the exact code you wrote and make the job.

    I didn’t catch the last thing you told me about seting up and attribute value to style off Global Mapper, I believe I am to noob in scripting to do that…

    Thank you again.

    Cheers.