Points missing from script export

I'm very new to Global Mapper and I'm still familiarizing myself with how it operates.  While my problem might be obvious, it escapes me.

On my machine, I've created a directory called 'c:\tempx\'.  That directory contains three files:

    gm_na_topo.gmw - a cropped version of the 'World Topo Map'

    gm_test.gms - a script that operates on 'gm_na_topo.gmw'

    points.xyz - contains two points (cross-hairs) in a simple ASCII file


I start Global Mapper (V19.0.1, 64-bit), select 'Unload All' and then 'Run Script ...'

I load my test script 'gm_test.gms' and then click on 'Run Script in the Context of the Main View' and then click on 'Run Script'.

My script runs without errors:

    Removed all loaded overlays.
    Importing file <c:\tempx\gm_na_topo.gmw>...
    Removed all loaded overlays.
    Importing OSM Tile data...
    Loading new global projection...
    Reading map layout...
    Loading new global projection...
    Importing ASCII file c:\tempx\points.xyz...
    Updating loaded layer options...
    Loading new global projection...
    Exporting raster data to PNG file <c:\tempx\bishop.png>...
    Playing sound...

The imported points will be found in the layer 'MAPGEN Points'.  So far, everything looks OK.

The result of my script is to export a PNG extract called 'bishop.png'

I expected to see the two points ('Bishop' & 'Big Pine') on the resulting PNG, but they are missing.  Can anybody help me understand where I've gone wrong?

I've attached the files: 'gm_na_topo.gwm', 'gm_test.gms' and 'points.xyz'





Best Answer

  • MykleMykle Global Mapper User Posts: 448
    Answer ✓
    Very good files, thank you.
    The answer to your question is easy.

    In your GMS file,
    in your EXPORT_RASTER section,
    add the line
         INC_VECTOR_DATA=YES \

    I usually deal with this option when manually exporting files, so had to dig for the script reference.
    It's in the HELP | HELP ... dialog,
    Scripting Reference
       Export
          EXPORT_RASTER
    about 2/3 down the dialog.
    I knew what I was looking for, so wasn't hard to find. 


Answers

  • JHallJHall Posts: 12
    For some reason, I'm not able to attach my files.

    Instead I'll add them manually:

    gm_na_topo.gmw
    ----------------------

    GLOBAL_MAPPER_SCRIPT VERSION="1.00" FILENAME="Z:\_to-polo\gm_na_topo.gmw" GM_VERSION="19.0.1" \
         TIMESTAMP="2017-10-25T09:14:02Z"
    SET_BG_COLOR COLOR="RGB(255,255,255)"
    UNLOAD_ALL
    IMPORT_OSM_TILE LAT_LON_BOUNDS="-178.00000000,24.00000000,-49.00000000,77.00000000" \
         OSM_BASE_URL="http://server.arcgisonline.com/ArcGIS/rest/services/World_Topo_Map/MapServer/tile/" \
         OSM_DESC="World Topo Map" OSM_FILE_EXT="jpg" OSM_NUM_ZOOM_LEVELS="20" SOURCE_TYPE="GMAP" \
         OSM_IS_GOOGLE_MAPS="YES" METADATA_URL="https://www.arcgis.com/home/item.html?id=30e5fe3149c34df1ba922e6f5bbf808f" \
         LABEL_FIELD_FORCE_OVERWRITE="NO" LABEL_FORMAT_NUMBERS="YES" LABEL_PRECISION="-1" \
         LABEL_REMOVE_TRAILING_ZEROS="YES" LABEL_USE_SCIENTIFIC_NOTATION="NO" BAND_RANGE="-32000.000000000,32000.000000000,ALL,0" \
         CLIP_COLLAR="NONE" SAMPLING_METHOD="BICUBIC" AUTO_CONTRAST="NO" CONTRAST_SHARED="NO" \
         CONTRAST_MODE="NONE" TEXTURE_MAP="NO"
    DEFINE_PROJ PROJ_NAME="MERCAT_WGS84"
    Projection     MERCATOR
    Datum          WGS84
    Zunits         NO
    Units          METERS
    Xshift         0.000000
    Yshift         0.000000
    Parameters
    1.000000000 /* scale factor at central meridian
    0 0 0.00000 /* central meridian
    0 0 0.00000 /* latitude of the origin
    0.0000 /* false easting (meters)
    0.0000 /* false northing (meters)
    END_DEFINE_PROJ
    LOAD_PROJECTION PROJ_NAME="MERCAT_WGS84"
    SET_VIEW GLOBAL_BOUNDS="-23976181.12884,2459125.89039,-1293343.28123,14089307.89478"

    /************ DEFINE MAP LAYOUT *************/
    MAP_LAYOUT
    ElevLegendBgColor=16777215
    ElevLegendTranslucency=384
    ElevLegendFont=~0~534799372~0.000~0~0~16777215
    ElevLegendVisible=1
    ElevLegendDisplayType=1
    ElevLegendDisplayUnits=1
    ElevLegendDisplayUnitsStr=
    ElevLegendCustomRangeMin=0
    ElevLegendCustomRangeMax=0
    ElevLegendRangeType=0
    ElevLegendTitle=
    ElevLegendSlopePercent=0

    DEFINE_PROJ_ELEV_LEGEND
    Projection     Fixed Screen Position
    Datum          D_ADINDAN
    Zunits         NO
    Units          RADIAN
    Xshift         0.000000
    Yshift         0.000000
    Parameters
    0.000000000 /* horz offset
    0.000000000 /* horz offset type (0 - left, 1 - right, 2 - center)
    0.000000000 /* horz offset value type (0 - inches, 1 - % width, 2 - deg lon)
    0.000000000 /* vert offset
    0.000000000 /* vert offset type (0 - top, 1 - bottom, 2 - center)
    0.000000000 /* vert offset value type (0 - inches, 1 - % width, 2 - deg lat)
    100.000000000 /* size value
    2.000000000 /* size value type (0 - % width, 1 - % height, 2 - pixel)
    1.000000000 /* always on top
    0.000000000 /* shrink to fit
    END_DEFINE_PROJ

    MapLegendType=0
    MapLegendBgColor=16776959
    MapLegendBorderStyle=0,2097152,0.0
    MapLegendTranslucency=512
    MapLegendFont=~0~534799368~0.000~0~0~16777215
    MapLegendFooterFont=~0~534799372~0.000~0~0~16777215
    MapLegendHeaderFont=~0~534799372~0.000~0~0~16777215
    MapLegendHeader=
    MapLegendFooter=
    MapLegendNumColumns=1
    MapLegendLabelAttr=
    MapLegendUseNaturalSort=0

    DEFINE_PROJ_MAP_LEGEND
    Projection     Fixed Screen Position
    Datum          D_ADINDAN
    Zunits         NO
    Units          RADIAN
    Xshift         0.000000
    Yshift         0.000000
    Parameters
    0.000000000 /* horz offset
    1.000000000 /* horz offset type (0 - left, 1 - right, 2 - center)
    0.000000000 /* horz offset value type (0 - inches, 1 - % width, 2 - deg lon)
    0.000000000 /* vert offset
    1.000000000 /* vert offset type (0 - top, 1 - bottom, 2 - center)
    0.000000000 /* vert offset value type (0 - inches, 1 - % width, 2 - deg lat)
    0.000000000 /* size value
    2.000000000 /* size value type (0 - % width, 1 - % height, 2 - pixel)
    1.000000000 /* always on top
    1.000000000 /* shrink to fit
    END_DEFINE_PROJ

    NorthArrowEnabled=0
    NorthArrowSymbol=
    NorthArrowSymbolScale=1.000000
    NorthArrowTranslucency=384

    DEFINE_PROJ_NORTH_ARROW
    Projection     Fixed Screen Position
    Datum          D_ADINDAN
    Zunits         NO
    Units          RADIAN
    Xshift         0.000000
    Yshift         0.000000
    Parameters
    0.000000000 /* horz offset
    1.000000000 /* horz offset type (0 - left, 1 - right, 2 - center)
    0.000000000 /* horz offset value type (0 - inches, 1 - % width, 2 - deg lon)
    0.000000000 /* vert offset
    0.000000000 /* vert offset type (0 - top, 1 - bottom, 2 - center)
    0.000000000 /* vert offset value type (0 - inches, 1 - % width, 2 - deg lat)
    100.000000000 /* size value
    2.000000000 /* size value type (0 - % width, 1 - % height, 2 - pixel)
    1.000000000 /* always on top
    0.000000000 /* shrink to fit
    END_DEFINE_PROJ

    ScaleBarBgColor=16777215
    ScaleBarTranslucency=384
    ScaleBarFont=~0~534799372~0.000~0~0~16777215
    ScaleVisible=0

    DEFINE_PROJ_SCALE
    Projection     Fixed Screen Position
    Datum          D_ADINDAN
    Zunits         NO
    Units          RADIAN
    Xshift         0.000000
    Yshift         0.000000
    Parameters
    0.000000000 /* horz offset
    0.000000000 /* horz offset type (0 - left, 1 - right, 2 - center)
    0.000000000 /* horz offset value type (0 - inches, 1 - % width, 2 - deg lon)
    0.000000000 /* vert offset
    1.000000000 /* vert offset type (0 - top, 1 - bottom, 2 - center)
    0.000000000 /* vert offset value type (0 - inches, 1 - % width, 2 - deg lat)
    0.000000000 /* size value
    2.000000000 /* size value type (0 - % width, 1 - % height, 2 - pixel)
    1.000000000 /* always on top
    0.000000000 /* shrink to fit
    END_DEFINE_PROJ

    GridDisplayType=0
    GridDisplayShowAll=0
    GridSpacingLatLon=0.00000000000000000
    GridSpacingProjected=0.00000000000000000
    END_MAP_LAYOUT





  • JHallJHall Posts: 12
    I exceeded the length of the body.

    Here are the last two files -




    gm_test.gms
    ----------------

    GLOBAL_MAPPER_SCRIPT VERSION=1.00
    UNLOAD_ALL


    IMPORT FILENAME=c:\tempx\gm_na_topo.gmw


    DEFINE_PROJ PROJ_NAME="GEO_WGS84"
    Projection     GEOGRAPHIC
    Datum          WGS84
    Zunits         NO
    Units          DD
    Xshift         0.000000
    Yshift         0.000000
    Parameters
    0 0 0.00000 /* longitude of center of projection
    END_DEFINE_PROJ


    LOAD_PROJECTION PROJ="GEO_WGS84"


    IMPORT_ASCII FILENAME=c:\tempx\points.xyz \
        LAYER_DESC="MAPGEN Points" \
        TYPE=POINT_ONLY \
        COORD_DELIM=TAB \
        COORD_FORMAT=DECIMAL \
        COORD_ORDER=Y_FIRST \
        PROJ "GEO_WGS84" \
        INC_COORD_LINE_ATTRS=YES \
        INC_ELEV_COORDS=NO \
        HIDDEN=NO



    SET_LAYER_OPTIONS FILENAME="*" HIDDEN=NO

    LOAD_PROJECTION PROJ="MERCAT_WGS84"


    EXPORT_RASTER FILENAME=c:\tempx\bishop.png \
        TYPE=PNG \
        PALETTE=OPTIMIZED \
        LAT_LON_BOUNDS=-118.895327,36.863131,-117.895327,37.863131 \
        USE_EXACT_BOUNDS \
        PIXEL_SIZE_MAX=700x700 \
        FORCE_SQUARE_PIXELS=YES \
        OVERWRITE_EXISTING=YES

    PLAY_SOUND


    points.xyz
    ------------

    GM_TYPE=Unknown Point Feature
    DESCRIPTION=ca/bishop-xx-inyo
    NAME="Bishop"
    POINT_SYMBOL=CROSS_CUSTOM_10_0_0_0
    FONT_SIZE=10
    FONT_COLOR=RGB(0,0,0)
    FONT_CHARSET=1
    FONT_WEIGHT=400
    37.363131    -118.395327

    GM_TYPE=Unknown Point Feature
    DESCRIPTION=ca/big-pine-xx-inyo
    NAME="Big Pine"
    POINT_SYMBOL=CROSS_CUSTOM_10_0_0_0
    FONT_SIZE=10
    FONT_COLOR=RGB(0,0,0)
    FONT_CHARSET=1
    FONT_WEIGHT=400
    37.164931    -118.289546







  • MykleMykle Global Mapper User Posts: 448Trusted User
    Suggest creating a ZIP file containing your files.  Attachments are limited to a few file types, like ZIP.

  • JHallJHall Posts: 12
    Thanks for the suggestion, it didn't occur to me.

    Attached is the zip'd version of the three files.

  • JHallJHall Posts: 12
    Thanks Mykle,

    I need to do some reading and testing, but I think you're right.

    I'll let you know how my testing went and then mark this thread as answered.

    Thank you for you help,

        John
  • JHallJHall Posts: 12
    Hi Mykle,

    That was it.

    Once again, thank you for your help

         John
Sign In or Register to comment.