Instead of explaining how I did that original report, I tried to see for myself if what he was asking was in itself an easy query in FME. I created a similar report using FME Workbench. You can see the FMW file here.
In less than an hour I was able to take as input Smallworld area and line features, and then compute the total length of all lines for a given area and then create both a CSV and KML report. CSV is a good and simple tabular report format. KML provides a nice visual representation that anyone using Google Earth can use to see your query results.
If you have FME Workbench, you can open the report_pipe_lengths_by_grid.fmw file and view the comments I put in there describing how the data/transformer flows work. If you do not have FME, you can download a fully functional trial version from http://www.safe.com.
The basic steps included:
- read area and line feature sets from Smallworld into FME Workbench
- use the LineOnAreaOverlayer transformer to split the line features at the area boundaries
- use the LengthCalculator transformer to calculate the length of each line feature inside a given area boundary
- use the Aggregator transformer to sum up the length of all lines per area feature
- use the FeatureMerger transformer to assign the aggregate line length to each area feature
- write results out to a KML file (click here for image of result)
- write results out to a CSV file (click here for file)
[Shameless commercial plug: if you would like to explore how you could use FME to get meaningful reports out of your data, please contact me at the e-mail addresses listed on the "Contact Information" in the side bar of this blog]