Global Mapper v24.0

GM not maintaining correct projections

George Chandeep Corea
George Chandeep Corea Global Mapper UserTrusted User
edited December 2015 in Projection Questions
Processed data output data does not open in the same space as the original when the files are opened in mapinfo, qgis or even GM.

Is something in my code creating this issue. It is fine when I manually update the style and export the file.

It is also fine when I re-assign EPSG:28355 in MI/GM/QGIS
GLOBAL_MAPPER_SCRIPT VERSION=1.00

/ Creative Commons 3.0 by George Corea (coreagc@gmail.com)
/ Created for Mangoesmapping SET_LOG_FILE FILENAME="e:\Scratch\gms\gm.log" DEFINE_PROJ PROJ_NAME="UTM_ZONE-55_GDA_94_AUSTRALIAN_GEODETIC_1994"
Projection UTM
Datum GDA94
Zunits NO
Units METERS
Zone -55
Xshift 0.000000
Yshift 0.000000
Parameters
END_DEFINE_PROJ DIR_LOOP_START DIRECTORY=E:\mangoesmapping\DouglasContours FILENAME_MASKS="*.tab"
LOAD_PROJECTION PROJ_NAME="UTM_ZONE-55_GDA_94_AUSTRALIAN_GEODETIC_1994"
IMPORT FILENAME="%FNAME_W_DIR%" PROJ="UTM_ZONE-55_GDA_94_AUSTRALIAN_GEODETIC_1994"
EDIT_VECTOR COMPARE_STR="Contour_Type!=minor" STYLE_ATTR="LINE_STYLE=SOLID" STYLE_ATTR="LINE_WIDTH=2" STYLE_ATTR="LINE_COLOR=RGB(255,192,0)"
EDIT_VECTOR COMPARE_STR="Contour_Type=minor" STYLE_ATTR="LINE_STYLE=SOLID" STYLE_ATTR="LINE_WIDTH=1" STYLE_ATTR="LINE_COLOR=RGB(255,192,0)"
EXPORT_VECTOR FILENAME="E:\mangoesmapping\DouglasContours\style\%FNAME_WO_EXT%.tab" TYPE=Mapinfo INC_LAYER_ATTR=NO INC_ELEV_ATTR=YES PROJ="UTM_ZONE-55_GDA_94_AUSTRALIAN_GEODETIC_1994"
UNLOAD_ALL
DIR_LOOP_END

Answers

  • George Chandeep Corea
    George Chandeep Corea Global Mapper User Trusted User
    edited December 2015
    Also tried with PROJ_EPSG_CODE=28355 in the IMPORT and EXPORT commands

    It is fine when I use the batch reproject feature in GM so I don't understand why the output from the script gets reported as "projection is Non-Earth (meters)" in MI and once batch reproject is done it is correct "projection is MGA Zone 55(GDA 94)"
  • bmg_bob
    bmg_bob Global Mapper Programmer
    What version of Global Mapper are you using?

    What is the native projection in the TAB files?  You don't necessarily need to specify the PROJ parameter on the IMPORT statement.  Global Mapper will read the native projection from the TAB file, and reproject to the current projection (as indicated in the LOAD_PROJECTION command).  If you do specify the PROJ parameter on the IMPORT command, the data will be treated as if it is using that projection, even if the native projection is something different.  

    Can you post a zip archive containing one of the TAB files you are working with?
  • George Chandeep Corea
    George Chandeep Corea Global Mapper User Trusted User
    I only added the Load_Projection and PROJ commands as I thought it didn't work because these weren't there. I initially tested without them and they both give the same error.

    I am on GM16

    Contours_Vertical_Slice - is just the raw data
    ContourStyle_ is the the data after processing via the GMS.

    We are in EPSG28355 and the raw data is in this format.
  • bmg_bob
    bmg_bob Global Mapper Programmer
    Answer ✓
    I modified your script to look like this:
    GLOBAL_MAPPER_SCRIPT VERSION=1.00
    / Creative Commons 3.0 by George Corea (coreagc@gmail.com)
    / Created for Mangoesmapping
    SET_LOG_FILE FILENAME="gm.log"
    DIR_LOOP_START DIRECTORY="<input folder>" FILENAME_MASKS="*.tab"
    IMPORT FILENAME="%FNAME_W_DIR%" TYPE=MAPINFO PROJ="EPSG:28355"
    EDIT_VECTOR COMPARE_STR="Contour_Type!=minor" STYLE_ATTR="LINE_STYLE=SOLID" STYLE_ATTR="LINE_WIDTH=2" STYLE_ATTR="LINE_COLOR=RGB(255,192,0)"
    EDIT_VECTOR COMPARE_STR="Contour_Type=minor" STYLE_ATTR="LINE_STYLE=SOLID" STYLE_ATTR="LINE_WIDTH=1" STYLE_ATTR="LINE_COLOR=RGB(255,192,0)"
    EXPORT_VECTOR FILENAME="<output folder>\%FNAME_WO_EXT%.tab" TYPE=Mapinfo INC_LAYER_ATTR=NO INC_ELEV_ATTR=YES PROJ="EPSG:28355"
    UNLOAD_ALL
    DIR_LOOP_END
    After I ran it on the files you provided, the output files lined up with the input files in Global Mapper 16.  I didn't try QGIS or Mapinfo.