iOS unable to parse UTM coordinates

562
4
10-25-2021 08:03 AM
RajH
by
New Contributor

We are using parse UTM coordinate by doc Esri

But won't able to parse UTM coordinate like -  1Q 433568 m   1978405 m

 However, i saw this is able to parse by Mapbox API.

Could you please help me to parse these coordinates?

0 Kudos
4 Replies
Nicholas-Furness
Esri Regular Contributor

Hi.

You should not have the units in there. Use something like:

let utmString = "1Q 433568 m   1978405 m"

let pt = AGSCoordinateFormatter.point(
    fromUTMString: utmString.replacingOccurrences(of: "m", with: ""),
    spatialReference: .wgs84(),
    conversionMode: .latitudeBandIndicators
)

 

That will give you a point at latitude 17.892510, longitude -177.627141, which matches what's returned here: https://awsm-tools.com/geo/utm-to-geographic

Hope that helps.

0 Kudos
RajH
by
New Contributor

Hi @Nicholas-Furness ,

The expected result would be near to Mexico (lat long -19.164950 -96.148800)

Reference -https://www.maptools.com/tutorials/utm/quick_guide

Any hint to archive this.

 

 

0 Kudos
Nicholas-Furness
Esri Regular Contributor

I'm not sure how you're converting UTM 1Q 433568 1978405 to Lat/Lon -19.164950 -96.148800 (which is in the pacific off the coast of Peru/Chile). I'm guessing you mean +19.164950 -96.148800 which is Veracruz, Mexico.

The closest I can think is that you mean 14Q 433568 1978405 (and not 1Q), which is close to Mexico city and would translate to 17.892510°‎, -99.627141°‎.

See this diagram and description of UTM Grid Zones.

RajH
by
New Contributor

Thanks @Nicholas-Furness 

0 Kudos