The highlighted Polygons should form a larger polygon with the same attributes. Both have different IDs, so after merging only one should be retained. The same transformation needs to occur for other polygons in the screenshot also. Usage of Dissolver and FeatureMerger transformers has not yielded results. I hope some light can be shed on the right approach to take here.
- Home
- Forums
- FME Form
- Transformers
- How to merge adjacent polygons while retaining the common attributes?
How to merge adjacent polygons while retaining the common attributes?
- August 31, 2020
- 11 replies
- 375 views
It may be an old question, an answered question, an implemented idea, or a notification-only post.
Please check post dates before relying on any information in a question or answer.
For follow-up or related questions, please post a new question or idea.
If there is a genuine update to be made, please contact us and request that the post is reopened.
11 replies
- 7813 replies
- August 31, 2020
Hi @sandexter , looks like the vertical and the horizontal straight lines shown in your screenshot are boundaries of rectangular areas something like tiles. If so, are their x-coordinate (for vertical lines) and y-coordinate (for horizontal lines) known? Or, do the polygons have an attribute that stores ID of the parent "tile" to which each polygon belongs?
- 1891 replies
- August 31, 2020
@sandexter Dissolver should work in this case if you have areas that touch at the tile boundaries. You might have to use Snapper to make sure the boundary points do touch. Are you able to attach a small sample dataset?
- Author
- 3 replies
- September 1, 2020
Hi @sandexter , looks like the vertical and the horizontal straight lines shown in your screenshot are boundaries of rectangular areas something like tiles. If so, are their x-coordinate (for vertical lines) and y-coordinate (for horizontal lines) known? Or, do the polygons have an attribute that stores ID of the parent "tile" to which each polygon belongs?
@Takashi Iijima Yes an attribute stores the tile ID for each feature. The highlighted polygons have different tile IDs but the tile IDs are sequential, (tile ID 10 for the one above and tile ID 11 for the one below). No, the coordinates aren't explicitly known for the lines.
- Celebrity
- 3670 replies
- September 1, 2020
As @Mark Stoakes says, the Dissolver should do the trick. You say it has not yielded results, can you show us how you have set it up?
- 7813 replies
- September 1, 2020
Hi @sandexter , looks like the vertical and the horizontal straight lines shown in your screenshot are boundaries of rectangular areas something like tiles. If so, are their x-coordinate (for vertical lines) and y-coordinate (for horizontal lines) known? Or, do the polygons have an attribute that stores ID of the parent "tile" to which each polygon belongs?
I think the following procedure might help you.
Create desired polygons:
- Dissolve the polygons grouping by tile ID to create tile polygons.
- Use the GeometryCoercer to convert all the tile polygons and the original polygons into their boundary lines.
- Send all the boundary lines to a LineOnLineOverlayer. Here, overlap count of a resulting line should be 4
3[edited] if it is a boundary between two tiles, 2 otherwise. - Use the Tester to filter out the lines whose overlap count is 4
3[edited] - i.e. boundaries between two tiles. - Send the remnant lines to an AreaBuilder to create polygons, which would be your desired ones.
Restore attributes of the original polygons:
- In another data flow, use the CenterPointReplacer (Mode: Any Inside Point) to transform the original polygons with their inside points.
- Use the SpatialFilter to merge the attributes from the inside point to the resulting polygons created by the procedure above.
- 7813 replies
- September 1, 2020
As @Mark Stoakes says, the Dissolver should do the trick. You say it has not yielded results, can you show us how you have set it up?
If the polygons to be dissolved have the same ID, it would be easy to dissolve them with the Dissolver, by setting the ID attribute to the Group By parameter. However, in this case, the IDs of polygons are different each other.
I thinks it's the point of the question.
- Author
- 3 replies
- September 1, 2020
I think the following procedure might help you.
Create desired polygons:
- Dissolve the polygons grouping by tile ID to create tile polygons.
- Use the GeometryCoercer to convert all the tile polygons and the original polygons into their boundary lines.
- Send all the boundary lines to a LineOnLineOverlayer. Here, overlap count of a resulting line should be 4
3[edited] if it is a boundary between two tiles, 2 otherwise. - Use the Tester to filter out the lines whose overlap count is 4
3[edited] - i.e. boundaries between two tiles. - Send the remnant lines to an AreaBuilder to create polygons, which would be your desired ones.
Restore attributes of the original polygons:
- In another data flow, use the CenterPointReplacer (Mode: Any Inside Point) to transform the original polygons with their inside points.
- Use the SpatialFilter to merge the attributes from the inside point to the resulting polygons created by the procedure above.
@Takashi Iijima Thank you for the detailed response. I was able to repeat the steps 1 and 2. However, in step 3, the overlap count for both tile boundaries is 2 and otherwise is either 1 or 2. How should i approach this?
- Author
- 3 replies
- September 1, 2020
If the polygons to be dissolved have the same ID, it would be easy to dissolve them with the Dissolver, by setting the ID attribute to the Group By parameter. However, in this case, the IDs of polygons are different each other.
I thinks it's the point of the question.
@Takashi Iijima You are correct
- 7813 replies
- September 6, 2020
Hi @sandexter , looks like the vertical and the horizontal straight lines shown in your screenshot are boundaries of rectangular areas something like tiles. If so, are their x-coordinate (for vertical lines) and y-coordinate (for horizontal lines) known? Or, do the polygons have an attribute that stores ID of the parent "tile" to which each polygon belongs?
I think theoretically the overlap count of the lines output from the LineOnLineOverlayer should be 4 (3 was wrong in my previous answer) if the line was on a tile boundary, 2 otherwise.
See also the attached workspace template (FME 2020.1.1.1) including a sample dataset.
- Contributor
- 25 replies
- October 29, 2020
Looks like nearly the same issue I am facing --> https://community.safe.com/s/question/0D54Q00008DrPoxSAF/aggregat-polygones-which-touch-or-intersect-each-other-on-the-basis-of-conditions?t=1603950884399
Maybe some projections can help you (e.g. the SpatialRelator with Lists).
- Contributor
- 25 replies
- October 29, 2020
I think the following procedure might help you.
Create desired polygons:
- Dissolve the polygons grouping by tile ID to create tile polygons.
- Use the GeometryCoercer to convert all the tile polygons and the original polygons into their boundary lines.
- Send all the boundary lines to a LineOnLineOverlayer. Here, overlap count of a resulting line should be 4
3[edited] if it is a boundary between two tiles, 2 otherwise. - Use the Tester to filter out the lines whose overlap count is 4
3[edited] - i.e. boundaries between two tiles. - Send the remnant lines to an AreaBuilder to create polygons, which would be your desired ones.
Restore attributes of the original polygons:
- In another data flow, use the CenterPointReplacer (Mode: Any Inside Point) to transform the original polygons with their inside points.
- Use the SpatialFilter to merge the attributes from the inside point to the resulting polygons created by the procedure above.
Okay, with this projection I was able to fix my problem (https://community.safe.com/s/question/0D54Q00008DrPoxSAF/aggregat-polygones-which-touch-or-intersect-each-other-on-the-basis-of-conditions?t=1603950884399)! Thank you takashi.
I will describe it in "my" thread in deep, so maybe it will help you sandexter too.
The highlighted Polygons should form a larger polygon with the same attributes. Both have different IDs, so after merging only one should be retained. The same transformation needs to occur for other polygons in the screenshot also. Usage of Dissolver and FeatureMerger transformers has not yielded results. I hope some light can be shed on the right approach to take here.
Hi @sandexter , looks like the vertical and the horizontal straight lines shown in your screenshot are boundaries of rectangular areas something like tiles. If so, are their x-coordinate (for vertical lines) and y-coordinate (for horizontal lines) known? Or, do the polygons have an attribute that stores ID of the parent "tile" to which each polygon belongs?
@sandexter Dissolver should work in this case if you have areas that touch at the tile boundaries. You might have to use Snapper to make sure the boundary points do touch. Are you able to attach a small sample dataset?
Hi @sandexter , looks like the vertical and the horizontal straight lines shown in your screenshot are boundaries of rectangular areas something like tiles. If so, are their x-coordinate (for vertical lines) and y-coordinate (for horizontal lines) known? Or, do the polygons have an attribute that stores ID of the parent "tile" to which each polygon belongs?
@Takashi Iijima Yes an attribute stores the tile ID for each feature. The highlighted polygons have different tile IDs but the tile IDs are sequential, (tile ID 10 for the one above and tile ID 11 for the one below). No, the coordinates aren't explicitly known for the lines.
As @Mark Stoakes says, the Dissolver should do the trick. You say it has not yielded results, can you show us how you have set it up?
Hi @sandexter , looks like the vertical and the horizontal straight lines shown in your screenshot are boundaries of rectangular areas something like tiles. If so, are their x-coordinate (for vertical lines) and y-coordinate (for horizontal lines) known? Or, do the polygons have an attribute that stores ID of the parent "tile" to which each polygon belongs?
I think the following procedure might help you.
Create desired polygons:
- Dissolve the polygons grouping by tile ID to create tile polygons.
- Use the GeometryCoercer to convert all the tile polygons and the original polygons into their boundary lines.
- Send all the boundary lines to a LineOnLineOverlayer. Here, overlap count of a resulting line should be 4
3[edited] if it is a boundary between two tiles, 2 otherwise. - Use the Tester to filter out the lines whose overlap count is 4
3[edited] - i.e. boundaries between two tiles. - Send the remnant lines to an AreaBuilder to create polygons, which would be your desired ones.
Restore attributes of the original polygons:
- In another data flow, use the CenterPointReplacer (Mode: Any Inside Point) to transform the original polygons with their inside points.
- Use the SpatialFilter to merge the attributes from the inside point to the resulting polygons created by the procedure above.
As @Mark Stoakes says, the Dissolver should do the trick. You say it has not yielded results, can you show us how you have set it up?
If the polygons to be dissolved have the same ID, it would be easy to dissolve them with the Dissolver, by setting the ID attribute to the Group By parameter. However, in this case, the IDs of polygons are different each other.
I thinks it's the point of the question.
I think the following procedure might help you.
Create desired polygons:
- Dissolve the polygons grouping by tile ID to create tile polygons.
- Use the GeometryCoercer to convert all the tile polygons and the original polygons into their boundary lines.
- Send all the boundary lines to a LineOnLineOverlayer. Here, overlap count of a resulting line should be 4
3[edited] if it is a boundary between two tiles, 2 otherwise. - Use the Tester to filter out the lines whose overlap count is 4
3[edited] - i.e. boundaries between two tiles. - Send the remnant lines to an AreaBuilder to create polygons, which would be your desired ones.
Restore attributes of the original polygons:
- In another data flow, use the CenterPointReplacer (Mode: Any Inside Point) to transform the original polygons with their inside points.
- Use the SpatialFilter to merge the attributes from the inside point to the resulting polygons created by the procedure above.
@Takashi Iijima Thank you for the detailed response. I was able to repeat the steps 1 and 2. However, in step 3, the overlap count for both tile boundaries is 2 and otherwise is either 1 or 2. How should i approach this?
If the polygons to be dissolved have the same ID, it would be easy to dissolve them with the Dissolver, by setting the ID attribute to the Group By parameter. However, in this case, the IDs of polygons are different each other.
I thinks it's the point of the question.
@Takashi Iijima You are correct
Hi @sandexter , looks like the vertical and the horizontal straight lines shown in your screenshot are boundaries of rectangular areas something like tiles. If so, are their x-coordinate (for vertical lines) and y-coordinate (for horizontal lines) known? Or, do the polygons have an attribute that stores ID of the parent "tile" to which each polygon belongs?
I think theoretically the overlap count of the lines output from the LineOnLineOverlayer should be 4 (3 was wrong in my previous answer) if the line was on a tile boundary, 2 otherwise.
See also the attached workspace template (FME 2020.1.1.1) including a sample dataset.
Looks like nearly the same issue I am facing --> https://community.safe.com/s/question/0D54Q00008DrPoxSAF/aggregat-polygones-which-touch-or-intersect-each-other-on-the-basis-of-conditions?t=1603950884399
Maybe some projections can help you (e.g. the SpatialRelator with Lists).
I think the following procedure might help you.
Create desired polygons:
- Dissolve the polygons grouping by tile ID to create tile polygons.
- Use the GeometryCoercer to convert all the tile polygons and the original polygons into their boundary lines.
- Send all the boundary lines to a LineOnLineOverlayer. Here, overlap count of a resulting line should be 4
3[edited] if it is a boundary between two tiles, 2 otherwise. - Use the Tester to filter out the lines whose overlap count is 4
3[edited] - i.e. boundaries between two tiles. - Send the remnant lines to an AreaBuilder to create polygons, which would be your desired ones.
Restore attributes of the original polygons:
- In another data flow, use the CenterPointReplacer (Mode: Any Inside Point) to transform the original polygons with their inside points.
- Use the SpatialFilter to merge the attributes from the inside point to the resulting polygons created by the procedure above.
Okay, with this projection I was able to fix my problem (https://community.safe.com/s/question/0D54Q00008DrPoxSAF/aggregat-polygones-which-touch-or-intersect-each-other-on-the-basis-of-conditions?t=1603950884399)! Thank you takashi.
I will describe it in "my" thread in deep, so maybe it will help you sandexter too.
Related Topics
Expected Revene Charticon
Dashboard & ToolsStore filter in some Charts do not workicon
Dashboard & ToolsBreakdown Subscription Retention Chart by Countryicon
Dashboard & ToolsMigrating to RevenueCat, aliasing not working as expected for custom user idsicon
SDKsNew conversion rate charts
RevenueCat Announcements
Helpful Members This Week
- takashi
29 votes
- hkingsbury
15 votes
- virtualcitymatt
11 votes
- redgeographics
9 votes
- jdh
9 votes
- alexbiz
8 votes
- ebygomm
8 votes
- nielsgerrits
8 votes
- tomf
7 votes
- martinkoch
6 votes
Community Stats
- 31,853
- Posts
- 120,980
- Replies
- 39,485
- Members
Latest FME
Enter your E-mail address. We'll send you an e-mail with instructions to reset your password.
Scanning file for viruses.
Sorry, we're still checking this file's contents to make sure it's safe to download. Please try again in a few minutes.
OKThis file cannot be downloaded
Sorry, our virus scanner detected that this file isn't safe to download.
OKCookie policy
We use cookies to enhance and personalize your experience. If you accept you agree to our full cookie policy. Learn more about our cookies.
Cookie settings
We use 3 different kinds of cookies. You can choose which cookies you want to accept. We need basic cookies to make this site work, therefore these are the minimum you can select. Learn more about our cookies.