MGRS to Point Method does not work!

762
4
03-25-2013 06:01 AM
adityamehta
New Contributor
i am trying to convert to a AGSPoint from a MGRS grid String. But the function -(AGSPoint*)pointFromMGRS:(NSString*)mgrs; does not return the point! It Crashes the App!
the Error is :

Assertion failed: (m_ptr), function operator->, file /Source/borg/share/SharedArcGIS/Include/GeometryXLib/PlatformBase.h, line 369.

i have tried to put the grid string in many different formats and also to supply the it as following:


AGSPoint *point2 =[geometryEngine pointFromMGRS:[engine mgrsFromPoint:point1 numDigits:9 rounding:NO addSpaces:YES]];

But still the app crashed!

Could you please help me with this!

Thank you
0 Kudos
4 Replies
NimeshJarecha
Esri Regular Contributor
Please post MSGR string and point you are using for both methods so I can look into it.

Regards,
Nimesh
0 Kudos
adityamehta
New Contributor
Thank you Nimesh for replying.
Following is the coordinates and value for MGRS i am passing. When i try to get the value for mgrsFromPoint method i get "40R BN 38 09" and this is the same MGRS coordinate string i pass for the pointToMGRS method which again returns the above mentioned error!

AGSPoint *point=[[AGSPoint alloc]initWithX:54.4166351 y:24.4787678 spatialReference:self.mapView.spatialReference];
NSLog(@"%@",[engine mgrsFromPoint:point numDigits:2 rounding:NO addSpaces:YES]);
NSLog(@"%@",[engine pointFromMGRS:@"40R BN 38 09"]);

Note : I am using the ArcGIS Runtime SDK for iOS v 2.3.2 for my project. I even tried if this works in 10.1.1 but the same error came up. Please help.

Thanks and Regards
Aditya
0 Kudos
NimeshJarecha
Esri Regular Contributor
Thanks for the info. I'll look into it.

Regards,
Nimesh
0 Kudos
NimeshJarecha
Esri Regular Contributor
I confirm that this is a bug. We'll fix it in the future version of the SDK.

Regards,
Nimesh
0 Kudos