Specify file prj on import without being prompted

MorganRSMorganRS Global Mapper UserPosts: 72Trusted User
edited March 2016 in GM Script Language
I'm trying to decipher the GM scripting language reference doc on how to specify a projection for a file that does not have a prj file. The scripting reference page gives no example on the correct format. I'm trying this:
GLOBAL_MAPPER_SCRIPT VERSION=1.00
IMPORT FILENAME="G:\Products\Garmin\Premium\OK\OK_TRANSPORTATION.MP" EPSG:4326
since the reference doc only states :
  • EPSG Code - the value is an EPSG code, either just the raw code, or a code with EPSG: in front of it, like 'EPSG:4326'
and has no examples.


Tagged:

Best Answer

  • Ice Age MarkIce Age Mark Global Mapper User Posts: 294
    Answer ✓
    Hello,

    The best way to do it is to use DEFINE_PROJ and END_DEFINE_PROJ to define your import projection 'before' your import.  You give it a name (or it already has one), and then specify it using that name in your import command.  Then it's in the script for any import to find just by calling it's name.  Like:

    GLOBAL_MAPPER_SCRIPT VERSION=1.00

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


    IMPORT FILENAME="G:\Products\Garmin\Premium\OK\OK_TRANSPORTATION.MP" PROJ_NAME="GEO_WGS84"



    The example above should be good for EPSG 4326

    Hope that helps,

    Mark

Answers

  • MorganRSMorganRS Global Mapper User Posts: 72Trusted User
    Perfect! Thank you Mark. I was trying the DEFINE_PROJ command but wasn't putting it the correct place I guess.
Sign In or Register to comment.