Select to view content in your preferred language

Invalid function argument in OpenTable method - API 1.3

5453
12
06-19-2014 12:33 AM
SunilTerkar
Emerging Contributor
Hello,

I am using API 1.3 with VS 2010, target framework .NET 4.0 and ArcGIS 10.0 with service pack 5.0. The file geo database is created in same ArcGIS version.

The File geodatabase uses British Coordinate System. It contains among few feature classes, polygon feature class "DMA". Below is my c# code causing me problem.

Geodatabase geodatbase = Geodatabase.open("D:\\Clean Water\\CW_Assets.gdb");
Table esriTable = geodatabase.OpenTable("DMA");

on the second line I am getting an error message "Invalid function argument". From other discussion thread on same topic I learned that API doesn't support customized coordinate system, but british coordinate system is not customized, it's standard coordinate system available in ArcGIS.

I did tried other method to check if I can access attribute data of "DMA".

RowCollection attributeQuery = geodatabase.ExecuteSQL("Select * from DMA"), the error message I got was "table not found".

I could see the existence of feature class "DMA" in ArcCatalog.

Can somebody advise what am I doing wrong?

Thanks in advance.

Sunil
0 Kudos
12 Replies
LanceShipman
Esri Regular Contributor
This is what is expected by ArcGIS:
PROJCS["British_National_Grid",GEOGCS["GCS_OSGB_1936",DATUM["D_OSGB_1936",SPHEROID["Airy_1830",6377563.396,299.3249646]],PRIMEM["Greenwich",0.0],UNIT["Degree",0.0174532925199433]],PROJECTION["Transverse_Mercator"],PARAMETER["False_Easting",400000.0],PARAMETER["False_Northing",-100000.0],PARAMETER["Central_Meridian",-2.0],PARAMETER["Scale_Factor",0.9996012717],PARAMETER["Latitude_Of_Origin",49.0],UNIT["Meter",1.0]]

This is what your feature class contains:
PROJCS["British National Grid",GEOGCS["Ordnance Survey Great Brit",DATUM["Ordnance Survey Great Brit",SPHEROID["Airy 1830",6377563.396,299.3249646]],PRIMEM["Greenwich",0.0],UNIT["Degree",0.0174532925199433]],PROJECTION["Transverse_Mercator"],PARAMETER["False_Easting",400000.0],PARAMETER["False_Northing",-100000.0],PARAMETER["Central_Meridian",-2.0],PARAMETER["Scale_Factor",0.9996012717],PARAMETER["Latitude_Of_Origin",49.0],UNIT["Meter",1.0]]

ArcOBJECTS and the File Geodatabase API compare these strings and since yours is seen as different, it is seen as "Custom".

What was the source of this data and how was it loaded?
0 Kudos
SunilTerkar
Emerging Contributor
Hello,

The data was received from client who is using ArcGIS for ages and I just copied the features class to new geodatbase for using file geodatabase API.

Alternatively, in my another application developed in ArcObject, same coordinate system doesn't give me any problem. I reckon, either something has changed between versions of ArcGIS or Client has edited the .prj file just to replace couple of text.

I am about to revert British coordinate system given in feature class to ArcGIS and test the application and will report.

Thanks for your help.

Sunil
0 Kudos
SunilTerkar
Emerging Contributor
Hello,

I can now confirm that issue is resolved after reverting back to "British National Grid" given in ArcGIS. 

Thanks for your help.

Sunil
0 Kudos