Creating feature class with unknown coordinate system - XML definition

5465
14
07-12-2011 02:02 AM
ChrisMorgan1
New Contributor III
Hi,
I am trying to create feature classes with an unknown coordinate system using the FGDB API.
The feature classes appear to create OK, and I can add features, but I then get drawing errors
in Arcmap, and errors in ArcCatalog if I try to copy/paste the feature class or export it as XML.

Can you tell me what I am missing from my XML feature class definition? Please see attached XML feature class definition.

Thanks very much,

Chris
0 Kudos
14 Replies
ChrisMorgan1
New Contributor III
We have duplicated your issue and are debugging it. I will be on vacation next week, so I will not get back to you until the week of July the 25th.


Thanks for the reply - it is always reassuring to at least have verification of the problem!
Have a good vacation.

cheers,

Chris
0 Kudos
TomBreed
New Contributor
Hi - Thank you for your patience! I was able to get feature classes based on the referenced xml copy/pasting correctly by making a few minor changes:

Add the Shape_Length field to the fieldset for the feature class:

<Field xsi:type="esri:Field">
 <Name>Shape_Length</Name>
 <Type>esriFieldTypeDouble</Type>
 <IsNullable>true</IsNullable>
 <Length>8</Length>
 <Precision>0</Precision>
 <Scale>0</Scale>
 <Required>true</Required>
 <Editable>false</Editable>
 <AliasName>Shape_Length</AliasName>
 <ModelName>Shape_Length</ModelName>
</Field>


Then I added information on what the area and length field names are between the <HasSpatialIndex /> and <Extent /> tags. Note that there is no Shape_Area, but the empty tag needs to be there:

<HasSpatialIndex>true</HasSpatialIndex>
<AreaFieldName/>
<LengthFieldName>Shape_Length</LengthFieldName>
<Extent xsi:nil="true"/>


Finally I changed the CLSID from
<CLSID>{86E3C61F-7D4E-48DF-8B2E-AF71CD0BCB61}</CLSID>

to
<CLSID>{52353152-891A-11D0-BEC6-00805F7C4268}</CLSID>


Hope this gets you past this hurdle!
0 Kudos
ChrisMorgan1
New Contributor III

Finally I changed the CLSID from
<CLSID>{86E3C61F-7D4E-48DF-8B2E-AF71CD0BCB61}</CLSID>

to
<CLSID>{52353152-891A-11D0-BEC6-00805F7C4268}</CLSID>



Hi Thomas, thanks for your reply.
I now have a working XML definition - thanks! ArcCatalog copy/paste of an empty feature class
created with this XML definition works without errors.
The Shape_Length field does not seem to be required, but the CLSID value is crucial.
But what is the deal with the CLSID value - is this a defined 'magic number' that I should always use? Do all feature classes have the same CLSID value in their definition? Is this defined/documented anywhere?

cheers,

Chris
0 Kudos
TomBreed
New Contributor
Hi Chris,

Glad I was able to help. You are correct in a sense that the CLSID is a magic number: COM uses it to identify what it needs to instantiate a COM object. In this specific case, the CLSID identifies what makes up the table: i.e. rows or features or something else. While the File GDB API is not COM based, ArcGIS is.

As far as the File GDB API is concerned, you can safely use the CLSID of Feature as noted earlier in the thread and the CLSID for a row for non-spatial tables.

Features  - {52353152-891A-11D0-BEC6-00805F7C4268}

Rows - {7A566981-C114-11D2-8A28-006097AFF44E}


I hope this helps,
Tom
0 Kudos
ChrisMorgan1
New Contributor III

Features  - {52353152-891A-11D0-BEC6-00805F7C4268}

Rows - {7A566981-C114-11D2-8A28-006097AFF44E}



So any feature class that I create (points, lines or polygons), should use the first CLSID above,
and any standalone table that I create should use the second CLSID?

cheers,

Chris
0 Kudos