Opened 9 years ago

Closed 9 years ago

Last modified 9 years ago

#5846 closed defect (fixed)

PROJ4 lat/lon parameters reversed for SRS_PT_HOTINE_OBLIQUE_MERCATOR_TWO_POINT_NATURAL_ORIGIN mapping

Reported by: terryl850 Owned by: Kyle Shannon
Priority: normal Milestone: 2.0.0
Component: OGR_SRS Version: 1.11.1
Severity: normal Keywords:
Cc:

Description (last modified by Kyle Shannon)

The two point locations appear incorrectly mapped to PROJ4 parameters:

    else if( EQUAL(pszProjection,
                   SRS_PT_HOTINE_OBLIQUE_MERCATOR_TWO_POINT_NATURAL_ORIGIN) )
    {
        sprintf( szProj4+strlen(szProj4),
                 "+proj=omerc +lat_0=%.16g"
                 " +lon_1=%.16g +lat_1=%.16g +lon_2=%.16g +lat_2=%.16g"
                 " +k=%.16g +x_0=%.16g +y_0=%.16g ",
                 GetNormProjParm(SRS_PP_LATITUDE_OF_ORIGIN,0.0),
                 GetNormProjParm(SRS_PP_LATITUDE_OF_POINT_1,0.0),
                 GetNormProjParm(SRS_PP_LONGITUDE_OF_POINT_1,0.0),
                 GetNormProjParm(SRS_PP_LATITUDE_OF_POINT_2,0.0),
                 GetNormProjParm(SRS_PP_LONGITUDE_OF_POINT_2,0.0),
                 GetNormProjParm(SRS_PP_SCALE_FACTOR,1.0),
                 GetNormProjParm(SRS_PP_FALSE_EASTING,0.0),
                 GetNormProjParm(SRS_PP_FALSE_NORTHING,0.0) );
    }

Change History (3)

comment:1 by Kyle Shannon, 9 years ago

Description: modified (diff)
Milestone: 1.11.3
Owner: changed from warmerdam to Kyle Shannon
Status: newassigned

terryl850,

At first glance, it appears that the order is wrong. I tried to test using EPSG 54025:

kyle@kyle-hp-laptop:~/src/gdal/trunk/gdal$ gdalsrsinfo EPSG:54025

PROJ.4 : '+proj=omerc +lat_0=40 +lon_1=0 +lat_1=0 +lon_2=0 +lat_2=0 +k=1 +x_0=0 +y_0=0 +datum=WGS84 +units=m +no_defs '

OGC WKT :
PROJCS["World_Hotine",
    GEOGCS["GCS_WGS_1984",
        DATUM["WGS_1984",
            SPHEROID["WGS_1984",6378137,298.257223563]],
        PRIMEM["Greenwich",0],
        UNIT["Degree",0.017453292519943295]],
    PROJECTION["Hotine_Oblique_Mercator_Two_Point_Natural_Origin"],
    PARAMETER["False_Easting",0],
    PARAMETER["False_Northing",0],
    PARAMETER["Latitude_Of_1st_Point",0],
    PARAMETER["Latitude_Of_2nd_Point",60],
    PARAMETER["Scale_Factor",1],
    PARAMETER["Longitude_Of_1st_Point",0],
    PARAMETER["Longitude_Of_2nd_Point",60],
    PARAMETER["Latitude_Of_Center",40],
    UNIT["Meter",1],
    AUTHORITY["EPSG","54025"]]

It looks like we may have a parsing issue as well. When I sort out the parsing, I'll make your fix and add a test.

comment:2 by Even Rouault, 9 years ago

Milestone: 1.11.32.0
Resolution: fixed
Status: assignedclosed

trunk r29114 "exportToProj4(): fix inverted lat/long of 1st and 2nd point, and accept Point_1/1st_Point naming convention (#5846)"

However proj.4 doesn't support lat_1=0 for this variant of hotine oblique mercator...

This is also somehow linked to issue #3641 for the naming convention

comment:3 by Even Rouault, 9 years ago

Milestone: 2.02.0.0

Milestone renamed

Note: See TracTickets for help on using tickets.