Skip to main content
English usage
Source Link
Vince
  • 20.3k
  • 16
  • 48
  • 65

I'm trying to create a Feature class. It showshows the error

X Y domain on the spatial reference system is not set or in valid

Here is my code attempt:

      IWorkspaceFactory wsf = new  FileGDBWorkspaceFactory();
      IWorkspace ws = wsf.OpenFromFile(@"D:\ARC OBJECTS\Newgdb.gdb", 
                       ArcMap.Application.hWnd);
      IFeatureWorkspace fws = ws as IFeatureWorkspace;
      IFields flds = new FieldsClass();
      IFieldsEdit fldsedit = flds as IFieldsEdit;
      IField fld = new FieldClass();
      IFieldEdit fldedit = fld as IFieldEdit;
      fldedit.AliasName_2 = "Shape";
      fldedit.IsNullable_2 = false;
      fldedit.Name_2 = "Shape";
      fldedit.Type_2 = esriFieldType.esriFieldTypeGeometry;
      IGeometryDef gdef = new GeometryDefClass();
      IGeometryDefEdit gdedit = gdef as IGeometryDefEdit;
      gdedit.GeometryType_2 = esriGeometryType.esriGeometryPolygon;
      gdedit.SpatialReference_2 = new UnknownCoordinateSystemClass();
      fldedit.GeometryDef_2 = gdedit;
      fldsedit.AddField(fld);
      IFeatureClass feacls= fws.CreateFeatureClass("Error", flds, null,
                          null,esriFeatureType.esriFTSimple, "shape", "");

Where did iI go wrong?

I'm trying to create a Feature class. It show the error

X Y domain on the spatial reference system is not set or in valid

Here is my code attempt:

      IWorkspaceFactory wsf = new  FileGDBWorkspaceFactory();
      IWorkspace ws = wsf.OpenFromFile(@"D:\ARC OBJECTS\Newgdb.gdb", 
                       ArcMap.Application.hWnd);
      IFeatureWorkspace fws = ws as IFeatureWorkspace;
      IFields flds = new FieldsClass();
      IFieldsEdit fldsedit = flds as IFieldsEdit;
      IField fld = new FieldClass();
      IFieldEdit fldedit = fld as IFieldEdit;
      fldedit.AliasName_2 = "Shape";
      fldedit.IsNullable_2 = false;
      fldedit.Name_2 = "Shape";
      fldedit.Type_2 = esriFieldType.esriFieldTypeGeometry;
      IGeometryDef gdef = new GeometryDefClass();
      IGeometryDefEdit gdedit = gdef as IGeometryDefEdit;
      gdedit.GeometryType_2 = esriGeometryType.esriGeometryPolygon;
      gdedit.SpatialReference_2 = new UnknownCoordinateSystemClass();
      fldedit.GeometryDef_2 = gdedit;
      fldsedit.AddField(fld);
      IFeatureClass feacls= fws.CreateFeatureClass("Error", flds, null,
                          null,esriFeatureType.esriFTSimple, "shape", "");

Where did i go wrong?

I'm trying to create a Feature class. It shows the error

X Y domain on the spatial reference system is not set or in valid

Here is my code attempt:

      IWorkspaceFactory wsf = new  FileGDBWorkspaceFactory();
      IWorkspace ws = wsf.OpenFromFile(@"D:\ARC OBJECTS\Newgdb.gdb", 
                       ArcMap.Application.hWnd);
      IFeatureWorkspace fws = ws as IFeatureWorkspace;
      IFields flds = new FieldsClass();
      IFieldsEdit fldsedit = flds as IFieldsEdit;
      IField fld = new FieldClass();
      IFieldEdit fldedit = fld as IFieldEdit;
      fldedit.AliasName_2 = "Shape";
      fldedit.IsNullable_2 = false;
      fldedit.Name_2 = "Shape";
      fldedit.Type_2 = esriFieldType.esriFieldTypeGeometry;
      IGeometryDef gdef = new GeometryDefClass();
      IGeometryDefEdit gdedit = gdef as IGeometryDefEdit;
      gdedit.GeometryType_2 = esriGeometryType.esriGeometryPolygon;
      gdedit.SpatialReference_2 = new UnknownCoordinateSystemClass();
      fldedit.GeometryDef_2 = gdedit;
      fldsedit.AddField(fld);
      IFeatureClass feacls= fws.CreateFeatureClass("Error", flds, null,
                          null,esriFeatureType.esriFTSimple, "shape", "");

Where did I go wrong?

edited tags; edited title
Link
PolyGeo
  • 65.4k
  • 29
  • 114
  • 345

How to Create Creating Feature classClass in ArcObjects and C# says X Y domain on spatial reference system not set or invalid?

added 3 characters in body
Source Link
Bera
  • 77.9k
  • 14
  • 78
  • 188

II'm trying to Createcreate a Feature class. itIt show the error "X Y domain on the spatial reference system

X Y domain on the spatial reference system is not set or in valid

Here is not set or in valid" . here my code attempt:

      IWorkspaceFactory wsf = new  FileGDBWorkspaceFactory();
      IWorkspace ws = wsf.OpenFromFile(@"D:\ARC OBJECTS\Newgdb.gdb", 
                       ArcMap.Application.hWnd);
      IFeatureWorkspace fws = ws as IFeatureWorkspace;
      IFields flds = new FieldsClass();
      IFieldsEdit fldsedit = flds as IFieldsEdit;
      IField fld = new FieldClass();
      IFieldEdit fldedit = fld as IFieldEdit;
      fldedit.AliasName_2 = "Shape";
      fldedit.IsNullable_2 = false;
      fldedit.Name_2 = "Shape";
      fldedit.Type_2 = esriFieldType.esriFieldTypeGeometry;
      IGeometryDef gdef = new GeometryDefClass();
      IGeometryDefEdit gdedit = gdef as IGeometryDefEdit;
      gdedit.GeometryType_2 = esriGeometryType.esriGeometryPolygon;
      gdedit.SpatialReference_2 = new UnknownCoordinateSystemClass();
      fldedit.GeometryDef_2 = gdedit;
      fldsedit.AddField(fld);
      IFeatureClass feacls= fws.CreateFeatureClass("Error", flds, null,
                          null,esriFeatureType.esriFTSimple, "shape", "");

Where i did i go wrong?

thank you...

I trying to Create Feature class. it show the error "X Y domain on the spatial reference system is not set or in valid" . here my code

      IWorkspaceFactory wsf = new  FileGDBWorkspaceFactory();
      IWorkspace ws = wsf.OpenFromFile(@"D:\ARC OBJECTS\Newgdb.gdb", 
                       ArcMap.Application.hWnd);
      IFeatureWorkspace fws = ws as IFeatureWorkspace;
      IFields flds = new FieldsClass();
      IFieldsEdit fldsedit = flds as IFieldsEdit;
      IField fld = new FieldClass();
      IFieldEdit fldedit = fld as IFieldEdit;
      fldedit.AliasName_2 = "Shape";
      fldedit.IsNullable_2 = false;
      fldedit.Name_2 = "Shape";
      fldedit.Type_2 = esriFieldType.esriFieldTypeGeometry;
      IGeometryDef gdef = new GeometryDefClass();
      IGeometryDefEdit gdedit = gdef as IGeometryDefEdit;
      gdedit.GeometryType_2 = esriGeometryType.esriGeometryPolygon;
      gdedit.SpatialReference_2 = new UnknownCoordinateSystemClass();
      fldedit.GeometryDef_2 = gdedit;
      fldsedit.AddField(fld);
      IFeatureClass feacls= fws.CreateFeatureClass("Error", flds, null,
                          null,esriFeatureType.esriFTSimple, "shape", "");

Where i did wrong?

thank you...

I'm trying to create a Feature class. It show the error

X Y domain on the spatial reference system is not set or in valid

Here is my code attempt:

      IWorkspaceFactory wsf = new  FileGDBWorkspaceFactory();
      IWorkspace ws = wsf.OpenFromFile(@"D:\ARC OBJECTS\Newgdb.gdb", 
                       ArcMap.Application.hWnd);
      IFeatureWorkspace fws = ws as IFeatureWorkspace;
      IFields flds = new FieldsClass();
      IFieldsEdit fldsedit = flds as IFieldsEdit;
      IField fld = new FieldClass();
      IFieldEdit fldedit = fld as IFieldEdit;
      fldedit.AliasName_2 = "Shape";
      fldedit.IsNullable_2 = false;
      fldedit.Name_2 = "Shape";
      fldedit.Type_2 = esriFieldType.esriFieldTypeGeometry;
      IGeometryDef gdef = new GeometryDefClass();
      IGeometryDefEdit gdedit = gdef as IGeometryDefEdit;
      gdedit.GeometryType_2 = esriGeometryType.esriGeometryPolygon;
      gdedit.SpatialReference_2 = new UnknownCoordinateSystemClass();
      fldedit.GeometryDef_2 = gdedit;
      fldsedit.AddField(fld);
      IFeatureClass feacls= fws.CreateFeatureClass("Error", flds, null,
                          null,esriFeatureType.esriFTSimple, "shape", "");

Where did i go wrong?

Source Link
Loading