Using Transformer to Create a Line Segments Field
The Transformer stage modifies field values and formatting. This procedure describes how to create a custom transform to create a LineSegment field. The LineSegment is then used as the input to a Create Polygon Geometry operation using Spatial Calculator.
Here the input for Transformer is a string field of latitude/longitude locations in a row in the format 'x1,y1,x2,y2,x3,y3….; x1,y1,x2,y2,x3,y3….;…’. The output will be a
field for polygons with holes.To create a
field:-
In Enterprise Designer, create a new dataflow and add a Read From File stage.
Double-click to display the Options dialog. In the File Properties tab, specify
the input file containing the location information, for example:
0.0,0.0,0.0,10.0,10.0,10.0,10.0,0.0,0.0,0.0;2.0,2.0,2.0,8.0,8.0,8.0,8.0,2.0,2.0,2.0
- In the Fields tab, click Detect Type, if necessary, to automatically determine the fields. Modify the column name to be called lines.
- Add a Transformer stage to the workflow. Rename the stage to "Prepare LineSegments." Double-click the stage to open the Options dialog. Click Add to open the Add Transform dialog box. Choose Custom to display the Custom dialog box.
-
In the Custom dialog box do the following:
- To use Prepare LineSegments list in a dataflow, add a Spatial Calculator stage (renamed to Create Polygon) Double-click the stage to open the Spatial Calculator Options dialog. Select Create Polygon Geometry, then select the coordinate system and click OK.
-
Add a Write to Null stage to complete the dataflow. To test the dataflow, add
an Inspection Point and run .