[GIS] Splitting large shapefile into numerous smaller files based on number of objects in each smaller file using

fmeshapefilesplitting

I have a shapefile containing approximately 600 000 point-objects.

Unfortunately, for a couple of reasons I need to split this file into a larger number of shapefiles each containing approximately 200 objects.

Is anyone aware of any tools/scripts that allow me to automate this process?

I have tried to automate the process using e.g. the Split-tool in ArcGIS, however since I am more of an archaeologist than a programmer (and know next to no Python), I haven't been able to produce a script that does this.

I am guessing that the best way to do this would be to use a counter which increments with +1 for each object passed into a new shapefile, and when that counter reaches 200 it resets and a new shapefile is created into which the subsequent 200 objects are copied.

However, I haven't been able to write a script/create a workspace that does this.

So, does anyone have any suggestions of scripts/programs that are able to do this?

I am using FME Workbench.

Best Answer

In FME you can use a ModuloCounter transformer to number features in groups of 200. Then use a Feature Type Fanout (open the Feature Type properties, set the fanout By Attribute option, and select the ModuloCounter attribute).

The only issue is the 200 features per file might not be spatially related in any way - you'd have to do some form of tiling to get that - but it might not be a problem for you anyway.