nieltown

Issues Creating a Custom Projected Coordinate System

Discussion created by nieltown on Nov 1, 2011
Latest reply on Dec 13, 2012 by 1066design
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
  .createUnit(esriSRUnitType.esriSRUnit_Meter);
IGeographicCoordinateSystem gcs = spatialReferenceFactory
  .createGeographicCoordinateSystem(esriSRGeoCSType.esriSRGeoCS_NAD1927);
IProjectionGEN projection = (IProjectionGEN) spatialReferenceFactory
  .createProjection(esriSRProjectionType.esriSRProjection_Albers);
IParameter[] parameters = projection
  .getDefaultParameters();

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:

http://edndoc.esri.com/arcobjects/9.2/Java/54ece52a-3a53-11dc-a403-4faa7246d1c1.htm



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


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



Thanks!


John

Outcomes