Skip to main content
Solved

Connect points to the grid


Hi, 

I have a set of polygons (representing the street blocks) from which I was able to create centroids. I would like to create a grid from those points, meaning that points would represent grid intersections. Have already tried with triangulation but had no success.

imageIf it is helpful I can try and upload a sample. I would really appreciate any suggestion. Thank you.

 

Edit:

I believe I need to explain a bit more. In the current approach I am creating a "grid" based on the street centerlines and merge them with Neighbourhood Aggregator to 800x800m cells. The problem is that at the end grid borders are always on the centerlines (one side of the street is in one cell, where the other side of the street is in neighbouring cell).

currentI would like to now try a different approach, where the grid borders would connect centroids of those blocks, this for example would be the output (red lines). image2newIdeally, they would have a more rectangular shape, but not exclusively, it could also contain squares and triangles. In the end I would still merge them with the Neighbourhood Aggregator to 800x800m cells.

 

Perhaps a solution is in a different approach, cause in the end I would not like to have the grid borders on the centerlines. Perhaps there is just a way to shift borders for a few meters.

Best answer by alexlynch3450

mvosner wrote:

Thanks @alexlynch3450​ , the anchorsnapper is the closest that brought me to at least some kind of result. But I can not make it look as nice as I would like to. imageIs there a way to make it more in a rectangular shape? I tried to play around with parameters, but no real success.

Hey @mvosner​  I might have an approach.

  1. In the attached workspace, navigate to "CenterPointExtractor" and change 'Point Extraction Mode' parameter to "Center of Gravity"'
  2. add "2DGridAccumulator" after vertex creator transformer
    1. edit cell size parameter to 100x100 (this value will likely change as you play around with it).
    2. Change 'Type of Grid to Create' to "Polygons"
  3. add " AnchoredSnapper" use output from vertexcreator as Anchor and output from 2dgridaccumlator as candidate
    1. Change 'Snapping Type:' to "Vertex Snapping"
    2. Assign value to snapping distance (I used 250)

 

Screenshot 2021-01-14 080319

View original
Did this help you find an answer to your question?

10 replies

redgeographics
Celebrity
Forum|alt.badge.img+49

Could you try and sketch what kind of grid you would want to get out of it? Should it be a regular grid? Squares/rectangles or triangles?


alexlynch3450
Contributor
Forum|alt.badge.img+14

Maybe use the anchorsnapper transformer using points as anchor and polygon as candidate--perhaps segment snapping?


Forum|alt.badge.img+2
  • January 13, 2021

@mvosner​  Uploading a sample, your current workspace and also a sketch of what you'd like the output to look like would help the community come up with some ideas for a solution.


  • Author
  • January 14, 2021
redgeographics wrote:

Could you try and sketch what kind of grid you would want to get out of it? Should it be a regular grid? Squares/rectangles or triangles?

Thank you for the suggestion, hope it is more clear now :)


  • Author
  • January 14, 2021
markatsafe wrote:

@mvosner​  Uploading a sample, your current workspace and also a sketch of what you'd like the output to look like would help the community come up with some ideas for a solution.

Thank you for the suggestion, hope it is more clear now :)


  • Author
  • January 14, 2021
alexlynch3450 wrote:

Maybe use the anchorsnapper transformer using points as anchor and polygon as candidate--perhaps segment snapping?

Thanks @alexlynch3450​ , the anchorsnapper is the closest that brought me to at least some kind of result. But I can not make it look as nice as I would like to. imageIs there a way to make it more in a rectangular shape? I tried to play around with parameters, but no real success.


redgeographics
Celebrity
Forum|alt.badge.img+49
mvosner wrote:

Thank you for the suggestion, hope it is more clear now :)

It is a lot clearer now, thanks!

Thinking out loud here (no time to play with this sadly): how about you buffer streets, (anchor)snap the buffers to the centroids and then intersect those lines.


alexlynch3450
Contributor
Forum|alt.badge.img+14
  • Contributor
  • Best Answer
  • January 14, 2021
mvosner wrote:

Thanks @alexlynch3450​ , the anchorsnapper is the closest that brought me to at least some kind of result. But I can not make it look as nice as I would like to. imageIs there a way to make it more in a rectangular shape? I tried to play around with parameters, but no real success.

Hey @mvosner​  I might have an approach.

  1. In the attached workspace, navigate to "CenterPointExtractor" and change 'Point Extraction Mode' parameter to "Center of Gravity"'
  2. add "2DGridAccumulator" after vertex creator transformer
    1. edit cell size parameter to 100x100 (this value will likely change as you play around with it).
    2. Change 'Type of Grid to Create' to "Polygons"
  3. add " AnchoredSnapper" use output from vertexcreator as Anchor and output from 2dgridaccumlator as candidate
    1. Change 'Snapping Type:' to "Vertex Snapping"
    2. Assign value to snapping distance (I used 250)

 

Screenshot 2021-01-14 080319


  • Author
  • January 15, 2021
mvosner wrote:

Thanks @alexlynch3450​ , the anchorsnapper is the closest that brought me to at least some kind of result. But I can not make it look as nice as I would like to. imageIs there a way to make it more in a rectangular shape? I tried to play around with parameters, but no real success.

Hi @alexlynch3450​ this is great. Have tried it and played with the parameters. In "2DGridAccumulator" I used cell size 300x300 and in "AnchoredSnapper" I used 500 for snapping distance.

Here is the result:

image (1)Thank you!😀


  • Author
  • January 15, 2021
mvosner wrote:

Thank you for the suggestion, hope it is more clear now :)

thank you for the suggestion. I have tried it and the buffer definitely made a better result than without it. But in the end the result from @alexlynch3450​ was the best one.


Cookie policy

We use cookies to enhance and personalize your experience. If you accept you agree to our full cookie policy. Learn more about our cookies.

 
Cookie settings