locationtech / proj4j

Java port of the Proj.4 library for coordinate reprojection
Other
184 stars 73 forks source link

New Zealand Map Grid not working. #62

Closed scaddenp closed 4 years ago

scaddenp commented 4 years ago
  ```

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 commented 4 years ago

proj4js code does work however.

pomadchin commented 4 years ago

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 commented 4 years ago

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

scaddenp commented 4 years ago

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 commented 4 years ago

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 commented 4 years ago

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.