Skip to main content
Solved

Merging SHP located in different directories

  • July 19, 2022
  • 1 reply
  • 9 views

gerard
Participant
Forum|alt.badge.img

I have one shapefile with polygons representing a cartographic sheets at some scale. Each polygon has an unique identifier (IDn).

I have used SpatialRelator transformer (see attached image) to look for neighbor sheets for each of them, and ListConcatenator to save for each polygon the list of neighbor polygons identifiers.

 

The attached example shows that selected polygon (ID0) has 3 neighbor polygons (ID1,ID2,ID3). The IDn is the identifier included in the shapefile name located in some directory following this pattern: .\\IDn\\*IDn*.shp

I have to merge the 4 shp corresponding to ID0, ID1, ID2, ID3 to output only one shapefile.

 

I have used Directory and File Pathnames READER in other context but here I don't know how to look for these files. Maybe using WorkspaceRunner or PythonCaller? Please, could you give some advice?

 

Thank you in advance!

 

Best answer by gerard

Sorry for the noise, I have found the answer.

I have created a new FME workspace where I can read all four shapefiles using a single Shape Reader (option "Single merged feature type") and write the data to a Shape writer using one new featuretype.

This post is closed to further activity.
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.

1 reply

gerard
Participant
Forum|alt.badge.img
  • Author
  • Participant
  • 15 replies
  • Best Answer
  • July 19, 2022

Sorry for the noise, I have found the answer.

I have created a new FME workspace where I can read all four shapefiles using a single Shape Reader (option "Single merged feature type") and write the data to a Shape writer using one new featuretype.