Global Mapper v25.0

I am trying to export multiple layers of contours to file. I want to export individually. They have

I am trying to export multiple layers of contours to file. I want to export individually. They have no file name as i have generated in GM.

When I export using the EXPORT_VECTOR in a script. Even switching on or off the layers all the vector layers are visible in each export. How can I prevent this??


Thanks

Best Answer

  • bmg_mike
    bmg_mike Global Mapper Guru Moderator, Trusted User
    Answer ✓

    Your FILENAME parameter for the output isn't correct. It would export to a new EXPORT_CONTOURS_DIR folder under the root of your current drive, if that's even writable.

    You should use:

    FILENAME="%EXPORT_CONTOURS_DIR%\%LAYER_DESC%.shp"

    You can also run this using File->Run Script to see if the script log gives you any helpful information if there are still issues.

    Thanks,

    Mike

    Global Mapper Guru

Answers

  • bmg_mike
    bmg_mike Global Mapper Guru Moderator, Trusted User

    I would suggest using a LAYER_LOOP_START ... LAYER_LOOP_END in the script to loop over the layers. See https://www.bluemarblegeo.com/knowledgebase/global-mapper-25/cmd/LAYER_LOOP_START.htm#LAYER_LOOP_START for details.

    Since your layers don't have filenames, instead use the description of the layers (which I assume is unique) to specify which layer to export in your EXPORT_VECTOR call, like EXPORT_LAYER="%LAYER_DESC%" as a parameter of the EXPORT_VECTOR command.

    Thanks,

    Mike

    Global Mapper Guru

  • Hi thanks for the help. My script now looks like this but


    GLOBAL_MAPPER_SCRIPT VERSION="1.00"


    DEFINE_VAR NAME="EXPORT_CONTOURS_DIR" VALUE="Y:\03 - Interpretation\07 - Deliverables\Contour_Export"


    LAYER_LOOP_START LAYER_DESC="*Contours*"

    SET_LAYER_OPTIONS HIDDEN=NO

    EXPORT_VECTOR EXPORT_LAYER="%LAYER_DESC%" FILENAME="\EXPORT_CONTOURS_DIR\%LAYER_DESC%.shp" TYPE=SHAPEFILE SHAPE_TYPE=LINES TYPE=SHAPEFILE INC_ELEV_ATTR=YES INC_LAYER_ATTR=YES 

    SET_LAYER_OPTIONS HIDDEN=YES

    LAYER_LOOP_END

    But it is not exporting any files

  • Thanks for the help. Working now :)