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

New Zealand Map Grid not working. #62

Closed
scaddenp opened this issue Jul 20, 2020 · 6 comments · Fixed by #64
Closed

New Zealand Map Grid not working. #62

scaddenp opened this issue Jul 20, 2020 · 6 comments · Fixed by #64
Labels

Comments

@scaddenp
Copy link
Contributor

  ```

CRSFactory crsf = new CRSFactory();
CoordinateTransformFactory ctf = new CoordinateTransformFactory();
CoordinateReferenceSystem epsg4326 = crsf.createFromName("EPSG:4326");
CoordinateReferenceSystem crs = crsf.createFromName("EPSG:27200)); //NZ Map grid
CoordinateTransform toEPSG4326 = ctf.createTransform(crs,epsg4326);
ProjCoordinate inputPt = new ProjCoordinate(2939247.5, 6752871.3); // should return lon 177.65067, lat -34.3252
ProjCoordinate outputPt = new ProjCoordinate();
toEPSG4326.transform(inputPt, outputPt);


This is throwing error (latitude is out of range). 
@scaddenp
Copy link
Contributor Author

proj4js code does work however.

@scaddenp scaddenp reopened this Jul 20, 2020
@pomadchin pomadchin added the bug label Jul 20, 2020
@pomadchin
Copy link
Member

pomadchin commented Jul 20, 2020

Hi @scaddenp thanks for reporting about this bug! We'll look into it a bit later.
Don't hesistate to create a PR with backporting proj4js / proj (c library) fixes to that projection! Proj4j definitely requires some love and is really far from being ideal.

@scaddenp
Copy link
Contributor Author

Absolutely looking for what is wrong. And also looking at the test system.

@scaddenp
Copy link
Contributor Author

Not doing well at this. no obvious issue in line by line compare with the C code. The problem looks to be from zpoly1d getting bad value for dst.x. proj4js implementation is very different so not easy to compare at all. Spent much of today trying to get proj4 C running on old VS 2010 without much luck. The old version of source that compiles ok need proj_def.dat files no longer seem to be available and not part of source distribution. Any pointers welcome.

@scaddenp
Copy link
Contributor Author

ok progress. I have proj4 c code running in the debugger in parallel. Found at least one error, looking to see if I can add a proper test before continuing. Next step, learn how to use github.

@scaddenp
Copy link
Contributor Author

I have created pull request but I see it is rejected because I have not signed off commits. (I have signed ECA). I cannot find a way to do this with github. I do not have git installed on my machine and I have no intention of doing so just to help fix a bug. Can this be done within Github.

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

Successfully merging a pull request may close this issue.

2 participants