Select to view content in your preferred language

VBA: Projecting envelope Max and Min X and Y to  NAD83

661
1
04-12-2010 04:06 PM
TanAbdo
Emerging Contributor
Hi. I am using  VBA to  draw a study area box on ArcMap layer.
The layer can have **any projection**.
So far I can read the  Min and Max X and Y in the projected  system  for that box . Any ideas how to get the corresponding  values for  Min and Max X and Y   in NAD 83?

Thank you
0 Kudos
1 Reply
AnnaForrest
Emerging Contributor
You can project the shape to a new coordinate system and retrieve the new min/max x,y values using the following example...

     Dim g1 As IGeometry
     Dim pSR As ISpatialReference
     Dim pSREnv As New SpatialReferenceEnvironment

     'pick an appropriate Spatial reference here
     pSR = pSREnv.CreateProjectedCoordinateSystem(esriSRProjCSType.esriSRProjCS_NAD1983)

     'project the envelope you already have to the enw spatial reference
     g1.Project(pSR)
          
     'Now you your values from g1

Regards,
Anna
0 Kudos