[OSM-dev] [osm3d] rendering area data
Jochen Topf
jochen at remote.org
Sun Apr 1 09:30:26 BST 2012
On Sun, Apr 01, 2012 at 02:49:40AM -0400, Preet wrote:
> There are quite a few devs working with OpenStreetMap data in 3d and
> judging from screenshots, they've been able to do some pretty awesome
> stuff so far. I'm trying to do something similar and wanted some
> feedback, specifically for rendering area data, that is, anything that
> falls under the 'area' primitive in terms of OpenStreetMap data --
> buildings, borders, etc. I'm particularly interested in how to convert
> area/relation information from *.osm xml data into polygons that can
> be rendered (decomposed into triangles).
>
> Starting from the osm area primitive info [1], it's possible to get
> contours (ie node lists) for outer geometry and holes within the area.
> This data can then be fed into something like poly2tri [2], which is a
> lib that will triangulate simple polygons (holes can be specified
> too). The triangulated data is a mesh that can be fed into any
> renderer, like OpenGL. However, we can't assume all area data are
> simple polys; [4] shows some building geometry that's not strictly
> simple. So my main problem/question to devs that are rendering
> buildings/area geometry in 3d is:
>
> * How do you build the 3d geometry for areas that are potentially
> complex polygons?
I don't know about the 3d aspect and the triangulation, but I suggest you start
from something that already exists for assembling nodes, ways, and relations
into multipolygons. Several people have already implemented that part,
including partially fixing broken multipolygons etc. Then you can build your
stuff on top of that. I am aware of three implementations, one in osm2pgsql,
one in imposm, one in Osmium. (Info on all three in the wiki.) There might be
others. If you are ok with C++ and/or Javascript, Osmium is probably the
easiest to use, because unlike osm2pgsql and imposm, Osmium is a library thats
specifically built for including in other programs.
Jochen
--
Jochen Topf jochen at remote.org http://www.remote.org/jochen/ +49-721-388298
More information about the dev
mailing list