Well, I’m trying to organize some geometry by location ( in ArcGIS, this would be a Spatial Join ).
I made this definition, that works with some polygons: by the center point, I can find wich building is inside the plot (both closed polylines) and organize them by tree/branches: One branch for each plot and same branch path for various buildings. Example:
Tree Plots (red): Branch {233} with one single polyline in plot geometry
Tree Buildings (green): Branch {233} with two buildings - two polylines - that has its center inside the plot 233.
If you need to do the same with few polygons, my definition works:
But the main component that does it, the Point In Curve, it is not efficient if you have thousands plots and hundred of thousands buildings, because it compares every point to every plot. I wish to have a component that tests only the points that are close to the polyline, so the processing time is optmized.
This should work faster. Plots with a high area value are kind of a problem since the closest points to the center are most likely not inside the curve, so I filtered by area and divided the plot curves that have a larger area than 3000. You have to play with the slider values if you use it for a different scenario.
Hope it helps.
Jakinta, your definition don’t give to us the plots and buildings in the same branch. As you can see in the image below, the path 64, for example, gives us buildings that are not inside the weird plot form. But the search distance is a good idea, i’ll try to work on that.
Uhm, that’s such a large data set every try takes minutes to calculate and I think it doesn’t matter if it takes 10 or 20 minutes, since it’s a script you run only once and internalize the result after.
But what I noticed is that there are a lot of invalid curves in both data sets and the branching of the plots doesn’t make any sense atleast for branch {0}, didn’t really check the others, {1} on the other hand made sense.
I see, Daniel. The curves come from a shapefile (.shp), using the ghshp component. But it does not cause problems, the invalid curves still forms surfaces, probably Rhino corrects it.
And about the branches: the branch 0 is for plots that has no block for it. Then, the branch 1 and so on are correct.
But Daniel, running your definition, I couldn’t get it right. Probably because the number sliders. I’m not sure what configuration it should have. My definition is running for hours and no results until now (running in an intel i5 2º gen). Can you try and see if your definition works for the whole city?
To solve this kind of problem you have to use some sort of spatial search algorithm.
In attached C# component RTree is used with its capability of spatial searching. Execution time is around 1 sec for given set of curves, few more seconds is for manipulating data - “moving” it from one component to another.