Skip to main content

Hello,

 

I have a bunch of polygons (grid squares) and points.

Each point has an attribute to qualify its type (1, 2, 3, 4...).

 

 

First I tried to create in each square an attribute with the number of points it contains.

This I achieved using a PointOnAreaOverlayer.

 

Now I want to create on each square X attributes with the number of point by type.

GRID_IDTYPE1_countTYPE2_countTYPE3_count...XXXXXXX0122

 

YYYYYYY1122

 

ZZZZZZZ1284

 

 

The thing is I don't know inadvance which type I'll get. I can have types 1/2/3 one time but then 1/3/4/6.

Two questions I ask myself about this:

  1. How can I ventilate the features by type not knowing in advance the different types (with the testfilter I need to know the types in advance...)
  2. How to get my counts attributes ?

Any help will be welcome :)

To start with, I would take use the point on Area Overlayer to transfer the Grid_ID to each point. You can then send the points to a statistics calculator grouping by Grid ID and Type. Then you need to pivot the data

Count_points_in_area.fmwt


To start with, I would take use the point on Area Overlayer to transfer the Grid_ID to each point. You can then send the points to a statistics calculator grouping by Grid ID and Type. Then you need to pivot the data

Count_points_in_area.fmwt

Thanks @ebygomm for your fast answer !

Nevertheless, I can't predict which will be the names of my attributes to expose in the AttributeExposer as the types can vary depending on the inputs (I gave you one extract for the example).

A maybe related question I asked myself already in the past is : is it possible to ventilate the features by type not knowing in advance the different types.

As i would do with a TestFilter if I know the types :

But I don't know how to do this. I expect it would help me but not sure how...

This is a parallel question though...


Thanks @ebygomm for your fast answer !

Nevertheless, I can't predict which will be the names of my attributes to expose in the AttributeExposer as the types can vary depending on the inputs (I gave you one extract for the example).

A maybe related question I asked myself already in the past is : is it possible to ventilate the features by type not knowing in advance the different types.

As i would do with a TestFilter if I know the types :

But I don't know how to do this. I expect it would help me but not sure how...

This is a parallel question though...

Ventilate = fanout?

If you're writing something dynamically, it is not necessary to expose the attributes on the canvas, although it is not necessarily straightforward.

If you want to split them within the workspace, for example in a test filter then that is not possible unless you know the attributes in advance.


Ventilate = fanout?

If you're writing something dynamically, it is not necessary to expose the attributes on the canvas, although it is not necessarily straightforward.

If you want to split them within the workspace, for example in a test filter then that is not possible unless you know the attributes in advance.

yes ventilate = fanout.

Indeed, it can be sufficient to use it only when writing to output. I'll give it a try.


Ventilate = fanout?

If you're writing something dynamically, it is not necessary to expose the attributes on the canvas, although it is not necessarily straightforward.

If you want to split them within the workspace, for example in a test filter then that is not possible unless you know the attributes in advance.

@ebygomm With fanout I can for example create an Excel file with the name of the ID or a tab in the Excel file with the name of the ID but I can't create X columns with the name of the ID and the count relative to this ID.

I think I'll have to find another way or check with the requestor if he can give me a fixed list of possible values...


@ebygomm With fanout I can for example create an Excel file with the name of the ID or a tab in the Excel file with the name of the ID but I can't create X columns with the name of the ID and the count relative to this ID.

I think I'll have to find another way or check with the requestor if he can give me a fixed list of possible values...

It is possible, by creating the schema within the workspace. In this way you can write out attributes without knowing what they are. I normally use python to create a schema when doing this but i think it's possible without as well


An example of writing to excel without exposing attributes @p.jeremie

Count_points_in_area_to_excel.fmwt

Count_points_in_area_to_excel_2018.fmwt


It is possible, by creating the schema within the workspace. In this way you can write out attributes without knowing what they are. I normally use python to create a schema when doing this but i think it's possible without as well

Hum... and how would you do this with or without python @ebygomm ?

I'm not sure to understand what you mean by "creating the schema"...


Hum... and how would you do this with or without python @ebygomm ?

I'm not sure to understand what you mean by "creating the schema"...

@ebygomm can you tell me what you mean by "creating the schema" ?


@ebygomm can you tell me what you mean by "creating the schema" ?

There is an example in the post i created at Nov 13 at 01:40 PM

 


An example of writing to excel without exposing attributes @p.jeremie

Count_points_in_area_to_excel.fmwt

Count_points_in_area_to_excel_2018.fmwt

@ebygomm Apparently you use a FME version > 2018.1 so I can't open your fmwt without loosing some transformers (and the links).

I tried to recreate the transformers and links but I don't understand how you count and create the points by TYPE in each grid square feature.

- the requestor input port of the featuremerger is linked to what ? GRID ?

- where do you count the points by grid square ?

Maybe you can put printscreens of the transformer settings and workspace ?


There is an example in the post i created at Nov 13 at 01:40 PM

 

My bad, I didn't saw this answer !


@ebygomm Apparently you use a FME version > 2018.1 so I can't open your fmwt without loosing some transformers (and the links).

I tried to recreate the transformers and links but I don't understand how you count and create the points by TYPE in each grid square feature.

- the requestor input port of the featuremerger is linked to what ? GRID ?

- where do you count the points by grid square ?

Maybe you can put printscreens of the transformer settings and workspace ?

I've uploaded a 2018 version above


Reply