Hello,

    There’s an object called DefaultFeatureType that is used by methods to 
create a Dense or Sparse feature.
    But what is the feature member that stores the geometric kind of this 
feature ? Point, Line, Polygon, etc.

    I see this code in ShapefileByteReader:completeFeature(Feature) method, 
reading a value used only locally but not stored :
    
int iShapeType = getByteBuffer().getInt();

ShapeTypeEnum type = ShapeTypeEnum.get(iShapeType);

if (type == null)
    throw new InvalidShapefileFormatException(MessageFormat.format("The 
shapefile feature type {0} doesn''t match to any known feature type.", 
featuresType));

switch (type) {
    case Point:
        loadPointFeature(feature);
        break;

    case Polygon:
        loadPolygonFeature(feature);
        break;

    case PolyLine:
        loadPolylineFeature(feature);
        break;

    default:
        throw new InvalidShapefileFormatException("Unsupported shapefile type: 
" + iShapeType);
}


ShapeTypeEnum leads to an exhaustive list of values : NullShape, Point, 
PolyLine,  Polygon, MultiPoint,  PointZ, PolyLineZ, PolygonZ, MultiPointZ, 
PointM, PolyLineM, PolygonM, MultiPointM, MultiPatch, and maybe its more than 
needed.
Another enumeration more neutral exists somewhere in the org.opengis package 
for the features ?

When I give you a feature instance, today, how do you react on its geometric 
type ?

Regards,

Marc Le Bihan

Reply via email to