Skip to main content

Hello, I have a list of points and their geometry:

Point IDStreet NameRegion 1Street AA

 

 

2Street A

 

A

 

 

3Street B

 

A

 

 

4Street B

 

A

 

 

5Street C

 

B

 

 

6Street C

 

B

 

 

7Street A

 

C

 

 

8Street A

 

C

 

 

 

I would like to create points that are located midway between points that share the same street name and region. In this case, I would like to create a center point between Point 1 & 2, another one between Point 3 & 4, another one between Point 5 & 6, another one between Point 7 & 8. There are always exactly two points sharing the same street name and region, never more or less. What transformers could help me? Thx.

@katt

I'm not 100% sure on this, but I feel like you could run your points into a LineBuilder, grouping by Street Name and Region. Then, run the line output into a Snipper set to percentage mode with the start and end locations set to 50. This should find the mid point of the lines.


The easiest is probably to create the lines 1-2, 3-4, etc. using the LineBuilder (group by Street Name + Region) and then use the CenterPointReplacer to get the mid-point on each line.


I would try a LineBuilder grouping by Street Name followed by a snipper with Snipping Mode Distance (Percentage) and Starting Location 50 and Ending Location 50 to get a point at the centre of the line


@katt

I'm not 100% sure on this, but I feel like you could run your points into a LineBuilder, grouping by Street Name and Region. Then, run the line output into a Snipper set to percentage mode with the start and end locations set to 50. This should find the mid point of the lines.

Snap!


Another option would be using the Aggregator transformer (group by street and region), followed by a CenterPointReplacer.


Reply