One of the things I’m trying to improve on is generating proper geometry for roads using way centerlines. Right now the method I’m using just offsets each edge of a given centerline along its normals and then I stitch everything together as one large triangle strip. This is very efficient, but creates overlapping triangles where way segments join. The result looks especially poor if the geometry has any transparency:
I was wondering if anyone here had a better method of creating road geometry (ie, converting a centerline into a ‘ribbon’). I haven’t found many straightforward/promising methods and wanted some input. I’m concerned with performance – hopefully this lib will work on mobile platforms at some point.
This is not the question of hide. It is the question of too little time: Preet should concretely say what makes problems, or in which direction he believes to find solution. Maybe I can help, maybe not. I was a few years ago diploma thesis advisor. The thesis has had exactly this topic but is intelectual property of my company.
I read the inria article – unfortunately it’s not what I’m looking for (but its an interesting read, thanks for the link!). I’m basically just looking for an algorithm to convert a single way into a polygon without any overlap. I’m not too sure about the method with the PostGIS database – I’d be implementing this method with C++ and I need to build geometry on-the-fly.
Much beater result for roads you can get easily by using bisection of angles between roads segments. But it steel don’t work if road segment is shorter then road width. In this case you need to generate “edge events” like described in Skeleton method .
Thank you all for the valuable input. Single ways now render as expected – see the attached screenshot. vvoovv your code example was very instructive. Instead of bisection however, I chose to reposition vertices of the inner edges that would otherwise form an overlap to be coincident at their point of intersection (which looks like it does the same thing). It seems to be working well, I hope I haven’t overlooked something
The array stripes indicates where stripes are places on the road and what width each stripe has
Example from here
stripes: [[-4.4, 0.3], [4.4, 0.3], [0, 0.3]],
In that example the first stripe with width=0.3 is placed 0.6 meters from the left border of the road,
the second stripe with width=0.3 is placed in the middle of the road,
the third stripe with width=0.3 is placed 0.6 meters from the right border of the road