Hi Zoe,
If your purpose is to create a single line per a bus stop, which connects between the bus stop and the closest zone centroid within 800m, I think the NeighborFinder+VertexCreator is suitable.
Add a NeighborFinder to the workspace; send the bus stops to the Base port; send the zone centroids to the Candidate port; set "800" to the "Maximum Distance" parameter.
Connect a VertexCreator to the Matched port, and set parameters like this.
Mode: Add Point
X Value: _closest_candidate_x
Y Value: _closest_candidate_y
If you need to create multiple lines per a bus stop, which connect between the bus stop and every zone centroid, you can modify the data flow above.
- set enough large value to the "Maximum Distance" parameter,
- specify "Close Candidate List Name" (e.g. "_list"),
- insert a ListExploder between the Matched port and the VertexCreator; explode the list,
- change the VertexCreator parameters (not use leading underscore),
X Value: closest_candidate_x
Y Value: closest_candidate_y
- and then add an attribute to the features, which indicates "pass" or "fail" based on the length.
See the help docs on the transformers to learn more about their usage.
Note that the CenterPointReplacer transforms the input geometry into the center point of its bounding box. Check if the location would be fit to your required "centroid".
Takashi
Hi Takashi
Thankyou very much for your help. I managed to get it working and its exactly what i wanted. I have attached it above if anyone is interested.
Many thanks