Question

Extract new shapefile by filtering attributes in overlap features


Badge

I have an input shapefile with many features that overlap between them.

I need to create a new shapefile with many features as well, derived from this input shapefile, but without overlap features. For this, I need that the overlap features is converted to just one feature considering filtering by attributes of the overlap features. These attributes are related to the date inserted in a field, but should also be extracted accordingly . I mean, I need to extract a feature in overlap areas considering this order of priority (see path field): 201705, 201704.. ; if not exist, use 201807, 201805, 201806, If there are attributes equal (same month and year), use the most recent. An easy example in attachment to explain this better, Features of final shapefile should be merged if adjacent features are equal. IN the example final shapefile should have 3 features without overlap areas


10 replies

Userlevel 5
Badge +25

You can use an AreaOnAreaOverlayer and have it create a list, then sort that list on the year/month (ListSorter) and use a ListIndexer, with index 1, to promote the attributes of the first list element to attributes on the feature itself.

Then Dissolve to merge adjacent areas with the same year/month value

Badge

You can use an AreaOnAreaOverlayer and have it create a list, then sort that list on the year/month (ListSorter) and use a ListIndexer, with index 1, to promote the attributes of the first list element to attributes on the feature itself.

Then Dissolve to merge adjacent areas with the same year/month value

Many thanks for the indications, but I couldnt do it....I dont know how to connect the list of attributes and the operators. I am not an expert in FME. psil.zip.

Could you help send me the specific model with this simple shapefile in attachment? psil.zip.If I understand a simple one, I could generate more complex

Many thansks in advance!

Userlevel 5
Badge +25

Many thanks for the indications, but I couldnt do it....I dont know how to connect the list of attributes and the operators. I am not an expert in FME. psil.zip.

Could you help send me the specific model with this simple shapefile in attachment? psil.zip.If I understand a simple one, I could generate more complex

Many thansks in advance!

Here you go:

overlaps.fmw

annotation-2020-02-05-110650 

I'm using a StringSearcher to look for a regular expression in the path, in this case 20\\d{4} which means 20 followed by 4 digits, e.g. 201807, for a year/month combo. Then an AreaOnAreaOverlayer, set to create a list. So every point where 2 or more aerial photos overlap that overlap gets a list of all the year/month values. Then I use a ListSorter to sort on that year/month value, descending so the first list element is the most recent date. Finally a ListIndexer to grab the attributes from that first list element (we start counting at 0).

Badge

You can use an AreaOnAreaOverlayer and have it create a list, then sort that list on the year/month (ListSorter) and use a ListIndexer, with index 1, to promote the attributes of the first list element to attributes on the feature itself.

Then Dissolve to merge adjacent areas with the same year/month value

Easier for asking: I mean, if a I have a shapefile (many features) with a field called index (0,1,2...) in my original file in order to prioritize the overlap features (0 is more priority, then 1, 2, 3...).

I need the output shapefile promote this index field in the overlap areas (0, then 1, 2, 3..)prueba.fmwprueba.zip

When and how to connect ListSorter in the transformer "areaonareaoverlayer"? Thanks

Userlevel 5
Badge +25

Easier for asking: I mean, if a I have a shapefile (many features) with a field called index (0,1,2...) in my original file in order to prioritize the overlap features (0 is more priority, then 1, 2, 3...).

I need the output shapefile promote this index field in the overlap areas (0, then 1, 2, 3..)prueba.fmwprueba.zip

When and how to connect ListSorter in the transformer "areaonareaoverlayer"? Thanks

That would be the same concept: first overlay, create a list, then sort and index that list.

Badge

Here you go:

overlaps.fmw

annotation-2020-02-05-110650 

I'm using a StringSearcher to look for a regular expression in the path, in this case 20\\d{4} which means 20 followed by 4 digits, e.g. 201807, for a year/month combo. Then an AreaOnAreaOverlayer, set to create a list. So every point where 2 or more aerial photos overlap that overlap gets a list of all the year/month values. Then I use a ListSorter to sort on that year/month value, descending so the first list element is the most recent date. Finally a ListIndexer to grab the attributes from that first list element (we start counting at 0).

Great! Many thanks! Just a question. The list sorter is not the recent month/ year, it is a different criteria. This is the promotion:

201809, 201808, 201807, 201806, 201805, 201810, 201909, 201908, 201907, 201806, 201905, 201910, 201709, 201708, 201707, 201706, 201705, 201710,

I dont know how to consider it in the model. I mean, the list sort should be:

I understand I should add a StringSearchParameter before LIstSort. Could you help me?

Many thanks!!!

Userlevel 5
Badge +25

Great! Many thanks! Just a question. The list sorter is not the recent month/ year, it is a different criteria. This is the promotion:

201809, 201808, 201807, 201806, 201805, 201810, 201909, 201908, 201907, 201806, 201905, 201910, 201709, 201708, 201707, 201706, 201705, 201710,

I dont know how to consider it in the model. I mean, the list sort should be:

I understand I should add a StringSearchParameter before LIstSort. Could you help me?

Many thanks!!!

You're probably going to have to use an AttributeValueMapper before the AreaOnAreaOverlayer to create a new attribute (let's call that priority) and map the year/month values to a simple 1...n range, then sort your list on that.

Badge

You're probably going to have to use an AttributeValueMapper before the AreaOnAreaOverlayer to create a new attribute (let's call that priority) and map the year/month values to a simple 1...n range, then sort your list on that.

Hello, again,

 

Following to overlaps.fmw, I dont understand why the output of areaonarealayer (before listsorter) consider month/year attribute of the most recent overlap. Is a criteria included in this operator? You say "Each new section has a list of year/month values" (areaonarealayer ), but I see for each section just one date/year (even it has 3 overlaps). Why?

Imean, if a feature is generated by 3 overlaps, why are not the 3 dates included and then we will include attributes selection, listsort, etc. I see the output (17 features) is the same as list shorter (17) and listindexer (17).

 

Anyway, I tried to include Attribute Value Mapper but it does not work. Could you please send me a model considering for example this priority in dates priority? 201705 (most priority), 201807, 201806, 201805 (less priority)?

Thanks a lot!

Badge

Hello, again,

 

Following to overlaps.fmw, I dont understand why the output of areaonarealayer (before listsorter) consider month/year attribute of the most recent overlap. Is a criteria included in this operator? You say "Each new section has a list of year/month values" (areaonarealayer ), but I see for each section just one date/year (even it has 3 overlaps). Why?

Imean, if a feature is generated by 3 overlaps, why are not the 3 dates included and then we will include attributes selection, listsort, etc. I see the output (17 features) is the same as list shorter (17) and listindexer (17).

 

Anyway, I tried to include Attribute Value Mapper but it does not work. Could you please send me a model considering for example this priority in dates priority? 201705 (most priority), 201807, 201806, 201805 (less priority)?

Thanks a lot!

In attachment a model including attributevaluemapper operator. I am doing something wrong. For example, FID 1 should be 201807 (and not 201806), FID 13 should be 201705 (and not 201806). prueba.fmwCan you help me? Thanks,

Userlevel 5
Badge +25

Hello, again,

 

Following to overlaps.fmw, I dont understand why the output of areaonarealayer (before listsorter) consider month/year attribute of the most recent overlap. Is a criteria included in this operator? You say "Each new section has a list of year/month values" (areaonarealayer ), but I see for each section just one date/year (even it has 3 overlaps). Why?

Imean, if a feature is generated by 3 overlaps, why are not the 3 dates included and then we will include attributes selection, listsort, etc. I see the output (17 features) is the same as list shorter (17) and listindexer (17).

 

Anyway, I tried to include Attribute Value Mapper but it does not work. Could you please send me a model considering for example this priority in dates priority? 201705 (most priority), 201807, 201806, 201805 (less priority)?

Thanks a lot!

You're probably looking at the Table View, lists don't show up there. If you select an overlapping part and check out the Feature Information window you should see the list elements:

So for that selected area, where 2 of the original polygons overlap, you'll see a _list{0} and _list{1} set of attributes, each holding the attributes of one of the original polygons.

The AttributeValueMapper would come before the AreaOnAreaOverlayer, to map the year/month values to a new attribute, FID in this case. Then change the ListSorter to sort on that attribute.

Reply