Skip to main content
The “clipper” tool fails to generate the expected result,

 

 

I have two layers: Boundary and Landuse that are living in CAD file.

 

 

1. The Boundary layer contains only one hatch object. This hatch is converted to polygon (area) successfully.

 

 

 

 

 

 

 

 

 

 

 

2. The Landuse layer contain multiple hatches (299). These hatches are converted to polygons (areas) successfully.

 

 

 

 

 

 

 

 

 

3. Now, I need to derive the roads by subtracting the landuse from the boundary. I was advised to use the “clipper” tool to do so (which is equivalent to the erase tool in the ArcGIS). The issue here is that the clipper tools fails to generate the roads from the Boundary polygon and Landuse polygons.

 

 

 

 

What might be the issue here?

 

 

The source CAD file and the workbench can be downloaded from the links below:

 

 

http://www.mediafire.com/download/award80hlujz76z/Tamoun_Tubas_UrbanMasterPlan_02.dwg

 

 

http://www.mediafire.com/view/dn9mey2e0ncll66/Roads.fmw

 

 

Thank you

 

 

Best

 

 

Jamal
Hi Jamal,

 

As stated in the log there is a geometry issue that prevents the clipper from working, the issue can possibly be fixed via the geometry validator. That would be my initial test.
Thank Itay

 

 

The Geometry Validator is applied, nevertheless, the error persist to exist

 

 

 

 

What other commands should I apply?
Hi Lamal,

 

Have you had a close look at the roads layer? there seem to be points in the layer and gaps between the lines, I would filter out all non relevant geometries, snap the lines and form an area before the clipping.
Hi,

 

 

how did you configure the GeometryValidator?

 

 

For the Clipper, make sure that all the geometries entering it has the same coordinate system. Consider specifying the coordinate system on the readers, if necessary.

 

 

David
Many thanks Itay for the prompt help,

 

 

If I disable the “clipper” tool then the Boundary and the Landuse are derived easily as polygons. I assume that clipping polygon layer from other polygon layer will necessary generate polygon layer. Ami correct?

 

 

 

In the screenshot below, the “clipper” is disabled and thus a Boundary layer of one polygon and Landuse layer of 299 polygons are generated. Both are of AREA type. Then how their clip can be different from AREA type?

 

 

 

 

If the “clipper” tool is activated, then an error is generated and no output from the clipper is generated

 


Hi Jamal,

 

I see in your file that you are using the hatches (areas), so no need to create areas from the lines  > logical, however the some areas are not valid (depending on the test your using in the GeometryValidator > 2D self-intersection)

 

Without valid geometry the Clipper will continue to return an error.

 

Suggestions: paas the areas several times via the GeometryValidator (see http://fmepedia.safe.com/CommunityAnswers#!/feedtype=SINGLE_QUESTION_DETAIL&dc=All&criteria=ALLQUESTIONS&id=906a0000000cx3HAAQ) or fix them in AutoCAD, with error information provided (see http://fmepedia.safe.com/CommunityAnswers#!/feedtype=SINGLE_QUESTION_SEARCH_RESULT&id=906a0000000csTHAAY)
Hi Jamal,

 

 

I'd recommend you to inspect the geometries in more detail. The polygons may not be enough clean even though those passed through the GeometryValidator.

 

 

Takashi
This is the result of my quick test. For your information.

 

 


Hi Again,

 

 

If i read the 2 layers, and put an areabuilder on the boundary hatch, fme works like its supposed to (i didnt even filter or validate..stroking is not needed either)

 

 

 

ur "Landuse_UrbanMasterPlan_HatchType_Design_Compulsory" layer:

 

 

 

 

THere are aggregates in this layer.

 

 

 

 

anduse data, wich i do by using a spatialrelator and entering the same layer to the base and canditate input.

 

When i use equal,crosses,overlaps,contains and within i get error message:

 

 

Intersection matrix match of predefined type EQUALS with geometry dimensions 2 and 2 could not be computed. Possible cause: An aggregate with overlapping polygons or a donut with a hole adjacent to the edge.

 

Intersection matrix match of predefined type EQUALS with geometry dimensions 2 and 2 could not be computed. Possible cause: An aggregate with overlapping polygons or a donut with a hole adjacent to the edge.

 

FME Session Duration: 3.4 seconds. (CPU: 2.0s user, 0.7s system)

 

 

When i do the same check with criteria crosses,overlaps,contains and within,300 objects pass but 3 fail.

 

 

Gio

 


Srry for that,

 

 

I did a spatialrelator-chek to derive the error and  3 fails.

 

 

Because of the larger patches in the clipped roads. The data sets are not very well matched apparently.

 

 

Gio
I have extracted the Boundary and Landuse layers (as polygons) from the two CAD layers below with no problem:

 

 

Boundary_UrbanMasterPlan_HatchType_Design_Compulsory

 

Landuse_UrbanMasterPlan_HatchType_Design_Compulsory

 

 

The content of the “Boundary_UrbanMasterPlan_HatchType_Design_Compulsory” layer is 1 hatch

 

 

 

 

The content of the “Landuse_UrbanMasterPlan_HatchType_Design_Compulsory” layer is 298 hatches

 

 

 

 

 

Now, when it comes to derive the roads layer from the Boundar and Landuse, the workbench fails

 

 

Mathematically:

 

Roads = Boundary - Landuse

 

 

 

 

Workbench:

 

http://www.mediafire.com/view/dn9mey2e0ncll66/Roads.fmw

 

 

Which commands\\settings should I add to my workbench to let it derive my Roads correctly?
The Landuse polygons seem not to be clean, the GrometryValidator may not be enough to validate and repair them. Possibly newly assembling Landuse polygons could be quicker.

 

I put a workspace example here.

 

https://safecommunity.force.com/068a00000045DVx

 


Perfect…perfect…perfect. It works fine

 

 

Finally, the Roads are extracted from the Boundary and Landuse. I have integrated the valuable workbench you have already provided with mine. At the moment, two issues are still there:

 

 

1. The “autocad_layer” and “autocad_color” are not transferred to the outputs and thus there is no result from the “SchemaMapper”. How to ensure transferring these two columns to the outputs

 

 

 

 

Workbench:

 

http://www.mediafire.com/view/5cgpfdylzta7443/UrbanMasterPlan_CAD_To_GIS_06.fmw

 

 

Excel file

 

http://www.mediafire.com/view/136af33b9v1j4su/UrbanMasterPlanDomain_14_FME.xls

 

 

Simple CAD file for test:

 

http://www.mediafire.com/download/3wqcy01uw3t1wu9/Marda_Salfit_UrbanMasterPlan_03.dwg

 

 

 

2. How to dissolve the roads to let the Roads layer contain only one feature. In ArcGIS, we use the “dissolve” tool. What is the equivalent tool in FME?

 

 

 

 

 

 

 


1. In this case, I think the SpatialFilter can be used effectively to transfer the attributes. For example:

 

 

 

2. Have a look at the Dissolver and / or the Aggregator transformer.
The “autocad_layer” and “autocad_color” are lost after applying the “AreaBuilder”. After the “intersector”, they were still there!

 

 

 

 

 

 

I couldn’t figure out where to stick the “SpatialFilter” in my workbench (and its input) in order to keep the “autocad_layer” and “autocad_color”

 

 


Also, I have applied the “dissolver” tool but it doesn’t merge the features.

 

 

 


The workflow in my example workspace will re-construct polygon geometries. Resultant geometries will be nearly equal to the original ones. But attributes will not be retained. As you discovered, the AreaBuilder will discard attributes other than ones which have been specified to "Group By" parameter.

 

Therefore, if you need to retain attributes of original features, you have to transfer them to the re-constructed polygons using spatial relationships. The SpatialFilter approach I mentioned is one of possible ways.

 

 

In this case, since re-constructed geometries will have been modified, they will not match with the original geometries exactly. So, I transformed them into inside points (InsidePointReplacer), and related them to the original geometries (SpatialFilter). And also have used the GeometryExtractor and GeometryReplacer to restore polygon geometries.

 

 

If you are going to try the SpatialFilter approach, connect transformers  as follows.

 

Original polygons: GeometryFilter FArea] -->  SpatialFilter lFilter]

 

Re-constructed polygons: SliverRemover rRepaired] --> GeometryExtractor --> InsidePointReplecer --> SpatialFilter aCandidate]

 

Result: SpatialFilter iPassed] --> GeometryReplacer

 

 

Just be aware that some polygons may go to Failed port, since the re-constructed polygons are not matched with the original polygons exactly.
The Dissolver will merge polygons which are touching or overlapping each other. It doesn't treat detached polygons. What kind of transforming do you need?
Hi Jamal,

 

 

I updated my workspace example. If you add temporary ID to Landuse polygons, the FeatureMerger can be used to restore attributes instead of the SpatialFilter. See the example.

 

https://safecommunity.force.com/068a00000045Fwv

 

 

Takashi

 


When u use intersectors, dissolvers, areabuilders, features can only be transfered "inline", that is within the dataflow, trough either grouping or setting listnames. (After intesector attirubtes might be there, but not nescessarily the correct ones.)

 

 

 

As your data only ever has landuse intersect with the roads (simple intersection), you can set a listname or indeed pass data by grouping.

 

The list can be searched/passed/exploded towards the end to extract the attributes.

 

Grouping is self evident.

 

 

This wont work if u have more complex interactions though:

 

 

 

 

 

 

 

No grouping possible here.

 

 

These polygons are built trough a series of processes also involving 1 areabuilder.

 

The colors are built at the start of the process.

 

The areas have variable and multi interactions.

 

 

Only lists and lists, listsearchers, indexers etc. could extract those.

 

If u want to know this is a sampling object, cursom transformer i made, wil be used with power 2, this is a 3.

 

Colors were exercise to pass original attributes.

 

 

Spatial relating result with original is possible, but thats totaly out of the "processtream" and therefore not elegant. Also it is more slow.

 

 

Gio

 

 

 


Thank you Takashi and GIO for the continuous help.

 

 

Please, consider the simple CAD file:

 

http://www.mediafire.com/download/liogqnn9r6de90s/R_02.dwg

 

 

 

The Excel file:

 

http://www.mediafire.com/view/ivyn2poe9p4g2a3/UrbanMasterPlanDomain_14_FME.xls;

 

 

 

If I apply the workbench below, then the data is transferred to the output.

 

http://www.mediafire.com/view/zbckm88iszxqywd/UrbanMasterPlan_CAD_To_GIS_05.fmw

 

 

 

 

Till now, I’m still struggling how to let the developed workbench transfer the data to the output. The results are on the "unmapped" side! whay?

 

http://www.mediafire.com/view/9hagdoc7kymf980/UrbanMasterPlan_CAD_To_GIS_06.fmw

 

 

 

 


You have to specify "_count" to "Group By" parameter of these transformers.

 

Inspector_2

 

AreaBuilder_2

 

Dissolver

 

Dissolver_2

 

 

And then, change "Join On" (Requestor) parameter of the FeatureMerger into "Attribute Value".

 

 

 

If you are going to apply my example, please study that in more detail.

 

A little learning is a dangerous thing.
Thank you very much Takashi for the distinct efforts and your willingness to offer unlimited help.

 

 

Finally, it works fine

 

 

 

 

 

 

 

 

 

best

 

 

Jamal

Reply