Dynamic Geometry

Of the three main components of a schema:

  • Feature Type
  • Attributes
  • Geometry

...the last of these to investigate is Geometry; in particular how a workspace author can decide which geometries are valid for a particular feature type.


Schema Geometry Definition

The geometry permitted in an output dataset depends on the format used. Some formats allow any geometry - or mix of geometries - to exist in a feature type.

However, some formats do not allow a mix of geometries in a single feature type, and that can cause problems.

For example, a standard (static) Shapefile writer feature type allows you to pick the geometry allowed in that file:

In a dynamic workspace this changes. The geometry type permitted depends on that defined in the chosen schema:

By default - when the Schema Source is the same as the source data being read by the reader - then the permitted geometry will be a duplicate of that source dataset's schema.

But when the Schema Source parameter is changed to point to another dataset, then the permitted geometry is what is defined by that dataset's schema.

If the geometry of the data to be written is different from that schema, and the destination format does not support multiple geometry types, then features would be dropped instead of written.


Fixed Geometry Definition

Even in a dynamic translation, the workspace author may set the dynamic schema parameter for permitted geometry and back to a fixed value:

Here the author is selecting shape_polygon as the permitted geometry type. This will override the geometry defined by the chosen schema source, so that polygon features (but only polygon features) can be written.


First Feature Geometry Definition

The other option for defining geometry type is First Feature Defines Geometry Type.

Geometry type can be difficult to handle in a dynamic translation because there is a degree of uncertainty about what geometry types might be in the source data, and how well they will match up to the geometry types specified in the source schema. However, this same uncertainty makes it difficult to set a fixed geometry definition.

The First Feature Defines Geometry Type option solves this. When selected, the first feature to arrive at the writer gets to set the geometry type. That way the author does not need to know in advance what geometry is being processed or what geometry the schema permits.

For example, if the first feature is a polygon, then the geometry type for that feature type is set to polygon only; subsequent features destined for the same feature type are refused if they do not have the same polygon geometry.


Sister Intuitive says…
If you've understood everything so far about dynamic translations, without having to read each section at least twice, then you are doing very well. This is a very advanced topic and not everyone will get it first time.

Basically, all of these settings allow us to create an output dataset whose schema is defined in multiple ways.

If you can keep that idea in your head, when faced with schema handling beyond the usual static workspace you'll know what functionality is required and can look it up in this manual or on the FME Knowledge Centre, and be able to figure out what techniques match your particular need.

Also, this table may help...
I Know the Format I Don't Know the Format
I Know the Layers Static Generic I Know the Attributes
I Don't Know the Layers Fanout Generic+Fanout I Know the Attributes
I Know the Layers Dynamic Generic+Dynamic I Don't Know the Attributes
I Don't Know the Layers Dynamic Generic+Dynamic I Don't Know the Attributes

results matching ""

    No results matching ""