I am totally new to FME.
I would like to merge all the shapefiles located in the all the folders called 2012. Any ideas how to do it?
I am totally new to FME.
I would like to merge all the shapefiles located in the all the folders called 2012. Any ideas how to do it?
It depends :)
Hello, are the shapefiles always the same amount of folders deep? You can chain a couple of FeatureReaders set to Directory and File Pathnames.
FeatureReader 1 reads Directory and returns Dir 1 and Dir 2 paths, FeatureReader 2 reads Dir 1 and Dir 2 and returns the 6 subfolders, et cetera. The last FeatureReader is set to Shapefile.
With Testers in between the FeatureReaders you can e.g. implement checks to exclude non-shapefiles, or direct the correct .shp paths to the final SHP FeatureReader.
It depends :)
One way to do this:
GeometryFilter to split point, line, area.
AttributeCreators to create attribute fme_feature_type_name = point, line or polygon.
SchemaScanner to generate SchemaFeature.
Group by fme_feature_type_name.
Ignore ^fme_|^multi_|^csv_|GeometryType
Dynamic FeatureWriter to write per fme_feature_type_name.
Group By fme_feature_type_name.
I attached a sample workspace doing this.
It depends :)
All are polygons with the same attributes and in the same coordinate system.
It depends :)
All are polygons with the same attributes and in the same coordinate system.
Then you can just use a FeatureReader to read all data and a FeatureWriter to write it in one shape. The attached workspace will also work, just remove the Reprojector.
It depends :)
One way to do this:
GeometryFilter to split point, line, area.
AttributeCreators to create attribute fme_feature_type_name = point, line or polygon.
SchemaScanner to generate SchemaFeature.
Group by fme_feature_type_name.
Ignore ^fme_|^multi_|^csv_|GeometryType
Dynamic FeatureWriter to write per fme_feature_type_name.
Group By fme_feature_type_name.
I attached a sample workspace doing this.
Thank you very much for your reply. Unfortunately, as I have the FME version 2022.2.1.0, I cannot see the FeatureReader , that it is just what I am interested in.
If I use C:\Data\**\*.shp as Dataset in the Reader, I am merging all the shapefiles, but I am interested in merging only shapefiles in the folders named “CLC2012”.
Is there any way to filter the subfolders in this reader to get only subfolders named CLC2012?
Thank you very much for your reply. Unfortunately, as I have the FME version 2022.2.1.0, I cannot see the FeatureReader , that it is just what I am interested in.
If I use C:\Data\**\*.shp as Dataset in the Reader, I am merging all the shapefiles, but I am interested in merging only shapefiles in the folders named “CLC2012”.
Is there any way to filter the subfolders in this reader to get only subfolders named CLC2012?
Several options: