From 1czajnik at gmail.com Mon Nov 19 06:14:22 2012 From: 1czajnik at gmail.com (Krzysztof Czainski) Date: Mon, 19 Nov 2012 15:14:22 +0100 Subject: [Proj4j] XY -> LongLat proj=stere: org.osgeo.proj4j.ConvergenceFailureException Message-ID: Hello, I am trying to convert coordinates XY <-> LongLat. All points are expected to be near a specified point, let's say LongLat(21,52). Converting LongLat -> XY works for me, but XY -> LongLat throws org.osgeo.proj4j.ConvergenceFailureException. Here are the projection parameters: final String fromParams = "+proj=stere +ellps=WGS84 +lon_0=21.00000000 +lat_0=52.00000000 +no_defs"; final String toParams = "+proj=longlat +ellps=WGS84 +no_defs"; The attached MyTest.java demonstrates my problem. Running it prints: .E Time: 0,047 There was 1 error: 1) test(org.osgeo.proj4j.MyTest)org.osgeo.proj4j.ConvergenceFailureException: Iteration didn't converge at org.osgeo.proj4j.proj.StereographicAzimuthalProjection.projectInverse(StereographicAzimuthalProjection.java:240) at org.osgeo.proj4j.proj.Projection.inverseProjectRadians(Projection.java:308) at org.osgeo.proj4j.BasicCoordinateTransform.transform(BasicCoordinateTransform.java:119) at org.osgeo.proj4j.MyTest.test(MyTest.java:27) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source) at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source) at org.osgeo.proj4j.MyTest.main(MyTest.java:9) FAILURES!!! Tests run: 1, Failures: 0, Errors: 1 What am I doing wrong? Thanks in advance for any help with this, Kris -------------- next part -------------- An HTML attachment was scrubbed... URL: -------------- next part -------------- A non-text attachment was scrubbed... Name: MyTest.java Type: application/octet-stream Size: 1259 bytes Desc: not available URL: From mtnclimb at gmail.com Mon Nov 19 09:28:50 2012 From: mtnclimb at gmail.com (Martin Davis) Date: Mon, 19 Nov 2012 09:28:50 -0800 Subject: [Proj4j] XY -> LongLat proj=stere: org.osgeo.proj4j.ConvergenceFailureException In-Reply-To: References: Message-ID: Hmmm, probably a bug - but I'll have to dig into it to see. Can you try the same conversion in Proj4 to see if it works? And it would be helpful to have the expected output. On Mon, Nov 19, 2012 at 6:14 AM, Krzysztof Czainski <1czajnik at gmail.com>wrote: > Hello, > > I am trying to convert coordinates XY <-> LongLat. All points are expected > to be near a specified point, let's say LongLat(21,52). > > Converting LongLat -> XY works for me, but XY -> LongLat throws > org.osgeo.proj4j.ConvergenceFailureException. Here are the projection > parameters: > > final String fromParams = "+proj=stere +ellps=WGS84 +lon_0=21.00000000 > +lat_0=52.00000000 +no_defs"; > final String toParams = "+proj=longlat +ellps=WGS84 +no_defs"; > > The attached MyTest.java demonstrates my problem. Running it prints: > > .E > Time: 0,047 > There was 1 error: > 1) > test(org.osgeo.proj4j.MyTest)org.osgeo.proj4j.ConvergenceFailureException: > Iteration didn't converge > at > org.osgeo.proj4j.proj.StereographicAzimuthalProjection.projectInverse(StereographicAzimuthalProjection.java:240) > at > org.osgeo.proj4j.proj.Projection.inverseProjectRadians(Projection.java:308) > at > org.osgeo.proj4j.BasicCoordinateTransform.transform(BasicCoordinateTransform.java:119) > at org.osgeo.proj4j.MyTest.test(MyTest.java:27) > at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) > at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source) > at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source) > at org.osgeo.proj4j.MyTest.main(MyTest.java:9) > > FAILURES!!! > Tests run: 1, Failures: 0, Errors: 1 > > What am I doing wrong? > > Thanks in advance for any help with this, > Kris > > _______________________________________________ > Proj4j mailing list > Proj4j at lists.osgeo.org > http://lists.osgeo.org/mailman/listinfo/proj4j > > -------------- next part -------------- An HTML attachment was scrubbed... URL: From 1czajnik at gmail.com Mon Nov 19 10:13:18 2012 From: 1czajnik at gmail.com (Krzysztof Czainski) Date: Mon, 19 Nov 2012 19:13:18 +0100 Subject: [Proj4j] XY -> LongLat proj=stere: org.osgeo.proj4j.ConvergenceFailureException In-Reply-To: References: Message-ID: > > On Mon, Nov 19, 2012 at 6:14 AM, Krzysztof Czainski <1czajnik at gmail.com>wrote: > >> Hello, >> >> I am trying to convert coordinates XY <-> LongLat. All points are >> expected to be near a specified point, let's say LongLat(21,52). >> >> Converting LongLat -> XY works for me, but XY -> LongLat throws >> org.osgeo.proj4j.ConvergenceFailureException. Here are the projection >> parameters: >> >> final String fromParams = "+proj=stere +ellps=WGS84 +lon_0=21.00000000 >> +lat_0=52.00000000 +no_defs"; >> final String toParams = "+proj=longlat +ellps=WGS84 +no_defs"; >> >> The attached MyTest.java demonstrates my problem. Running it prints: >> >> .E >> Time: 0,047 >> There was 1 error: >> 1) >> test(org.osgeo.proj4j.MyTest)org.osgeo.proj4j.ConvergenceFailureException: >> Iteration didn't converge >> at >> org.osgeo.proj4j.proj.StereographicAzimuthalProjection.projectInverse(StereographicAzimuthalProjection.java:240) >> at >> org.osgeo.proj4j.proj.Projection.inverseProjectRadians(Projection.java:308) >> at >> org.osgeo.proj4j.BasicCoordinateTransform.transform(BasicCoordinateTransform.java:119) >> at org.osgeo.proj4j.MyTest.test(MyTest.java:27) >> at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) >> at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source) >> at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source) >> at org.osgeo.proj4j.MyTest.main(MyTest.java:9) >> >> FAILURES!!! >> Tests run: 1, Failures: 0, Errors: 1 >> >> What am I doing wrong? >> >> Thanks in advance for any help with this, >> Kris >> > 2012/11/19 Martin Davis > Hmmm, probably a bug - but I'll have to dig into it to see. Thanks for the reply and for looking into this, Martin ;) > Can you try the same conversion in Proj4 to see if it works? > Ok. Please see the attached file my_test.c. It works as expected with proj-4.7.0 > And it would be helpful to have the expected output. > MyTest.java contains a TestCase, so the expected output is something like: . Time: 0 OK (1 test) If you mean, the expected output of the conversion, it is lon=21, lat=52. If the output lon/lat are in radians instead, that's OK too - I don't really know exactly what to expect ;-) Cheers, Kris -------------- next part -------------- An HTML attachment was scrubbed... URL: -------------- next part -------------- A non-text attachment was scrubbed... Name: my_test.c Type: text/x-csrc Size: 913 bytes Desc: not available URL: From mtnclimb at gmail.com Mon Nov 19 10:42:07 2012 From: mtnclimb at gmail.com (Martin Davis) Date: Mon, 19 Nov 2012 10:42:07 -0800 Subject: [Proj4j] XY -> LongLat proj=stere: org.osgeo.proj4j.ConvergenceFailureException In-Reply-To: References: Message-ID: On Mon, Nov 19, 2012 at 10:13 AM, Krzysztof Czainski <1czajnik at gmail.com>wrote: > >> > >> Can you try the same conversion in Proj4 to see if it works? >> > > Ok. Please see the attached file my_test.c. It works as expected with > proj-4.7.0 > Ok, that's good. Hopefully that will make it easier to compare results to find the bug. > > >> And it would be helpful to have the expected output. >> > > If you mean, the expected output of the conversion, it is lon=21, lat=52. > If the output lon/lat are in radians instead, that's OK too - I don't > really know exactly what to expect ;-) > Yes, that's what I meant. Doh - makes sense that that is the output for this case! > -------------- next part -------------- An HTML attachment was scrubbed... URL: From mtnclimb at gmail.com Mon Nov 19 23:02:59 2012 From: mtnclimb at gmail.com (Martin Davis) Date: Mon, 19 Nov 2012 23:02:59 -0800 Subject: [Proj4j] XY -> LongLat proj=stere: org.osgeo.proj4j.ConvergenceFailureException In-Reply-To: References: Message-ID: This turned out to be a porting bug in the StereographicAzimuthal projection. It's now fixed in SVN. Also fixed is a bug in the Robinson projection (PROJ4 #133). On Mon, Nov 19, 2012 at 6:14 AM, Krzysztof Czainski <1czajnik at gmail.com>wrote: > Hello, > > I am trying to convert coordinates XY <-> LongLat. All points are expected > to be near a specified point, let's say LongLat(21,52). > > Converting LongLat -> XY works for me, but XY -> LongLat throws > org.osgeo.proj4j.ConvergenceFailureException. Here are the projection > parameters: > > final String fromParams = "+proj=stere +ellps=WGS84 +lon_0=21.00000000 > +lat_0=52.00000000 +no_defs"; > final String toParams = "+proj=longlat +ellps=WGS84 +no_defs"; > > The attached MyTest.java demonstrates my problem. Running it prints: > > .E > Time: 0,047 > There was 1 error: > 1) > test(org.osgeo.proj4j.MyTest)org.osgeo.proj4j.ConvergenceFailureException: > Iteration didn't converge > at > org.osgeo.proj4j.proj.StereographicAzimuthalProjection.projectInverse(StereographicAzimuthalProjection.java:240) > at > org.osgeo.proj4j.proj.Projection.inverseProjectRadians(Projection.java:308) > at > org.osgeo.proj4j.BasicCoordinateTransform.transform(BasicCoordinateTransform.java:119) > at org.osgeo.proj4j.MyTest.test(MyTest.java:27) > at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) > at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source) > at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source) > at org.osgeo.proj4j.MyTest.main(MyTest.java:9) > > FAILURES!!! > Tests run: 1, Failures: 0, Errors: 1 > > > -------------- next part -------------- An HTML attachment was scrubbed... URL: From 1czajnik at gmail.com Tue Nov 20 02:24:04 2012 From: 1czajnik at gmail.com (Krzysztof Czainski) Date: Tue, 20 Nov 2012 11:24:04 +0100 Subject: [Proj4j] XY -> LongLat proj=stere: org.osgeo.proj4j.ConvergenceFailureException In-Reply-To: References: Message-ID: Thanks, I confirmed it works for me too ;-) Kris 2012/11/20 Martin Davis > This turned out to be a porting bug in the StereographicAzimuthal > projection. It's now fixed in SVN. > > Also fixed is a bug in the Robinson projection (PROJ4 #133). > > > On Mon, Nov 19, 2012 at 6:14 AM, Krzysztof Czainski <1czajnik at gmail.com>wrote: > >> Hello, >> >> I am trying to convert coordinates XY <-> LongLat. All points are >> expected to be near a specified point, let's say LongLat(21,52). >> >> Converting LongLat -> XY works for me, but XY -> LongLat throws >> org.osgeo.proj4j.ConvergenceFailureException. Here are the projection >> parameters: >> >> final String fromParams = "+proj=stere +ellps=WGS84 +lon_0=21.00000000 >> +lat_0=52.00000000 +no_defs"; >> final String toParams = "+proj=longlat +ellps=WGS84 +no_defs"; >> >> The attached MyTest.java demonstrates my problem. Running it prints: >> >> .E >> Time: 0,047 >> There was 1 error: >> 1) >> test(org.osgeo.proj4j.MyTest)org.osgeo.proj4j.ConvergenceFailureException: >> Iteration didn't converge >> at >> org.osgeo.proj4j.proj.StereographicAzimuthalProjection.projectInverse(StereographicAzimuthalProjection.java:240) >> at >> org.osgeo.proj4j.proj.Projection.inverseProjectRadians(Projection.java:308) >> at >> org.osgeo.proj4j.BasicCoordinateTransform.transform(BasicCoordinateTransform.java:119) >> at org.osgeo.proj4j.MyTest.test(MyTest.java:27) >> at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) >> at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source) >> at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source) >> at org.osgeo.proj4j.MyTest.main(MyTest.java:9) >> >> FAILURES!!! >> Tests run: 1, Failures: 0, Errors: 1 >> >> >> > > _______________________________________________ > Proj4j mailing list > Proj4j at lists.osgeo.org > http://lists.osgeo.org/mailman/listinfo/proj4j > > -------------- next part -------------- An HTML attachment was scrubbed... URL: