span8
span4
span8
span4
Measuring distances is - like measuring areas - very simple in FME.It requires the use of just one transformer;the LengthCalculator.Here, for example, a user is measuring the length of arterial road features:
The length of each road feature is measured and added to the feature as an attribute called RoadLength.
Length is measured in the units of the coordinate system being used.For example, if the source data is in a coordinate system based on metres (meters) then the LengthCalculator returns values in metres.
There are some simple variations and issues to be aware of.
Follow these steps as an example of how to calculate the length of linear features.
1.Start FME Workbench and generate a workspace to translate the attached source data from Esri Shapefile format back to Esri Shapefile format.Choose a different folder for the output.
2.Add a LengthCalculator transformer between the reader and writer feature types
3.Open the parameters dialog for the LengthCalculator transformer.Ensure the Length Attribute parameter is set to write an attribute called RoadLength
4.Open the parameters dialog for the writer feature type.Click the Attributes tab and add a new attribute called RoadLength of type float
5.Optionally add an AttributeRounder transformer after the LengthCalculator.Open its parameters dialog and set it up to round the RoadLength attribute to 3 decimal places.
6.Save and run the workspace.Inspect the output.Notice the new RoadLength attribute with values rounded to 3 decimal places
Why not take this example one step further by calculating the average length of the roads?You can use a StatisticsCalculator to calculate the average of all RoadLength values.
Point in Polygon Calculations with the PointOnAreaOverlayer
Buffering features for Spatial Relationship Analysis
Shortest Route Calculations with the ShortestPathFinder
Determining Spatial Relationships
Coordinate Systems and Measurements with the Reprojector
Tutorial: Common GIS Operations
Area Measurements with the AreaCalculator
© 2019 Safe Software Inc |Legal