ShapeType constant values for Polygons

405
2
Jump to solution
06-05-2012 03:36 AM
DorisRiedl
New Contributor
I tried to query if a FeatureClass is of type polygon:

[INDENT][/INDENT]if (pFC.getShapeType() == esriShapeType.esriShapePolygon || pFC.getShapeType() == esriShapeType.esriShapePolygonZ) { ... }

but this doesn't seem to work. Is it possible that there is an error in the esriShapeType constants (which should be 5 for polygons and 19 for polygonZ)? Because when I show them via a MessageDialog
[INDENT][/INDENT]JOptionPane.shwoMessageDialog(null, pFC.getShapeType());
the output for Polygons is always 4.

The esriShapeType constants for point and polyline work all right.

Any hints?
0 Kudos
1 Solution

Accepted Solutions
KenBuja
MVP Esteemed Contributor
The ShapeType property doesn't return an esriShapeType constant, but rather an esriGeometryType constant. Your code should be

if (pFC.getShapeType() == esriGeometryType.esriGeometryPolygon)

but there is no constant for a PolygonZ

View solution in original post

0 Kudos
2 Replies
KenBuja
MVP Esteemed Contributor
The ShapeType property doesn't return an esriShapeType constant, but rather an esriGeometryType constant. Your code should be

if (pFC.getShapeType() == esriGeometryType.esriGeometryPolygon)

but there is no constant for a PolygonZ
0 Kudos
DorisRiedl
New Contributor
Thanks Ken!

Doris
0 Kudos