Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Wrong projection between WGS84 and GDM2000/Peninsular RSO #173

Closed
bladegun opened this issue Feb 18, 2016 · 4 comments
Closed

Wrong projection between WGS84 and GDM2000/Peninsular RSO #173

bladegun opened this issue Feb 18, 2016 · 4 comments

Comments

@bladegun
Copy link

When converting between WGS84 and GDM2000/Peninsular RSO (EPSG:3375), result from proj4js are very different from the one produced by cs2cs or PostGIS.

Here is my code:

proj4.defs('EPSG:3375', '+proj=omerc +lat_0=4 +lonc=102.25 +alpha=323.0257964666666 +k=0.99984 +x_0=804671 +y_0=0 +no_uoff +gamma=323.1301023611111 +ellps=GRS80 +units=m +no_defs');

var c = proj4('EPSG:3375', 'EPSG:4326').forward([410042.053264524, 340750.457263734]);
// c is [98.6785691176469, 7.071110215716101]

With cs2cs:

cs2cs +proj=omerc +lat_0=4 +lonc=102.25 +alpha=323.0257964666666 +k=0.99984 +x_0=804671 +y_0=0 +no_uoff +gamma=323.1301023611111 +ellps=GRS80 +units=m +no_defs +to +proj=longlat +datum=WGS84 +no_defs
410042.053264524 340750.457263734
101d41'12.348"E 3d4'44.25"N 0.000

With PostGIS 2.2:

SELECT ST_AsText(ST_Transform(ST_SetSRID(ST_MakePoint(410042.053264524, 340750.457263734), 3375), 4326))

I get POINT(101.6867634 3.07895829999971). This matches the result from cs2cs.

It seems proj4js is having problem converting omerc projection. Is this a bug or something is wrong in the proj4 definition string?

@bladegun bladegun closed this as completed Apr 4, 2017
@calvinmetcalf
Copy link
Member

did you intend to close this ?

@bladegun
Copy link
Author

bladegun commented Apr 5, 2017 via email

@jratike80
Copy link

Why did you close the issue? Did you find that you did something wrong, does the issue not happen any more or what? Other users have similar problems.

@bladegun
Copy link
Author

Initially I thought that the wrong conversion was caused by a bug. Then, I found out that it was not possible to implement such a conversion in a JavaScript library. So, I closed this issue.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants