span8
span4
span8
span4
A common GIS operation is to overlay two (or more) polygons to subtract the area of one polygon from another.
For example, I might have a polygon representing the outline of a town or city.I also have a dataset of polygons representing residential areas.By overlaying the two I can subtract one from the other to identify parts of the city that are not residential areas.
FME has several transformers that will overlay data, but to cut out parts of a polygon the best solution is the Clipper transformer.
The source datasets for this example are a set of polygons representing parks (in MapInfo TAB format) and a set of polygons representing buildings (in AutoCAD DWG format).In the FME Data Inspector it looks like this:
A common task is to calculate the area of parks to assess what grounds maintenance needs to be carried out.Of course, this should not include the area occupied by buildings.This example builds a workspace to subtract building footprints from parks before measuring the area of those parks.
1.Start FME Workbench and begin with an empty canvas.
Select Readers > Add Reader from the menubar.
Set the data format to Autodesk AutoCAD DWG/DXF.Select the attached DWG data as the source dataset.If prompted, select only the BuildingFootprints layer, not layer 0.
2.Again, select Readers > Add Reader from the menubar.
This time set the data format to MapInfo TAB (MITAB).Select the attached MapInfo TAB dataset as the source.
3.Add an AreaCalculator transformer, connected to the Parks feature type.The workspace will now look like this:
Open the parameters dialog and set up the AreaCalculator to store the area of each park in an attribute called TotalParkArea.This will be the area of each park before buildings are subtracted.
4.Add a Clipper transformer.Connect the BuildingFootprints feature type to the Clipper:Clipper port, and the AreaCalculator:Output to the Clipper:Clippee port:
Open the parameters dialog to check the Clipper parameters.The most important parameter is "Clipper Type", which should be set to多快船.
5.Add a second AreaCalculator.Connect it to the Clipper:Outside port.The outside port will be the parts of the park features that fall outside of a building footprint.Open the parameters and set it up to store the area of each park in an attribute called ParkLandArea.
6.添加检查变压器(连接到第二AreaCalculator)和运行工作区。每个园区将不得不从中切开建筑物轮廓,并且将拥有既没有建筑面积的测量:
同时检查称为_clipped的属性。它会显示公园是否有建筑物切出与否。如果该属性设置为没有然后前后区域应该是一样的。
© 2020 Safe Software Inc |Legal