I think a better way is creating the polygons from the roads and then use a FeatureReader to read the addresses per polygon. That way the polygons will processed one by one.
@erik_jan, could you deliberate on that answer a little more? I tried using the FeatureReader. I replaced the loop, the tester and the counter with the FeatureRead transformer, and it used the seperate polygons before the first clipper. But after that, all the clip results were merged together again before the Voronoi diagram was made. It's very important to only have points which lay within one polyon while making the voronoi diagrams, so postal code zones from across the street won't interfere with the others.
Both the Clipper and the VoronoiDiagrammer have a Group by option. In using the FeatureReader you have the option to merge the attributes of the streetpolygon and the addresses. Use the id of the streetpolygon as a Group by in the Clipper and the VoronoiDiagrammer. That way both will be processing per streetpolygon.
@erik_jan So if I understand you correctly, it should look something like this? I tried merging the data, but that just led to incredibly big data sets which I was unable to work with. Also the ID attribute is always zero or empty in the NWBpolyons output? Did I do something wrong? I can also only use the ID attribute to use the clipper. For the voronoi diagrammer it's impossible.
No @bartw. The FearureReader needs to be initiated by the polygons. That part is OK. But you want to read the addresses inside the FeatureReader, based on the spatial relation Interacting with its initiator. So the output of the FeatureReader needs to be addresses. The addresses read by the FeatureReader will go into the Clippe port, the initiator from the FeatureReader into the Clipper port. You do not need the addresses reader in your workspace at all as the addresses are read inside the FeatureReader.
@erik_jan, haha, I really start to feel like an idiot now. The orinial ID of the road dataset was 0, so I added the counter to give it an ID. With the first clipper I use group by _count, but then is doesn't run.
@bartw
You don't need to loop at all for this.
1 Create your roadgemetry. Use a BB or a hullaccumulator to create its areal coverage. Or if u have neighborhoodgemoetry (Buurt-vlakken for da dutch) that would be faster.
2 Clip or AoA Buurtgeometry with roadgeometry (for better performance dissolve roadgeo ). Clipper set to create aggregates = "no". (why in gn did fme put it standard to "yes"??)
3 Create a temp_ID on the result using a counter (always use different names for counter, common mistake..).
4 Spatialrelator and tester (or Spatialfilter or PointonArea) these area with adresses.
5 Create VoronoiCells grouped by temp_ID. Remember to use a StatisticsCalculator and tester to filter out temp_ID groups a< 3 else u can not us VC in group_by mode. The groups u can use VC without group+by for.
6 Clip result by the the result of 3 (inner-road areas with temp_ID)
Dissolve VoronoiCells groupde by temp_ID and Postcode
Here is wb:
@gio that sounds like exactly what I wanted to do. Thanks for the help, i'll give it a go ;)
@bartw
You don't need to loop at all for this.
1 Create your roadgemetry. Use a BB or a hullaccumulator to create its areal coverage. Or if u have neighborhoodgemoetry (Buurt-vlakken for da dutch) that would be faster.
2 Clip or AoA Buurtgeometry with roadgeometry (for better performance dissolve roadgeo ). Clipper set to create aggregates = "no". (why in gn did fme put it standard to "yes"??)
3 Create a temp_ID on the result using a counter (always use different names for counter, common mistake..).
4 Spatialrelator and tester (or Spatialfilter or PointonArea) these area with adresses.
5 Create VoronoiCells grouped by temp_ID. Remember to use a StatisticsCalculator and tester to filter out temp_ID groups a< 3 else u can not us VC in group_by mode. The groups u can use VC without group+by for.
6 Clip result by the the result of 3 (inner-road areas with temp_ID)
Dissolve VoronoiCells groupde by temp_ID and Postcode
Here is wb:
@gio For the Clipper change the aggregates to No then save as my defaults.