Syntax FACTORY_DEF WarpFactory [FACTORY_NAME ] [INPUT (CONTROL_VECTOR|CONSTRAINT_LINE|OBSERVED) FEATURE_TYPE [ ]* []*]* [GROUP_BY []+] [FLUSH_WHEN_GROUPS_CHANGE (Yes|No)] WARP_METHOD (AFFINE|RUBBER_SHEET) [OBSERVED_FEATURESTORE ] [CONTROLVECTOR_FEATURESTORE ] [MAX_DISTANCE ] [MAX_POINTS ] [EXPONENT_WEIGHT ] [OUTPUT (CONTROL_VECTOR|CORRECTED|BAD_CONTROL) FEATURE_TYPE [ ]* []*]* Overview This factory performs warping operations on the spatial coordinates of features. It is used to adjust a set of observed features so they more closely match a set of reference features in space. As input, it takes three sets of features: one representing the control features used to compute the corrections, one representing the observed features to be corrected, and an optional set of constraint lines, which define boundaries across which control vectors have no influence on observed features. Output consists of the warp-corrected features. Each input control feature accepted by the CONTROL_VECTOR input clause represents a control vector whose start point is at an observed data vertex and whose end point is at the corresponding reference data vertex. The control vector represents the correction required to go from the observed vertex to the reference vertex. (Control vectors with only one point are interpreted as a requirement that this location not change from the observed dataset to the reference dataset. This is often referred to as a tie point.) The factory currently supports two methods of warping correction. Both methods use the same control vectors in computing the correction. The first method, AFFINE, computes and applies a 6-parameter affine transform to the observed input data to obtain the corrected output features. This computation requires that a minimum of four control vectors are input to the WarpFactory. See the @Affine function description in this manual for a basic discussion of the affine transform itself. Affine correction can be used to apply combined linear translations, rotations, scalings, and reflections to the input data. The second method of warping, RUBBER_SHEET, computes and applies a correction to each observed point using weighted values based on the distance between the point and the control vector start points. This has the effect of moving each observed point as if it were located on the surface of a rubber sheet. EXPONENT_WEIGHT is a numeric weighting factor used by the RUBBER_SHEET warp method to determine the strength of the warping correction. The greater the value, the greater the degree of correction. Although EXPONENT_WEIGHT can be set to any floating point number, practical values typically range from 1.0 to 2.0. Experimentation can be used to determine the best value. If the EXPONENT_WEIGHT clause is absent, the RUBBER_SHEET method uses a default value of 2.0. The AFFINE method ignores EXPONENT_WEIGHT if present. MAX_DISTANCE indicates the influence of control vectors. Any control vector start point farther than MAX_DISTANCE from the point being operated on will have no effect in the correction computation. If MAX_DISTANCE is not specified, then all control vectors will be used for correcting every point. (MAX_DISTANCE is currently supported only for RUBBER_SHEET warping.) MAX_POINTS indicates that only the closest MAX_POINTS vectors will have an effect on any point being warped. If not specified, then all control vectors will be used for correcting every point. (MAX_POINTS is currently supported only for RUBBER_SHEET warping.) If both MAX_DISTANCE and MAX_POINTS are specified, then the more limiting clause will take precedence. That is, only the closest MAX_POINTS vectors which are within a distance of MAX_DISTANCE from a given point will have an influence on that point. In addition to the above, the effects of control vectors on a rubber sheeting process may be further limited through use of CONSTRAINT_LINES. CONSTRAINT_LINES are boundaries, across which control vectors have no influence on points of observed features. If the "line of sight" from a point on an observed feature to the starting point of a control vector crosses a constraint line, that control vector will not affect the resulting warped position of the point in question. If the line of sight touches the end of a constraint line, or either the control vector or observed point is actually located on the constraint line, then the control vector will still influence the observed point. Note: It is possible for RUBBER_SHEET warping to break apart polygons or to reposition points originally within polygons to locations outside of them after the warp. AFFINE warping preserves polygons and point-in- polygon relationships. MAX_DISTANCE, MAX_POINTS and CONSTRAINT_LINES function only with the RUBBER_SHEET interpolation, not the AFFINE. The WarpFactory must wait until all input is read before it can do any processing. This can slow down translations if the data volumes are large. To help alleviate this, the OBSERVED_FEATURESTORE and CONTROLVECTOR_FEATURESTORE clauses can be used to specify an FME feature store file (produced by the FFS writer or the RecordingFactory) that contains the data required to perform warping. If one of these clauses is specified, the corresponding features come from the specified recording; otherwise, the data enters the factory in the usual way. Control Vector Creation ~~~~~~~~~~~~~~~~~~~~~~~ The following steps outline a suggested procedure for the creation of control vectors for a MapInfo format data set. Similar procedures can be used for other formats, such as ESRI Shape. 1. Open a map window displaying the observed and reference data sets as read-only, each in a different line color. 2. Create a new writable table for the control vectors and add it to the existing map window as another layer. Set this layer to show the direction for the lines. Add an attribute to this new table. It does not matter what attribute is added, since it is not required for the warping process. It is only needed to conform to MapInfo requirements that a table have at least one attribute. 3. Turn snapping on and add at least four 2-point lines to the control vector layer, each one going from an observed to a corresponding reference location. In general, the more control vectors, the better. They should be as evenly distributed across the coverage area as possible. 4. Once all control vectors have been entered, examine their directions. If they all seem to be pointing in the same direction, or go around in a circle, or expand outward or inward from a point, the AFFINE method may give a better correction than the RUBBER_SHEET method. If the directions seem to be essentially random, the RUBBER_SHEET method may be better. 5. Save the control vector table into the same directory that contains the observed data set. 6. In the WarpFactory code in the FME mapping file, specify this table as the one that supplies the CONTROL_VECTOR features. Output Tags The WarpFactory supports the following output tags. CONTROL_VECTOR Valid control vector features (those which are 2-point lines) have this specification applied to them as they are output. A tie point is input as a point feature. CORRECTED Warp-corrected features have this specification applied to them as they are output. BAD_CONTROL Invalid control vector features (those which are not points or 2-point lines) have this specification applied to them as they are output.