ASCII import Script and Field Options: DESCRIPTION

Recce
Recce Global Mapper UserTrusted User
edited October 2008 in Vector Data
How to import 2 columns into the "description" field in a waypoint. When exporting this ASCII Script to GPX
//Convert TXT files to GPX file
GLOBAL_MAPPER_SCRIPT VERSION=1.00

UNLOAD_ALL
ENABLE_PROGRESS=NO


IMPORT_ASCII FILENAME="C:\Pfps\MPU\LPT2GPX\Input TXT\mergefile.txt" TYPE=POINT_ONLY COORD_DELIM=TAB COORD_ORDER=Y_FIRST INC_COORD_LINE_ATTRS=YES COL_HEADERS=YES SKIP_COLUMNS=2 PROJ_FILENAME=C:\Pfps\MPU\LPT2GPX\TXT_PRJ.prj POINT_TYPE=Waypoint COORD_SCALE=1.0,1.0,0.3048 


EXPORT_VECTOR FILENAME="C:\Pfps\MPU\LPT2GPX\Output GPX\FalconView Point file.gpx" TYPE=GPX

My source looks like this:
NAME	DESC			ELEVATION							TYPE
002		N 55 07 33	E014 46 38	150	0	K	US		-1.00	-1.00	green dot2	City (Small), 10/1/2008 1:37:16 PM	Default
fly	kommentar	N 56 13 33	E009 14 28	216	0	K	US		-1.00	-1.00	B-1		Default
airplainn		N 56 21 26	E008 59 29	55	0	K	US		-1.00	-1.00	airplane		Default

I tried to add DESCRIPTION to the to columns. But only one column was exported into the GPX (MapSource).

/Thomas

Comments

  • global_mapper
    global_mapper Administrator
    edited October 2008
    Thomas,

    Global Mapper will currently only export what is listed as the Description for a feature in the Feature Info dialog into the description field in an exported GPX file. If you need to combine multiple fields you can do that in the display label, which is also exported. To do this, simply open the Control Center, select the input layer, press Options, then setup the display label to be a combination of multiple attribute fields.

    Let me know if I can be of further assistance.

    Thanks,

    Mike
    Global Mapper Support
    support@globalmapper.com
  • Recce
    Recce Global Mapper User Trusted User
    edited October 2008
    How to do this in a script?

    :)
  • global_mapper
    global_mapper Administrator
    edited October 2008
    You can do this using the LABEL_FIELD parameter. Just append the attribute names to use with a '>+< character. For example, the following appends the STREET_NAME, CITY_L, and COUNTY_L attribute fields.

    LABEL_FIELD="STREET_NAME>+<CITY_L>+<COUNTY_R"

    Let me know if I can be of further assistance.

    Thanks,

    Mike
    Global Mapper Support
    support@globalmapper.com
  • Recce
    Recce Global Mapper User Trusted User
    edited October 2008
    Thanks Mike,

    But the exported GPX has not changed. Do I need to add something else?
    //Convert TXT files to GPX file
    GLOBAL_MAPPER_SCRIPT VERSION=1.00
    
    UNLOAD_ALL
    ENABLE_PROGRESS=NO
    
    
    IMPORT_ASCII FILENAME="C:\Pfps\MPU\LPT2GPX\Input TXT\mergefile.txt" TYPE=POINT_ONLY COORD_DELIM=TAB COORD_ORDER=Y_FIRST INC_COORD_LINE_ATTRS=YES COL_HEADERS=YES SKIP_COLUMNS=2 PROJ_FILENAME=C:\Pfps\MPU\LPT2GPX\TXT_PRJ.prj POINT_TYPE=Waypoint COORD_SCALE=1.0,1.0,0.3048 LABEL_FIELD="DESC>+<TYPE>+<ICONS>+<LAYERS"
    
    EXPORT_VECTOR FILENAME="C:\Pfps\MPU\LPT2GPX\Output GPX\FalconView Point file.gpx" TYPE=GPX 
    

    GM version 9.3
  • Recce
    Recce Global Mapper User Trusted User
    edited October 2008
    Do understand this right. Its only possible to add more columns to the waypoints name and not the description?
  • global_mapper
    global_mapper Administrator
    edited October 2008
    The syntax looks correct, but I didn't see attribute columns with all of those names in your input data. The LABEL_FIELD option only works with the values of actual attribute/value fields and not other data associated with a feature.

    It is not currently possible to modify the description field of a feature after the initial load of the feature.

    Thanks,

    Mike
    Global Mapper Support
    support@globalmapper.com