OpenStreetMap Forum

The Free Wiki World Map

You are not logged in.

#1 2012-04-17 10:18:47

Building road geometry from osm way centerlines

Hiya,

I'm working on a 3d renderer for libosmscout [1]:

5BPq1.png

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:

5mmNe.png

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.


-Preet

[1] http://wiki.openstreetmap.org/wiki/Libosmscout

Offline

#2 2012-04-17 10:47:35

Re: Building road geometry from osm way centerlines

Hello Preet,
good job.
I worked with 6 years before. Please contact me.

Offline

#3 2012-04-17 11:37:55

Re: Building road geometry from osm way centerlines

Hi,

might be interesting http://hal.inria.fr/docs/00/20/76/79/PDF/article.pdf
Also I could provide you some (german language) information about the method we're currently using for our system (http://wiki.openstreetmap.org/wiki/File:Xml3dosm.jpg) to generate street networks and crossings. But this requires some preprocessing on OSM data stored in a PostGIS db.

Offline

#4 2012-04-17 12:58:41

Re: Building road geometry from osm way centerlines

marek kleciak wrote:

I worked with 6 years before. Please contact me.

Marek:
I don't see a reason to hide information. Please place information or links here

Offline

#5 2012-04-17 13:09:48

Re: Building road geometry from osm way centerlines

I started a special topic dedicated to algorithms.
rajo, Marek:
Please place description or links to your algorithms there

Offline

#6 2012-04-17 13:12:51

Re: Building road geometry from osm way centerlines

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.

Offline

#7 2012-04-17 15:43:49

Re: Building road geometry from osm way centerlines

rajo wrote:

Hi,

might be interesting http://hal.inria.fr/docs/00/20/76/79/PDF/article.pdf
Also I could provide you some (german language) information about the method we're currently using for our system (http://wiki.openstreetmap.org/wiki/File:Xml3dosm.jpg) to generate street networks and crossings. But this requires some preprocessing on OSM data stored in a PostGIS db.

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.

Offline

#8 2012-04-17 16:50:58

Re: Building road geometry from osm way centerlines

preetdesai:

If you need just a single way on a flat surface, here is my implementation in javascript:
https://github.com/vvoovv/djeo-povray/b … acemark.js

You need to take a look at the makeRoad function (line 117-201)
coords defined at the line 118 is an array of coordinates that define the way


I haven't yet announced it here, at the forum.
The goal is to generate photorealistical images from OSM data and external models with POV-Ray

Offline

#9 2012-04-17 18:07:13

Re: Building road geometry from osm way centerlines

preetdesai:
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 [1].

rajo: this article looks really nice.


[1] - Straight Skeleton Implementation, Petr Felkel and Stepan Obdrzalek
http://www.dma.fi.upm.es/mabellanas/tfc … tation.pdf

Offline

#10 2012-04-19 02:13:10

Re: Building road geometry from osm way centerlines

Hey,

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 smile

UUWto.png

Offline

#11 2012-04-19 02:57:17

Re: Building road geometry from osm way centerlines

Hello preetdesai,
all street have the same width. Do You think about implementation of street width as a function of lane numbers? Use heuristic: 1 lane =2,50m

When you have segments with changing of lane numbers use heuristic: Lenght of the konic part of the street = 50m

Best,
Marek

Offline

Board footer

Powered by FluxBB 1.4.8
Hosting sponsored by Oxilion