Question

"Polygon feature must have at least 4 coordinates" ..rejecting REJECTING BELOW FEATURE:


Badge +1
Hi, I am trying to deaggregate a large shapefile, and I keep getting this warning message:

 

 

"Polygon feature must have at least 4 coordinates" ..rejecting  REJECTING BELOW FEATURE:"

 

 

I can't work out what is causing this message - does anyone have any ideas?

 

 

Thanks

19 replies

Badge +3
is it a single polygonshapefile u read?

 

Then use a validator prior to deaggregating.

 

Or geometryfilter.

 

 

Or was there some processing done prior to deaggregating? Then check proces(ses).

 

 

On the other hand the aggregator just skips the offending tiem and continues.
Badge +1
Thanks Gio.  I tried GeometryValidator, but all the features passed. 

 

I also tried GeometryFilter, but all the features passed as Areas.

 

 

I can't work out why it is rejecting these polygons in particular.,,,,
Badge +3
you chack the log for their id and then inspect the file, see wich objects they are.

 

 

A polygon with 3 nodes would be, in fme, a line. Though any amount of vertices can be made inot a line and still be an area.. check for selfintersections.

 

 

 
Badge +1
I've worked out that the original file is made up of 128 aggregate features, and 729656 individual features.  The deaggreagator is actually rejecting every single aggregate features, therefore they are not being output! 
Badge +1
This is an example of the error message.  I've tried outputting to SHP and TAB and get the same issue:

 

 

===========================================================================

 

Polygon feature must have at least 4 coordinates...rejecting

 

REJECTING BELOW FEATURE:

 

+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++

 

Feature Type: `LDN_SurfaceWaterFloodRiskOutlineByDepth_200yr_v4_dg_FINAL'

 

Attribute(string)           : `FldDepth' has value `>1.5m'

 

Attribute(string)           : `FldOutlnId' has value `GP10000024'

 

Attribute(string)           : `Notes' has value `West Drayton Model'

 

Attribute(string)           : `PK_ID' has value `20'

 

Attribute(string)           : `RP' has value `200'

 

Attribute(string)           : `ScenarioNm' has value `1 in 200 year'

 

Attribute(string)           : `Shape_Area' has value `4009.27598482'

 

Attribute(string)           : `Shape_Leng' has value `1511.34239698'

 

Attribute(string)           : `__wb_out_feat_type__' has value `LDN_SurfaceWaterFloodRiskOutlineByDepth_200yr_v4_dg_FINAL'

 

Attribute(string)           : `_hierarchy_id' has value `203750'

 

Attribute(string)           : `fme_feature_type' has value `LDN_SurfaceWaterFloodRiskOutlineByDepth_200yr_v4'

 

Attribute(string)           : `fme_geometry' has value `fme_aggregate'

 

Attribute(entangled: string): `fme_type' has value `fme_area'

 

          entangled to [SHAPE_GEOMETRY]

 

Attribute(string)           : `multi_writer_id' has value `0'

 

Coordinate System: `_BritishNatGrid_0'

 

Geometry Type: IFMEMultiArea

 

Number of Areas: 0
Userlevel 4
Hi,

 

 

From your output: 

 

Number of Areas: 0

 

 

Guess that's the problem... What happens if you send it to the Inspector?

 

 

David
Badge +3
So it refusing to deaggregate aggregates?

 

I asusme u did inspect the shapefile by now?

 

 

a Multiarea with zero Area's....yous sure those are polygons and not lines?

 

On top it says:

 

LDN_SurfaceWaterFloodRiskOutlineByDepth_200yr_v4_dg_FINAL'":

 

suggesting lines...

 

 

Apart from this all, are you using deaggregator or not? Because that transformer deaggregates whatever type aggregate.

 

 

Wich proces outputs this error message?
Badge +1
The error message occurs when I send it from Deaggregator to Shapefile/TAB. 

 

I did Feature Inspector on one of the features with the error and this is part of the output I get when I do an Identify on the aggregated feature (:

 

 

I can see that it says Boundary: IFMELine (7 Coordinates).  So I am assuming that this could be the cause of the issue.

 

 

How do I set lines to polygons while a feature is still aggregated, considering that I can't deaggregate first?
Badge +3
I dont think the deaggreator is the problem.

 

The problem arrises when you try to write it to the shapefile, as this can hold only one geometrytype at a time.

 

 

After the deaggregator you need to capture the linear boundaries.

 

I assume the linear boundaries enclose the aggregated areas.

 

Use the geometryFilter to remove them or, if you need them as areas, use areabuilder on the boundaries.
Userlevel 2
Badge +17
Hi,

 

 

IFMELine is a valid type of polygon boundary. You should check non-polygonal features after de-aggregating.

 

Connect a CoordinateCounter to the Deaggregator, filter the features whose number of coordinate is less than 4 with the Tester, and then see them with the Data Inspector to determine if you can discard them.

 

 

Takashi
Badge +1
I've tried to capture the linear boundaries by using GeometryFilter and then AreaBuilder, but I'm still getting the same warnings.

 

 

However, I've noticed that when I choose the Mode of "Preserve Hierarchy" in the Deaggregator I get the warnings, but using "Flatten One Level" I don't.  I don't understand the Help files explanation of the difference between the modes though - I just want to deaggregate the multi areas into separate areas.
Badge +3
Do you get these warnings also if you disable the writer and only use an inspector?

 

 

Maybe its trying to deaggregate donuts when you try to keep hierarchy.

 

 

Maybe post the objects so we can look at em? Or are there too many?
Badge +1
I only get the warnings when I write to a Writer.  If I just use an Inspector I don't get the warnings.

 

 

If it is trying to deaggregate donuts (which do exist in the file), does that mean I should use one of the other modes?

 

 

There are over 100,000 features, so a bit hard to post..
Badge +1
I just tried Takashi's suggestion, and I output one feature with a CoordinateCount of <4.  There are actually no coordinates (count = 0) and therefore no geometry.

 

This must be causing the warnings! 

 

I don't understand how there is a feature with no geometry though.
Userlevel 2
Badge +17
FME aggregate geometry can be a tree structure.

 

e.g.

 

polygon1 and polygon2 belong to aggregate1.

 

aggregate1 and polygon3 belong to aggregate2.

 

 

In this example, aggregate2 is the topmost parent (root of the tree);

 

aggreate1 is a child of aggreate2 and also is parent of polygon1 and polygon2;

 

polygon1, polygon2 and polygon3 are leaves of the tree.

 

 

If you de-aggregate the topmost parent (aggregate2) with the Deaggregator (Mode: Preserve Hierarchy), output features will be:

 

- aggregate2: has no geometry, but has _hierarchy_child_id_list{}.

 

- aggregate1: has no geometry, but has _hierarchy_child_id_list{} and _hierarchy_parent_id.

 

- polygon1: has _hierarchy_parent_id.

 

- polygon2: has _hierarchy_parent_id. 

 

- polygon3: has _hierarchy_parant_id.

 

And, every feature has _hierarchy_id.

 

 

That is, the Deaggregator with the "Preserve Hierarchy" mode outputs every node of the tree structure. Every feature will have information of its parent and children, and parents may not have geometry.

 

 

You don't need to use the "Preserve Hierarchy" mode in many cases ;)
Userlevel 2
Badge +17
Here is a nice tree structure image in the help on Deaggregator. (http://docs.safe.com/fme/2015.0/html/FME_Desktop_Documentation/Subsystems/FME_Transformers/Content/Examples/deaggregator2.png)
Userlevel 2
Badge +17
Addition.

 

"Flatten One Level": outputs aggregate1 (consists of polygon1 and polygon2) and polygon3

 

"Flatten All Levels": outputs polygon1, polygon2, and polygon3

 

in the example above.
Badge +3
This is why u needed to use geometryfilter and inspect all its outputs, one of wich is a Null geometry output. I gather you did not do this?

 

 

If u did deaggreate a hierarchic aggregation and you preserved it, than i think it is clear why you were trying to write Null geometries to a polygon shapefile.

 

Indeed just flatten one level. You did tested and verified this yourself, as you sadi a couple of posts before.

 

 

 

Though, witt a bit of misunderstanded use, it is possible to create null geometry in a shapefile using Arcmap. This often involves Joines and then export of joined data. Or during editing.
Badge +1
Hi, thanks guys. 

 

 

Yes I believe that Preserving the Hierarchy is what is causing the warnings when writing to shapefile, as when I filter out features with hierarchy of 0, I don't get any warnings.

 

 

I tried the GeometryFilter but it kept outputting Areas only, perhaps I had the Deaggregator mode to a different setting the time I tried it.

 

 

Thanks again for your help.   I never understood the Hierarchy aspect properly before, but I believe I've got a grasp on it now.

Reply