Map Coordinates on Map View Tab

1589
1
10-18-2012 06:59 AM
MikeJohnson2
New Contributor
Greetings,

I created a feature class (polygon) in the WMX.JTX_JOBS_AOI table based on user entered bounding box coordinates from a custom tab.  The AOI is being displayed in the Map View list and on the map in the AOI tab but the polygon does not appear to be in the right location.

Here is the coordinate system:

ISpatialReferenceFactory spatialReferenceFactory = new SpatialReferenceEnvironmentClass();
IGeographicCoordinateSystem geographicCoordinateSystem = spatialReferenceFactory.CreateGeographicCoordinateSystem((int)esriSRGeoCSType.esriSRGeoCS_WGS1984);

The data entered as latitude/longitude Decimal Degrees:  
top: 40.0  (representing the northern latitude)
bottom: 30.0  (representing the southern latitude)
left: -100.0  (representing the western longitude)
right: -90.0  (representing the eastern longitude)

Is there something specific that needs to be set?

Thanks,

Mike
0 Kudos
1 Reply
KevinBedel
Esri Contributor
Hi Mike,

Are you also setting the coordinate system on the new feature? For example:

ISpatialReferenceFactory spatialReferenceFactory = new SpatialReferenceEnvironmentClass();
IGeographicCoordinateSystem geoCoordSystem = spatialReferenceFactory.CreateGeographicCoordinateSystem((int)esriSRGeoCSType.esriSRGeoCS_WGS1984);
                                        
pMyAOI.SpatialReference = (ISpatialReference)geoCoordSystem;


You also said you are doing this in a custom tab. How are you then storing the AOI? Are you just using the IJTXJob.AOIExtent property to set the value? If so, you will also need to project your new AOI to the same coordinate system that the AOI feature class is using.

Kevin
0 Kudos