Issues Creating a Custom Projected Coordinate System

11-01-2011 02:51 PM
New Contributor
Hey, Folks:

I'm trying to create a custom coordinate system using NAD27 as my GCS and Albers Equal-Area Conic as my projection.  My program throws an AutomationException with no further info when I try to execute the .define(...) method in the following code block:

ISpatialReferenceFactory spatialReferenceFactory = new SpatialReferenceEnvironment();

ILinearUnit unit = (ILinearUnit) spatialReferenceFactory
IGeographicCoordinateSystem gcs = spatialReferenceFactory
IProjectionGEN projection = (IProjectionGEN) spatialReferenceFactory
IParameter[] parameters = projection

IProjectedCoordinateSystemEdit pcsEdit = new ProjectedCoordinateSystem();

Object name = "MyProjection";
Object alias = "My Alias";
Object abbreviation = "MP";
Object remarks = "Remarky Mark and the Funky Bunch";
Object usage = "Use this projection when creating an example for the good people of the ArcGIS forums.";
Object gcsObject = gcs;
Object unitObject = unit;
Object projectionObject = projection;
Object parametersObject = parameters;

pcsEdit.define(name, alias, abbreviation, remarks, usage, gcsObject, unitObject, projectionObject, parametersObject);

When writing the above code, I followed this example:

Again, the AutomationException is thrown when I call pcsEdit.define().

Could anyone please provide guidance?  I'm pretty stumped.


0 Kudos
4 Replies
New Contributor

I copied and pasted the above example exactly (from the Esri website, linked above) and received the same exception.  Again, this is *the exact same code* as is shown in the example linked above, and I still get the AutomationException when .define(...) is called on the IProjectedCoordinateSystemEdit reference.

Is this a bug?  I'll be contacting our representative shortly to submit a service request.

Needless to say, it's pretty irritating to copy an example from a vendor website and watch it fail.  Does this stuff even get tested?
0 Kudos
New Contributor
I am having the same issue so this is obviously a bug.

Windows environment using Ganymeade Eclipse and ArcObjects 10.0.
0 Kudos
New Contributor
0 Kudos
New Contributor
0 Kudos