Zoom goes to wrong place on Map

748
1
09-26-2017 11:34 AM
Labels (1)
UteWillmore
New Contributor

I am trying to zoom to a layer I just added to my map and I am having a heck of a time this this simple task. I am using ArcGIS WPF API 10.2.5.0 and arcGisLocalDynamicMapServiceLayer to add layers to a map. The application always adds 2 defaults layers at startup and allows the user to add layers at run time. I need to zoom to that last layer added after the user added it.

I started out trying to use map.Layers.GetFullExtent to determine the zoom but the extent coordinates for XMax, XMin, YMax, YMin end up covering the entire map. I believe that is the case because one of the default layers added at startup is the map it self. So using GetFullExtent doesn't work for me, because I have a graphic layer that is a world map. 

So I started looking at the shape files themselves, trying to find the Min and Max X-Y coordinates for the added shape, so I could use that to zoom to the shape. But for some reason the extent coordinates for the shapes I am using, zoom to some place in Nigeria in West Afrika, although my shape is a line located in Atlanta, GA! 

Since I am new to GIS and shape files, I suspect I am missing something crucial and I am hoping some one here can help me out. 

The extent for my shape shows this max and min values:

xMin,yMin 340458.64,1314058.62
xMax,yMax 348079.77,1327565.27

I use the values to create an envelope, which I pass to map.zoomTo(). For now the values are hard coded and the code looks like this: 

ESRI.ArcGIS.Client.Geometry.Envelope myEnvelope = new ESRI.ArcGIS.Client.Geometry.Envelope( 340458.64361572266, 1314058.6218261719, 348079.77261572267, 1327565.2654261719 );

 esriMap.ZoomTo( myEnvelope );

So why do these coordinates zoom to Afrika when the shape is in Atlanta, GA? 

What am I doing wrong?

Thanks for any help you can give me!

URW

Tags (2)
0 Kudos
1 Reply
UteWillmore
New Contributor

By now I have been trying all kinds of stuff to get this to work, with no success. My map needs Lat/Lon coordinates but I can't figure out the coordinate system my shape file uses. I found a .prj file for my shape file, and tried to find the coordinate system on the ESRII pages that list the projected and geographic coordinate system, but couldn't find one that matched the values in my project file. I found one that was close, but when I tried the WKID for that system, I got an exception saying the coordinate system was invalid.

The info in the project file looks like this:

PROJCS["NAD_1983_Lambert_Conformal_Conic",
GEOGCS["GCS_North_American_1983",
DATUM["D_North_American_1983",
SPHEROID["GRS_1980",6378137.0,298.257222101]],
PRIMEM["Greenwich",0.0],
UNIT["Degree",0.0174532925199433]],
PROJECTION["Lambert_Conformal_Conic"],
PARAMETER["False_Easting",656166.6666666665],
PARAMETER["False_Northing",0.0],
PARAMETER["Central_Meridian",-83.5],
PARAMETER["Standard_Parallel_1",31.41666666666667],
PARAMETER["Standard_Parallel_2",34.28333333333333],
PARAMETER["Latitude_Of_Origin",30.25],
UNIT["Foot_US",0.3048006096012192]]

Does anyone know the WKID for this coordinate system? How do I convert the x/y values to lat/lon value?

Any help would be greatly appreciated.

TIA

URW

0 Kudos