ThinkGeo.com    |     Documentation    |     Premium Support

ThinkGeo V12 GetColumns Method Results Not Same As V10.5

ThinkGeo Team,

For GDB FeatureLayer the GetColumns method returns different results for V10.5 and V12.

V10.5 returns two additional columns not returned by V12:
OBJECTID
Shape

Below are Visual Studio Debug screen captures for V10.5 and V12.

I’m thinking that GetColumns should return the same results.

Regards,
Dennis

V10.5

V12

Hi Dennis,

Thanks to let us know your questions.

As below is the reply from our developer:

The different is because we used different library in V10 and V12, the V12 use better a library and the result is more standard.

The two missed columns are “Shape” and “OBJECTID”.

For “Shape”, in fact it’s not a column, so the result in V10 is incorrect. If you need it, please get it like this in V12:
((FileGeoDatabaseFeatureSource)layer.FeatureSource).GetWellKnownType();

For “OBJECTID”, its value is saved in feature.ID, you can get it also.

I hope that’s helpful.

Any question please let us know.

Regards,

Ethan

hi Ethan,

Appreciate your response as always.

OBJECTID…
In V10.5 OBJECTID and FeatureId have different values as shown in the screen capture below. And in some cases there is an OBJECTID, but no FeatureId.

Shape…
I was under the belief that GDB FeatureLayer accommodates different shape types within the same layer. If that is true then GetWellKnownType would be by feature as opposed to FeatureSource. So the instruction I would use is:

TheFeature.GetWellKnownType();

Regards,
Dennis

image

Hi Dennis,

Thanks for let us know your question.

For Shape:

We get its value from the table in FileGeoDatabase, follow the standard, each table should only contains one shape type.

For our FileGeoDatabaseFeatureLayer, it have an active layer(active table, by default it is the first table), the ((FileGeoDatabaseFeatureSource)layer.FeatureSource).GetWellKnownType() return the type of active layer. Here is a screen shot from other utility, you can see the geometry type is related with table(active layer).

image

For OBJECTID:

The value of ObjectID is saved into feature.ID but not FEATUREID, you can found the FEATUREID is still in column values.

It’s not in column values now is because the behavior change in the new library we chosen.

        var cAllFeatures = fileGeoDatabaseFeatureLayer.FeatureSource.GetAllFeatures(ReturningColumnsType.AllColumns);
        foreach (Feature TheFeature in cAllFeatures)
        {
            var objectID = TheFeature.Id;
        }

I hope that’s helpful.

Regards,

Ethan