locationtech / proj4j

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

NullPointerException on transform() when using CoordinateReferenceSystem.CS_GEO #56

Open oshai opened 4 years ago

oshai commented 4 years ago

Hi, Were trying to upgrade to this library from lib:proj4j:0.1.0 due to a bug we found that was fixed here.

We have code that transforms from EPSID:3857 to 4326by using CoordinateReferenceSystem.CS_GEO as destination.

However, it seems that in such scenario the code throws NPE on this line, because for CS_GEO projection is null.

I saw that the original code has some TODO's:

//TODO: adjust src Prime Meridian if specified
//TODO: adjust target Prime Meridian if specified

And I suspect that when fixing this TODO there is a missing null check (check if projection is null).

Am I correct? Is it possible to fix that? Should I submit a PR?