Sub test() Dim factory As ISpatialReferenceFactory3 Set factory = New SpatialReferenceEnvironment Dim sr As ISpatialReference Set sr = factory.CreateProjectedCoordinateSystem(esriSRProjCS_WGS1984UTM_14N) Dim pt As IPoint Set pt = New Point Set pt.SpatialReference = sr Dim conv As IConversionMGRS Set conv = pt conv.PutCoordsFromMGRS "14SND5623735757", esriMGRSMode_USNG ' returns 556237, 3835757 MsgBox pt.X & vbCrLf & pt.Y Dim sr2 As ISpatialReference Dim proj As IProjectedCoordinateSystem Set proj = sr Set sr2 = proj.GeographicCoordinateSystem pt.Project sr2 ' returns -98.386, 34.662 MsgBox pt.X & vbCrLf & pt.Y End Sub
Aangemelde leden kunnen berichten plaatsen, updates volgen en meer. Nieuw hier? Registreer een gratis account.
Find useful guides, FAQs, and documents to help you navigate and make the most of Esri Community.