Finding parcels in a road network

Posted By: PadMalcom

Finding parcels in a road network - 10/04/13 09:23

Hi, does anybody have an idea how I can determine the areas between the strees (marked red in the image)?

What I have is the intersection coordinates of the streets and access to the road models and their vertices.

What I want is a polygon that contains the shape of each area in between the streets.



Any help or idea is highly appreciated!
Posted By: sivan

Re: Finding parcels in a road network - 10/04/13 11:38

you could use a flood fill method if you can create from your road data an array or a bitmap with a proper resolution (road width or half of road width).
Posted By: rojart

Re: Finding parcels in a road network - 10/04/13 11:45

@PadMalcom, I don't know what you exactly meant, but maybe region, like region_create is your choice.
Posted By: PadMalcom

Re: Finding parcels in a road network - 10/11/13 08:26

@Sivan: Thanks for the hint. What I'll try to do is to trace from every vertec to another to create regions.

@rojart: The challenge for me is to determine the edges of the regions not a technical way to define them. But thanks anyway! laugh
Posted By: Helghast

Re: Finding parcels in a road network - 10/14/13 08:57

This might be helpful, shows a flood fill way of doing it;
http://ima.udg.es/~sellares/ComGeo/Vor2D_1.ppt (Powerpoint presentation)
Posted By: PadMalcom

Re: Finding parcels in a road network - 10/14/13 11:34

Thanks helghast, infact I use Voronoi diagrams as an option to draw my road network. Unfortunately, I want tpe parcels to stick exactly to the polygons that define the borders of the roads and intersections.
Posted By: txesmi

Re: Finding parcels in a road network - 10/14/13 13:22

In the case you have the links of each vertex sorted clockwise or inverse, you can take a vertex, go to its neighbor and go to the next vertex by the next link until you reach the first vertex, closing the shape.



If you create each link as a couple of links, one per direction starting from each vertex involved in the link, you can disable the links involved on the shape creation until you have no linked vertexes at all.



It will definetively create a shape per zone, but it is a bit complicated...

Hope it helps
Posted By: txesmi

Re: Finding parcels in a road network - 10/15/13 09:14

I see this solution did not convince you frown

Any question?
Posted By: PadMalcom

Re: Finding parcels in a road network - 10/15/13 09:20

Hey txesmi, thanks for your answer but there are several problems with your approach.

Quote:
go to its neighbor

How do I find the neighbour? My roads consist of ~100 vertices.

Quote:
closing the shape

What if a shape is not closed? If you watch a voronoi diagramm it has ends that don't form a polygon.

Furthermore, there can be more than 2 networks that are not connected. Again a special case that is not covered by your idea.

But thanks anyway! I'm very glad you are thinking with me!
Posted By: sivan

Re: Finding parcels in a road network - 10/15/13 09:40

maybe this helps : http://alienryderflex.com/polygon/
Posted By: txesmi

Re: Finding parcels in a road network - 10/15/13 10:14

Originally Posted By: PadMalcom
How do I find the neighbour? My roads consist of ~100 vertices.

I mean that the neighbors to be computed are the crossroads. The roads are created from crossroad to crossroad as links, aren't they? So the points on the shape are crossroads. The segments between points need to follow the road path that connects them, straight or curved, it is not important.

Originally Posted By: PadMalcom
What if a shape is not closed? If you watch a voronoi diagramm it has ends that don't form a polygon.

The shape surrounds deadends and always closes itself. Look at this picture:

The only problem is to identify witch shape is the outside, but not really a problem: it is the largest one.

Originally Posted By: PadMalcom
Furthermore, there can be more than 2 networks that are not connected. Again a special case that is not covered by your idea.

In the moment you have the outside shapes of more than one net, they need to be considered as inside shapes of a global outern shape.


Originally Posted By: PadMalcom
But thanks anyway! I'm very glad you are thinking with me!

Happy to help... if that helps wink
Posted By: txesmi

Re: Finding parcels in a road network - 10/15/13 19:47

I went from theory to practice.

download




Left click to create new cross points. Drag a cross point to another cross point to connect them. Don't try to cross lines without a cross point because it will probably crash... it is just a simple example for proving that the method works wink
Posted By: oliver2s

Re: Finding parcels in a road network - 10/15/13 20:10

Very nice example txesmi. Thanks for sharing!
Posted By: txesmi

Re: Finding parcels in a road network - 10/15/13 22:12

Pleased to be useful grin

I commented the code a bit in order to be more understandable.

Salud!
Posted By: PadMalcom

Re: Finding parcels in a road network - 10/16/13 07:02

Nice example, but now try to generate a mesh or a polygon out of all the black areas. Oh and please consider such a network, too laugh



EDIT: This example should result in 2 polygons / meshes.
Posted By: txesmi

Re: Finding parcels in a road network - 10/16/13 08:21

It is clear that the method is only valid to identify the figures that make up the interstices: a necessary first step to end up doing what you want.
© 2024 lite-C Forums