Error: Conversion of one or more geometries failed. Please check whether input is valid. Invalid argument

3977
1
Jump to solution
05-07-2016 12:57 PM
Shaulezrac
New Contributor

I'm trying to convert a Point to anything else but every function i use gives me the same error:

Error: Conversion of one or more geometries failed. Please check whether input is valid. Invalid argument

Point identifyPoint = mapview.toMapPoint(e.getX(), e.getY()); 
String s = CoordinateConversion.pointToDecimalDegrees(identifyPoint, mapview.getSpatialReference(), 2);

This is the code i'm using, What am i doing wrong here?

Tags (1)
0 Kudos
1 Solution

Accepted Solutions
ShellyGill1
Esri Contributor

Looks like you're probably getting the toMapPoint arguments from a map touch listener, but what are the typical Point X,Y coordinates you're ending up with? I wonder if you have a wrap-around map, and you're tapping in a location after having panned over to a repeat of the map? If so, I just tested, and I see this error. So if you're dealing with this situation, then you can call GeometryEngine.normalizeCentralMeridian, to correct the map coordinates back to within the domain of the SpatialReference, and then use that returned Geometry to pass to the CoordinateConversion method. Let me know if this helps or not.

Regards,

Shelly

View solution in original post

0 Kudos
1 Reply
ShellyGill1
Esri Contributor

Looks like you're probably getting the toMapPoint arguments from a map touch listener, but what are the typical Point X,Y coordinates you're ending up with? I wonder if you have a wrap-around map, and you're tapping in a location after having panned over to a repeat of the map? If so, I just tested, and I see this error. So if you're dealing with this situation, then you can call GeometryEngine.normalizeCentralMeridian, to correct the map coordinates back to within the domain of the SpatialReference, and then use that returned Geometry to pass to the CoordinateConversion method. Let me know if this helps or not.

Regards,

Shelly

0 Kudos