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

WGS84 to krovak #115

Closed
schneidermichal opened this issue Jul 16, 2014 · 4 comments
Closed

WGS84 to krovak #115

schneidermichal opened this issue Jul 16, 2014 · 4 comments

Comments

@schneidermichal
Copy link

Hi, I have a problem with projection from WGS84 to krovak.

Example code:

var point = [ -747963.64999999851, -1041493.3299999982 ];
proj4.defs( "EPSG:5514", "+title=Krovak +proj=krovak +lat_0=49.5 +lon_0=24.83333333333333 +alpha=30.28813972222222 +k=0.9999 +x_0=0 +y_0=0 +ellps=bessel +units=m +towgs84=570.8,85.7,462.8,4.998,1.587,5.261,3.56 +no_defs" );
var coord_wgs = proj4( "EPSG:5514" ).inverse( point );
console.log( coord_wgs ); // [14.346996204306555, 50.09465901453681] - OK
var coord_jtsk = proj4( "EPSG:5514" ).forward( coord_wgs );
console.log( coord_jtsk ); // [-747983.7727820469, -1041499.9068752637] - wrong

Inverse projection is absolutely OK, but forward projection gives the resulting point on about 20 meters wrong position :-(

When I tried to use cs2cs utility with same input ([14.346996204306555, 50.09465901453681]):

cs2cs +proj=latlong +datum=WGS84 +to +proj=krovak +ellps=bessel +towgs84=570.8,85.7,462.8,4.998,1.587,5.261,3.56

then the resulting point is accurate: [-747963.65, -1041493.33]

Thank you for any advice!

@schneidermichal
Copy link
Author

adding a link to fiddle: http://jsfiddle.net/79QHW/

@xiceph
Copy link

xiceph commented Jul 29, 2014

Hi,
I noticed this problem too. I found that when the proj definition is used directly the result is correct. I update your fiddle to show this behaviour:
http://jsfiddle.net/xiceph/79QHW/1/
Unfortunately I need correct transformation with EPSG code for using together with ol3.

@calvinmetcalf
Copy link
Member

so it looks like we are duplicating something when we store it

On Tue, Jul 29, 2014 at 8:02 AM, xiceph notifications@github.com wrote:

Hi,
I noticed this problem too. I found that when the proj definition is used
directly the result is correct. I update your fiddle to show this behaviour:
http://jsfiddle.net/xiceph/79QHW/1/
Unfortunately I need correct transformation with EPSG code for using
together with ol3.


Reply to this email directly or view it on GitHub
#115 (comment).

-Calvin W. Metcalf

@schneidermichal
Copy link
Author

I think it is connected with 932ca62. I tested our example again against master and both forward tranformations are correct.

Source JTSK coordinates: -747963.6499999985,-1041493.3299999982
WGS 84 transformation: 14.346996204306555,50.09465901453681
Transformation back to JTSK: -747963.649753845,-1041493.3287851872
Difference between source and transformated JTSK: 0.00024615356232970953,0.0012148109963163733
Transformation back to JTSK (proj def): -747963.649753845,-1041493.3287851872
Difference between source and transformated JTSK (proj def): 0.00024615356232970953,0.0012148109963163733

So thanks Jachym!

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