Ticket #38 (closed defect: invalid)

Opened 4 years ago

Last modified 4 years ago

Error converting WGS84 lat long to RSO Malaya (m), ref closed ticket #37

Reported by: bjorn Owned by: warmerdam
Priority: major Milestone:
Component: InitializationFiles Version: unspecified
Keywords: datum shift Cc:

Description

I have found datum shift parameters (+towgs84=-11,851,5). Using cs2cs version 4.4.6: cs2cs +proj=longlat +ellps=WGS84 +no_defs +to +proj=omerc +lat_0 =4 +lonc=102.25 +alpha=323.0257905 +towgs84=-11,851,5 +k=0.99984 +x_0=804670.24 +y_0=0 +a=6377295.664 +b=6356094.667915204 +units=m +no_uoff +rot_conv +no_defs The output coords are: 419628.08 353674.74

Using cs2cs version 4.6.1 gives the same result.(also without the +towgs84 parameter)

Using C# together with old libraries with the following code: inpWgs84.ImportFromProj?4("+proj=longlat +ellps=WGS84 +no_defs <>"); outRSO.ImportFromProj?4("+proj=omerc +lat_0=4 +lonc=102.25 +alpha=323.0257905 +k=0.99984 +x_0=804670.24 +y_0=0 +a=6377295.664 +b=6356094.667915204 +towgs84=-11,851,5,0,0,0,0 +units=m +no_uoff +rot_conv +wktext +no_defs <>");

The result E: 419791.024 N: 353715.943 is very close to what I espect. (dx=0.73 dy=0.13)

C# using 4.6.1 libraries (from FWTools2.3.0): The code is the same as with the old libraries: Now the result is E= 419628.127 N: 353695.117. Removing +towgs84 in the +to string the result remains the same.

This is still far from the expected result (E:419719.755 N:353716.076)

As far as I can se the only way to get close to the correct result is to use the old libraries in C#.

I am not getting correct results by using version 4.6.1 as Frank Warmerdam said in ticket #37.

Change History

Changed 4 years ago by jcrepetto

  • status changed from new to closed
  • resolution set to invalid

As Franck explained in ticket #37, starting with PROJ 4.6 you must specify both datums. You have specified the second datum only, that's why the transformation has not been applied.

Try this string instead : +proj=longlat +datum=WGS84 +no_defs +to +proj=omerc +lat_0=4 +lonc=102.25 +alpha=323.0257905 +towgs84=-11,851,5 +k=0.99984 +x_0=804670.24 +y_0=0 +a=6377295.664 +b=6356094.667915204 +units=m +no_uoff +rot_conv +no_defs

The result is 419791.03 353715.94 (with PROJ 4.6.1)

Note: See TracTickets for help on using tickets.