NL:OSM2World

From OpenStreetMap Wiki
Jump to: navigation, search
Help
Available languages
English Nederlands Русский
OSM2World
Screenshot of OSM2World
Author: Tobias Knerr
Website: http://osm2world.org
Version: 0.1.8 (2011-11-09)
License: LGPL (gratis)
Platform: win ; linux ; mac

Genereert een 3D-model van de aarde met behulp van OSM-gegevens.

OSM2World (osm2world.org) is een programma dat een driedimensionaal model van de wereld maakt, gebaseerd op gegevens uit OpenStreetMap. Het model kan vervolgens in enkele formaten worden geëxporteerd.

Contents

Ondersteunde bestandsformaten

Op dit moment worden Wavefront .obj-bestanden, .pov-bestanden voor de raytracer POVRay, directe output met JOGL (de OpenGL-bibliotheek voor Java) en .png-afbeeldingen gegenereerd uit de JOGL-output ondersteund. Indien nodig kunnen andere formaten worden toegevoegd.

Het gebruik van OSM2World

Voorbeeld van een close-up-rendering

Installatie

OSM2World heeft een Java Runtime Environment, version 1.6 of hoger, nodig. Gebruikt u JOSM, dan hebt u er waarschijnlijk al een.

Als u Java gereed heeft, ga dan naar osm2world.org/download en download het ZIP-archief met het gecompileerde programma. Pak het ergens uit op uw computer.

Grafische interface

De OSM2World-interface met een debugweergave

Run OSM2World from the command line using the batch/script that is appropriate for your system. It allows you to open OSM data files and navigate through the models:

Keyboard navigation is available as an alternative. Various debug layers can be displayed, and export to .png, .pov and .obj is possible. Be warned that the visualization is low quality and rather performance hungry at the moment, it primarily serves debugging purposes.

Command line interface

This is a short documentation of the OSM2World command line. Please understand that the command line syntax is not yet stable and is likely to change in the future.

Input and output

Result of the PNG export example

Camera

Defining a camera and projection for viewing the generated scene is required for .png output. It is optional (but recommended) for .pov files. You can either use orthographic or perspective projection. The available parameters for defining the camera depend on this choice.

Orthographic view:

Perspective view:

Logging

Other parameters

Example for alternative color scheme using the --config parameter

If you use --gui, --help or --version, OSM2World will not perform a conversion - it will execute this single action instead.

Parameter files

If you want to perform multiple conversions, you can write the parameters (without program name) into a file and pass it as an argument to OSM2World. Lines starting with # will be ignored.

The main advantage is that conversions will be grouped if possible - i.e. if they have the same --input and --config parameters. For example, you can quickly render the same data from different perspectives.

Examples

 ./osm2world -i example.osm -o image.png --pview.pos +50.2607,+10.965,+110.0 --pview.lookAt 50.2623367,10.9640632,0

Writes an OpenGL rendering of the 3D model generated from example.osm to image.png. The rendering uses a perspective projection, with the defined coordinates for camera position and look at.

 ./osm2world -i example.osm -o tileexample.pov 

Creates a 3D model from example.osm and exports it to the POVRay file example.pov. The POVRay file will not contain a camera definition, so you have to set it manually before feeding example.pov to POVRay.

 ./osm2world -i example.osm -o tileexample.pov --oview.tiles 12,2186,1312 12,2186,1313

Creates a 3D model from example.osm and exports it to the POVRay file tileexample.pov. The POVRay file will also contain the necessary camera definition for an orthographic view. It will be chosen to show the smallest possible bounding box that includes the two tiles 2186,1312 and 2186,1313 (both zoom 12). The camera looks at that area from the south. No --oview.angle parameter is given, so it defaults to 30 degrees. This angle is particularly interesting as it means that two "normal" square tiles will fit exactly into one square orthographic tile (that's because sin(30°)=0.5).

Library interface

You can use OSM2World as a Java library. The preferred way to do this is by using the ConversionFacade class that wraps the whole conversion into a single method call. It lets you provide input data and set output targets. You can also choose which kinds of world objects you want to be created and provide fine-tuning parameters - or you can just stick to the defaults, of course. Have a look at the javadoc.

If you need more functionality, don't understand the code, etc., just ask!

Plans and limitations

Elevation data

Elevation calculation in OSM2World is currently very fragile and deactivated by default, but exists as an experimental option. The calculation is intended to use object attributes (such as incline=*, layer=*, tunnel=* and bridge=*) and absolute elevation (ele=*, either from OSM itself or converted from sources such as SRTM or OpenDEM).

Troubleshooting

Links and resources

Documentation

Project pages

Personal tools
Namespaces
Variants
Actions
site
Toolbox