Skip to main content
Question

Creating polygons that contain the same number of points

  • July 30, 2019
  • 1 reply
  • 53 views

Hi there, I have a shapefile layer containing 1500 points. I want to create a shapefile layer of 5 polygons in which all 5 polygons contain the same number of points for some data analysis work. I did try using the 'Cluster' transformer (which I could have then digitised around by hand) but each cluster contained a random number of points. Does anyone know how I could do this please?

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

mark2atsafe
Safer
Forum|alt.badge.img+56
  • Safer
  • 2554 replies
  • July 30, 2019

Try the SpatialSorter (an FME Hub transformer).

You need to set a group size, rather than number of groups, but you can easily calculate that with a StatisticsCalculator and ExpressionEvaluator (or just go with 300 as a fixed value).

Additionally, if you look at the FME Desktop training course, chapter 3 has a set of exercises that carry out this exact task (taking all the addresses in Vancouver and generating 5 different garbage collection zones), so maybe that would be worth a look: https://s3.amazonaws.com/gitbook/Desktop-Basic-2019/DesktopBasic3WorkspaceDesign/3.00.WorkspaceDesign.html

In fact you could download the workspace for that exercise and see if it can be used directly with your data! You can get the workspaces/data from here: https://s3.amazonaws.com/FMEData/FMEData2019.zip (it's quite a large file)