Description

Get a list of coordinate points that describe some aspect of a feature.

Return Type

A Long value.  

The number of points needed in PointsResults or the number of points filled into that variant. If PointsResults contains a safearray of Long/Single/Double, then the returned value will be equal to half the size of that safearray since there are two values per point.

Syntax

object.GetFeaturePointsEx ([FeatureIndex], [PointsResults], [ResultType], [OperationValue], [Flags])

The GetFeaturePointsEx Method syntax has these parts:

PartDescription
objectAn expression evaluating to an object of type McPoints.
FeatureIndexOptional. A Long value.

The index of the feature. Otherwise this must be a feature index value between 0 and Count minus 1. This argument is ignored for McPoints, where the coordinates of all points are always transformed.

PointsResultsOptional. A Variant value.

If missing, then only the count is returned. If an Empty Variant, then it is filled with an array of SINGLEPOINT records containing X,Y pairs of points. Otherwise PointsResults must be a variant containing a safearray or records of the proper type and size. Allowed types are Single, SINGLEPOINT, Long, LONGPOINT, Double or DOUBLEPOINT. A non-emtpy variant of the right size and type will be filled with x,y pixel coordinate values (one XXXPOINT record per point or two Long/Single/Double values per point)

ResultTypeOptional. A mcOutlineType enumeration, as described in settings.

The type of points wanted. The ResultType mcotNoGaps and the Flag gfpxAdjacentPixels are illegal for for McPoints. The mcotConvex operation (the convex hull) are forces on the gfpxClosedBoundary flag, so that McPoints or McLines are treated as describing a closed boundary.

OperationValueOptional. A Variant value.

A parameter dependent on the type argument (see above)

FlagsOptional. A mcGetFeaturePointsExFlags enumeration, as described in settings.

Flag bits that control aspects of how the coordinates are computed.

Settings

The settings for ResultType are:

ConstantValueDescription
 mcotFilter1

Filter out (smooth out) the feature points using a running average. The degree of smoothing is passed in OperationValue; the degree is the number of points on either side of each point to use for an average. If the gfpxClosedBoundary mcGetFeaturePointsExFlags flag is not set for McLines or McPoints, then the end coordinates are mirrored for the average instead of wrapped into a closed boundary.

 mcotConvex2

returns the convex hull of the points (treated as a clockwise closed boundary). The OperationValue argument specifies the degree of smoothing to be applied (as for mcotFilter) before doing the convex hull; set it to zero for no smoothing.

 mcotNoGaps3

Vertices are adjusted to the nearest pixel and then are interpolated into one-pixel steps. Setting the gfpxAdjacentPixels flag also invokes this operation before doing any mcotFilter operation. For McLines, if the mcofConnect8 bit of the McFeatures.OptionFlags property is clear, then the points are marked such that each pixel along the line is 4-connected to one of its neighbors. By default the mcofConnect8 is set for McLines (though it is clear by default for McRegions), so points will be adjacent but may be only 8-connected. This operation is illegal for McPoints objects.

 mcotSetNumbers4

returns a given number of points evenly spaced along the total line or boundary length. The number of points wanted is passed in OperationValue. If the gfpxClosedBoundary flag is set or this is an McRegions, then the line length includes a closing line segement from the last point to the first. The points returned are the starting points of each of the given numbers of evenly spaced segment

 mcotSetSpacing5

returns points with a given spacing along the line or boundary. The spacing between the points wanted is passed in OperationValue, in calibrated units as determined by the McFeatures.SpatialCalibration property (fractional values are allowed). If the gfpxClosedBoundary flag is set or this is an McRegions, then the line includes a closing line segement from the last point to the first. The points returned are the starting points of each segment of the given length; the last segment is likely to be shorter than the others.

The settings for Flags are:

ConstantValueDescription
 gfpxNone0

no flags

 gfpxDefault2

default behavior is gfpxConstantArea

 gfpxClosedBoundary1

This flag is forced on for McRegions and is otherwise off.

 gfpxConstantArea2

if set for the mcotFilter or or mcotConvex mcOutlineType operation for an McRegions, conserve the original area within the closed outline. When clear, the outline that is returned is likely to have a different area than the original outline (usually smaller). This flag affects any filtering pass for the mcotConvex operation (non-zero OperationValue), but does not modify the convex hull itself (the area of the convex hull will be the same or larger than the original area). This flag implies that the gfpxClosedBoundary flag is set.

 gfpxAdjacentPixels4

If set the feature coordinates are mapped to the closest pixel and then interpolated into one-pixel steps before doing any mcotFilter or mcotConvex mcOutlineType operation. This is equivalent to the mcotNoGaps mcOutlineType operation. For McLines, if the mcofConnect8 bit of the McFeatures.OptionFlags property is clear, then the points are marked such that each pixel along the line is 4-connected to one of its neighbors. By default the mcofConnect8 is set for McLines (though it is clear by default for McRegions), so points will be adjacent but may be only 8-connected. This flag is ignored for the mcotSetNumbers and mcotSetSpacing operations. This flag is illegal for McPoints objects.

Remarks

This method is similar to GetFeaturePoints but offers added functionality as to the type of coordinate information returned. The feature, and its basic descriptive coordinates (as returned by GetFeaturePoints) are not affected by this call.

Coordinates are returned into an array of values, SINGLEPOINT or RECT structs supplied by the caller (see Example). The type of the returned result depends on the type of array that the caller supplies. If the caller does not supply a PointsResults results variant (or it is VT_ERROR), then just the number of points required to hold the returned array will be returned.

If the caller supplies an Empty PointsResults result variant, then that variant is filled with an array of SINGLEPOINT X,Y results.

For McPoints all feature points are treated as as an ordered array. This cannot be done for McLines or McRegions, where the coordinates of only one feature at a time may be retrieved.

If only a basic description of feature coordinates is desired, use GetFeaturePoints.

As illustrated in the example, unless passing the ResultsPointer as an Empty Variant, you should make sure that a first call with the PointsResults argument missing (to determine the number of points that will be returned) has the same arguments as the call that actually gets the points. This is both for safety (to make sure that the receiving array is large enough) and also for efficiency (the results are cached between the two calls as long as the arguments are the same).

Exceptions

The ResultType mcotNoGaps and the Flag gfpxAdjacentPixels are illegal for for McPoints